Bladeren bron

FixCrmProcesInitIdx: add example sql for tableAcl init

Piotr Labudda 10 jaren geleden
bovenliggende
commit
b3670d3755
1 gewijzigde bestanden met toevoegingen van 34 en 0 verwijderingen
  1. 34 0
      SE/se-lib/Route/FixCrmProcesInitIdx.php

+ 34 - 0
SE/se-lib/Route/FixCrmProcesInitIdx.php

@@ -516,6 +516,40 @@ SQL;
 					join `CRM_PRZYPADEK` as przyp on (przyp.`ID`=wsk.`ID_PRZYPADEK`)
 				where z.`TYPE`='KOMORKA'
 					and z.`A_STATUS` in('WAITING','NORMAL')
+SQL;
+		$sqlExample_TableCellToProcesForInitTable = <<<SQL
+			select z.`ID` as `ID_CELL`
+					, z.`DESC` as `CELL_NAME`
+					, z.`DESC_PL` as `CELL_LABEL`
+					, z.`OPIS` as `CELL_DESC`
+					, z.`SORT_PRIO` as `SORT_PRIO`
+					, zp.`ID` as `ID_TABLE`
+					, zp.`DESC` as `TABLE_NAME`
+					, wsk.`ID_PROCES` as `ID_PROCES`
+					, sum(IF(przyp.`FORM_TREAT` & 2,   1, 0)) as PERM_R
+					, sum(IF(przyp.`FORM_TREAT` & 4,   1, 0)) as PERM_W
+					, sum(IF(przyp.`FORM_TREAT` & 8,   1, 0)) as PERM_X
+					, sum(IF(przyp.`FORM_TREAT` & 16,  1, 0)) as PERM_C
+					, sum(IF(przyp.`FORM_TREAT` & 32,  1, 0)) as PERM_S
+					, sum(IF(przyp.`FORM_TREAT` & 64,  1, 0)) as PERM_O
+					, sum(IF(przyp.`FORM_TREAT` & 128, 1, 0)) as PERM_V
+					, sum(IF(przyp.`FORM_TREAT` & 256, 1, 0)) as PERM_E
+				from `CRM_LISTA_ZASOBOW` z
+					join `CRM_LISTA_ZASOBOW` zp on(zp.`ID`=z.`PARENT_ID` and zp.`TYPE`='TABELA' and zp.`A_STATUS` in('WAITING','NORMAL'))
+					join `CRM_WSKAZNIK` wsk on(wsk.`ID_ZASOB`=z.`ID` and wsk.`A_STATUS` in('WAITING','NORMAL'))
+					join `CRM_PROCES` p on(p.`ID`=wsk.`ID_PROCES` and p.`A_STATUS` in('WAITING','NORMAL'))
+					join `CRM_PRZYPADEK` as przyp on (przyp.`ID`=wsk.`ID_PRZYPADEK`)
+				where z.`TYPE`='KOMORKA'
+					and z.`A_STATUS` in('WAITING','NORMAL')
+					and zp.`ID`='{$idTable}'
+					and wsk.`ID_PROCES` in({$sqlIdProcesList})
+				group by z.`ID`, wsk.`ID_PROCES`
+				order by `SORT_PRIO`
+SQL;
+		$sqlExample_sqlIdProcesList = <<<SQL
+			select gi.`ID_PROCES`
+				from `CRM_PROCES_idx_GROUP_to_PROCES` gi
+				where gi.`ID_GROUP` in({$idUserGroupList})
 SQL;
 		$sqlList_BUG = <<<SQL
 			-- BUG  #1349 - View's SELECT contains a subquery in the FROM clause