|
|
@@ -1811,44 +1811,43 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
|
|
|
if ($tree->get_param('rozwin_proces')) {
|
|
|
$wsk = ProcesHelper::get_wskazniki($r->ID);
|
|
|
$tree->log('show item -> get_wskazniki', array('get_wskazniki'));
|
|
|
- }
|
|
|
|
|
|
- foreach ($wsk as $idx => $w) $wsk[$idx]->ACL_TYPE = in_array($w->TYPE, ['STANOWISKO', 'DZIAL', 'PODMIOT']) ? 'GROUP' : '';
|
|
|
-
|
|
|
- // UI::table([ 'rows' => array_map(function ($w) {
|
|
|
- // unset($w->path);
|
|
|
- // unset($w->OPIS);
|
|
|
- // return (array)$w;
|
|
|
- // }, $wsk) ]);
|
|
|
- $fixedWskList = array();
|
|
|
- foreach ($wsk as $w) {
|
|
|
- if ('GROUP' == $w->ACL_TYPE) $fixedWskList[] = $w;
|
|
|
- }
|
|
|
- if ('PROCES_INIT' == $r->TYPE) {// fetch INHERIT acl groups
|
|
|
- $idGroups = array_reduce($wsk, function ($carry, $w) {
|
|
|
- if ('GROUP' != $w->ACL_TYPE) return $carry;
|
|
|
- return (!empty($carry)) ? "{$carry},{$w->ID}" : $w->ID;
|
|
|
- }, "");
|
|
|
- $sqlFilterIdGroups = (!empty($idGroups)) ? " and gp.ID_GROUP not in({$idGroups})" : "";
|
|
|
- foreach (DB::getPDO()->fetchAll("select z.ID
|
|
|
- , z.PARENT_ID
|
|
|
- , z.`TYPE`
|
|
|
- , z.`DESC`
|
|
|
- , 'INHERIT' as ACL_TYPE
|
|
|
- from CRM_PROCES_idx_GROUP_to_PROCES gp
|
|
|
- join CRM_LISTA_ZASOBOW z on(z.ID = gp.ID_GROUP)
|
|
|
- where gp.ID_PROCES = {$r->ID}
|
|
|
- {$sqlFilterIdGroups}
|
|
|
- ") as $aclW) {
|
|
|
- $fixedWskList[] = (object)$aclW;
|
|
|
+ foreach ($wsk as $idx => $w) $wsk[$idx]->ACL_TYPE = in_array($w->TYPE, ['STANOWISKO', 'DZIAL', 'PODMIOT']) ? 'GROUP' : '';
|
|
|
+
|
|
|
+ // UI::table([ 'rows' => array_map(function ($w) {
|
|
|
+ // unset($w->path);
|
|
|
+ // unset($w->OPIS);
|
|
|
+ // return (array)$w;
|
|
|
+ // }, $wsk) ]);
|
|
|
+ $fixedWskList = array();
|
|
|
+ foreach ($wsk as $w) {
|
|
|
+ if ('GROUP' == $w->ACL_TYPE) $fixedWskList[] = $w;
|
|
|
}
|
|
|
+ if ('PROCES_INIT' == $r->TYPE) {// fetch INHERIT acl groups
|
|
|
+ $idGroups = array_reduce($wsk, function ($carry, $w) {
|
|
|
+ if ('GROUP' != $w->ACL_TYPE) return $carry;
|
|
|
+ return (!empty($carry)) ? "{$carry},{$w->ID}" : $w->ID;
|
|
|
+ }, "");
|
|
|
+ $sqlFilterIdGroups = (!empty($idGroups)) ? " and gp.ID_GROUP not in({$idGroups})" : "";
|
|
|
+ foreach (DB::getPDO()->fetchAll("select z.ID
|
|
|
+ , z.PARENT_ID
|
|
|
+ , z.`TYPE`
|
|
|
+ , z.`DESC`
|
|
|
+ , 'INHERIT' as ACL_TYPE
|
|
|
+ from CRM_PROCES_idx_GROUP_to_PROCES gp
|
|
|
+ join CRM_LISTA_ZASOBOW z on(z.ID = gp.ID_GROUP)
|
|
|
+ where gp.ID_PROCES = {$r->ID}
|
|
|
+ {$sqlFilterIdGroups}
|
|
|
+ ") as $aclW) {
|
|
|
+ $fixedWskList[] = (object)$aclW;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ foreach ($wsk as $w) {
|
|
|
+ if ('GROUP' != $w->ACL_TYPE) $fixedWskList[] = $w;
|
|
|
+ }
|
|
|
+ $wsk = $fixedWskList;
|
|
|
+ $tree->log('show item -> get_wskazniki inherit', array('get_wskazniki'));
|
|
|
}
|
|
|
- foreach ($wsk as $w) {
|
|
|
- if ('GROUP' != $w->ACL_TYPE) $fixedWskList[] = $w;
|
|
|
- }
|
|
|
- $wsk = $fixedWskList;
|
|
|
- $tree->log('show item -> get_wskazniki inherit', array('get_wskazniki'));
|
|
|
-
|
|
|
|
|
|
$pytania = array();
|
|
|
$tblPytaniaId = $tree->get_param('PytaniaTblId');
|