$fetchTableProcesInitListSql('.$idTable.') ';print_r($fetchTableProcesInitListSql);echo''; $tableProcesInitList = array(); $db = DB::getDB(); $res = $db->query($fetchTableProcesInitListSql); while ($r = $db->fetch($res)) { $tableProcesInitList[$r->ID] = $r->DESC; } return $tableProcesInitList; } public static function getProcesInitMapTreeOnlyIds($ids) { $mapTree = array(); $map = self::getProcesInitMapOnlyIds($ids); foreach ($map as $r) { if ('PROCES_INIT' == $r->TYPE) { $mapTree[$r->ID_PROCES] = array(); } } foreach ($map as $r) { if ('GOTO_AND_RETURN' == $r->TYPE) { $mapTree[$r->idx_MAIN_PROCES_INIT_ID][$r->ID_PROCES] = array(); } } foreach ($map as $r) { if ('GOTO_AND_RETURN_LVL2' == $r->TYPE) { $mapTree[$r->idx_MAIN_PROCES_INIT_ID][$r->idx_GOTO_LVL2_INIT_ID][$r->ID_PROCES] = true; } } return $mapTree; } public static function getProcesInitMapOnlyIds($ids) { $map = array(); $sqlIds = V::filter($ids, array('V', 'filterPositiveInteger')); $sqlIds = implode(',', $sqlIds); if (empty($sqlIds)) return $map; $sql = <<query($sql); while ($r = $db->fetch($res)) { $map[] = $r; } //DBG::table("MAP", $map, __CLASS__, __FUNCTION__, __LINE__); return $map; } public static function canGroupViewProces($idGroup, $idProcesInit) { $isAllowed = false; $idProcesInit = (int)$idProcesInit; if (!$idProcesInit) return false; $checkProcesAccessSql = <<query($checkProcesAccessSql); if ($r = $db->fetch($res)) { if ($r->cnt > 0) { $isAllowed = true; } } return $isAllowed; } }