|
@@ -49,6 +49,12 @@ class Route_P5Menu extends RouteBase {
|
|
|
$bookmarks = UserBookmarks::getInstance()->getBookmarks();
|
|
$bookmarks = UserBookmarks::getInstance()->getBookmarks();
|
|
|
$makeShortLabel = [ $this, 'getRawLabel' ];
|
|
$makeShortLabel = [ $this, 'getRawLabel' ];
|
|
|
|
|
|
|
|
|
|
+ $sqlIds = implode(", ", array_keys($listObjects));
|
|
|
|
|
+ $cacheZasobInfo = DB::getPDO()->fetchAllByKey("
|
|
|
|
|
+ select `ID`, `DESC`, `DESC_PL`, `OPIS`
|
|
|
|
|
+ from CRM_LISTA_ZASOBOW
|
|
|
|
|
+ where ID in ({$sqlIds})
|
|
|
|
|
+ ", $key = 'ID');
|
|
|
return [
|
|
return [
|
|
|
'type' => 'success',
|
|
'type' => 'success',
|
|
|
'msg' => "OK",
|
|
'msg' => "OK",
|
|
@@ -56,13 +62,25 @@ class Route_P5Menu extends RouteBase {
|
|
|
'version' => $this->getVersion(),
|
|
'version' => $this->getVersion(),
|
|
|
|
|
|
|
|
'objects' => array_values( array_filter(
|
|
'objects' => array_values( array_filter(
|
|
|
- array_map(function ($acl, $idZasob) use ($makeShortLabel) {
|
|
|
|
|
|
|
+ array_map(function ($acl, $idZasob) use ($makeShortLabel, $cacheZasobInfo) {
|
|
|
if (!$acl) return [
|
|
if (!$acl) return [
|
|
|
'id' => $idZasob,
|
|
'id' => $idZasob,
|
|
|
'TODO' => 'TODO'
|
|
'TODO' => 'TODO'
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
- $zasobObj = ProcesHelper::getZasobTableInfo($acl->getID());
|
|
|
|
|
|
|
+ // $zasobObj = ProcesHelper::getZasobTableInfo($acl->getID());
|
|
|
|
|
+ // $zasobObj = (object)DB::getPDO()->fetchFirst("
|
|
|
|
|
+ // select `ID`, `DESC`, `DESC_PL`, `OPIS`
|
|
|
|
|
+ // from CRM_LISTA_ZASOBOW
|
|
|
|
|
+ // where ID = :id
|
|
|
|
|
+ // ", [ ':id' => $acl->getID() ]);
|
|
|
|
|
+ // if ((int)$idZasob !== (int)$acl->getID()) throw new Exception("BUG idZasob !== Acl->getID() : ({$idZasob}) !== (".$acl->getID().")");
|
|
|
|
|
+ if (!array_key_exists($acl->getID(), $cacheZasobInfo)) return [
|
|
|
|
|
+ 'id' => $idZasob,
|
|
|
|
|
+ 'TODO' => "Zasób '{$idZasob}' nie istnieje w bazie"
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ $zasobObj = (object)$cacheZasobInfo[$acl->getID()];
|
|
|
return [
|
|
return [
|
|
|
'id' => $acl->getID(),
|
|
'id' => $acl->getID(),
|
|
|
'namespace' => $acl->getNamespace(),
|
|
'namespace' => $acl->getNamespace(),
|