|
@@ -279,8 +279,14 @@ class Core_AclHelper {// Helper class for Acl
|
|
|
if (count($partsNs) > 2) { // is AntAcl
|
|
if (count($partsNs) > 2) { // is AntAcl
|
|
|
$backRefList = ACL::getBackRefList($ns);
|
|
$backRefList = ACL::getBackRefList($ns);
|
|
|
DBG::log($backRefList, 'array', "\$backRefList");
|
|
DBG::log($backRefList, 'array', "\$backRefList");
|
|
|
|
|
+ {
|
|
|
|
|
+ $backRefLabelList = ACL::fetchAllAclInfoByNs( array_map( V::makePick('namespace'), $backRefList ) );
|
|
|
|
|
+ // DBG::log($backRefLabelList, 'array', "\$backRefLabelList");
|
|
|
|
|
+ $backRefLabelsByNs = array_combine( array_map( V::makePick('namespace'), $backRefLabelList ), array_map( V::makePick('DESC_PL'), $backRefLabelList ) );
|
|
|
|
|
+ // DBG::log($backRefLabelsByNs, 'array', "\$backRefLabelsByNs");
|
|
|
|
|
+ }
|
|
|
foreach ($backRefList as $backRef) { // [ namespace, idInstance ]
|
|
foreach ($backRefList as $backRef) { // [ namespace, idInstance ]
|
|
|
- $backRefLabel = $backRef['namespace']; // TODO: get DESC from Zasoby
|
|
|
|
|
|
|
+ $backRefLabel = V::get($backRef['namespace'], $backRef['namespace'], $backRefLabelsByNs);
|
|
|
$backRefShort = explode("/", $backRefLabel);
|
|
$backRefShort = explode("/", $backRefLabel);
|
|
|
$backRefShort = array_pop($backRefShort);
|
|
$backRefShort = array_pop($backRefShort);
|
|
|
$backRefShort = (strlen($backRefShort) > 28) ? substr($backRefShort, 0, 28) . "..." : $backRefShort;
|
|
$backRefShort = (strlen($backRefShort) > 28) ? substr($backRefShort, 0, 28) . "..." : $backRefShort;
|
|
@@ -300,7 +306,7 @@ class Core_AclHelper {// Helper class for Acl
|
|
|
'childRefNS' => $acl->getNamespace(),
|
|
'childRefNS' => $acl->getNamespace(),
|
|
|
'childRefPK' => $id,
|
|
'childRefPK' => $id,
|
|
|
]),
|
|
]),
|
|
|
- 'title' => "Powiązania od '{$backRefLabel}'",
|
|
|
|
|
|
|
+ 'title' => "Powiązania od '{$backRefLabel}' ({$totalBackRefs})",
|
|
|
'label' => "Powiązania od '{$backRefShort}' <span class=\"badge\">{$totalBackRefs}</span>",
|
|
'label' => "Powiązania od '{$backRefShort}' <span class=\"badge\">{$totalBackRefs}</span>",
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
@@ -308,8 +314,14 @@ class Core_AclHelper {// Helper class for Acl
|
|
|
if (count($partsNs) > 2) { // is AntAcl
|
|
if (count($partsNs) > 2) { // is AntAcl
|
|
|
$refList = ACL::getRefList($ns);
|
|
$refList = ACL::getRefList($ns);
|
|
|
DBG::log($refList, 'array', "\$refList");
|
|
DBG::log($refList, 'array', "\$refList");
|
|
|
|
|
+ {
|
|
|
|
|
+ $refLabelList = ACL::fetchAllAclInfoByNs( array_map( V::makePick('namespace'), $backRefList ) );
|
|
|
|
|
+ // DBG::log($refLabelList, 'array', "\$refLabelList");
|
|
|
|
|
+ $refLabelsByNs = array_combine( array_map( V::makePick('namespace'), $refLabelList ), array_map( V::makePick('DESC_PL'), $refLabelList ) );
|
|
|
|
|
+ // DBG::log($refLabelsByNs, 'array', "\$refLabelsByNs");
|
|
|
|
|
+ }
|
|
|
foreach ($refList as $refInfo) { // [ namespace, idInstance ]
|
|
foreach ($refList as $refInfo) { // [ namespace, idInstance ]
|
|
|
- $refLabel = $refInfo['namespace']; // TODO: get DESC from Zasoby
|
|
|
|
|
|
|
+ $refLabel = V::get($refInfo['namespace'], $refInfo['namespace'], $refLabelsByNs);
|
|
|
$refShortLabel = explode("/", $refLabel);
|
|
$refShortLabel = explode("/", $refLabel);
|
|
|
$refShortLabel = array_pop($refShortLabel);
|
|
$refShortLabel = array_pop($refShortLabel);
|
|
|
$refShortLabel = (strlen($refShortLabel) > 28) ? substr($refShortLabel, 0, 28) . "..." : $refShortLabel;
|
|
$refShortLabel = (strlen($refShortLabel) > 28) ? substr($refShortLabel, 0, 28) . "..." : $refShortLabel;
|
|
@@ -330,7 +342,7 @@ class Core_AclHelper {// Helper class for Acl
|
|
|
'backRefPK' => $id,
|
|
'backRefPK' => $id,
|
|
|
'backRefField' => Api_WfsNs::typeName($refInfo['namespace']),
|
|
'backRefField' => Api_WfsNs::typeName($refInfo['namespace']),
|
|
|
]),
|
|
]),
|
|
|
- 'title' => "Powiązania do '{$refLabel}'",
|
|
|
|
|
|
|
+ 'title' => "Powiązania do '{$refLabel}' ({$totalRefs})",
|
|
|
'label' => "Powiązania do '{$refShortLabel}' <span class=\"badge\">{$totalRefs}</span>",
|
|
'label' => "Powiązania do '{$refShortLabel}' <span class=\"badge\">{$totalRefs}</span>",
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|