소스 검색

updated acl usage in Storage

Piotr Labudda 8 년 전
부모
커밋
8c0fbaec19
1개의 변경된 파일20개의 추가작업 그리고 13개의 파일을 삭제
  1. 20 13
      SE/se-lib/Route/Storage.php

+ 20 - 13
SE/se-lib/Route/Storage.php

@@ -915,7 +915,7 @@ jQuery(document).on('p5UIBtnAjax:Storage:checkObjectInstallAjax:ajaxLoaded', fun
 							UI::h('summary', ['style'=>"cursor:pointer"], $row['DATA_TYPE']),
 							UI::h('p', [], $row['COLUMN_TYPE']),
 						]);
-						$item['proces'] = array();
+						$item['w procesie'] = array();
 						$item['id_zasob'] = 0;
 						$item['PERM_R'] = 0;
 						$item['PERM_W'] = 0;
@@ -927,7 +927,7 @@ jQuery(document).on('p5UIBtnAjax:Storage:checkObjectInstallAjax:ajaxLoaded', fun
 						$item['PERM_E'] = 0;
 						foreach ($aclTableRows as $aclInfo) {
 							if (strtolower($aclInfo['CELL_NAME']) == strtolower($row['COLUMN_NAME'])) {
-								$item['proces'][] = $aclInfo['ID_PROCES'];
+								$item['w procesie'][] = $aclInfo['ID_PROCES'];
 								$item['id_zasob'] = $aclInfo['ID_CELL'];
 								$item['PERM_R'] += $aclInfo['PERM_R'];
 								$item['PERM_W'] += $aclInfo['PERM_W'];
@@ -939,10 +939,11 @@ jQuery(document).on('p5UIBtnAjax:Storage:checkObjectInstallAjax:ajaxLoaded', fun
 								$item['PERM_E'] += $aclInfo['PERM_E'];
 							}
 						}
-						$item['proces'] = (empty($item['proces']))
+						$item['w procesie'] = (empty($item['w procesie']))
 							? "<i style=\"color:red\">Brak</i>"
-							: UI::h('span', ['style'=>"white-space:nowrap"], implode(", ", $item['proces']));
+							: UI::h('span', ['style'=>"white-space:nowrap"], implode(", ", $item['w procesie']));
 						if (!$item['id_zasob']) $item['id_zasob'] = DB::getPDO()->fetchValue("select ID from CRM_LISTA_ZASOBOW where `DESC` = '{$fieldName}' and PARENT_ID = {$idTable} limit 1");
+						$item['id_zasob'] = ($item['id_zasob']) ? $item['id_zasob'] : UI::h('i', ['style'=>"color:silver"], "Brak");
 						return $item;
 					}, DB::getPDO()->fetchAll("
 						select t.COLUMN_NAME, t.DATA_TYPE, t.COLUMN_TYPE
@@ -956,7 +957,7 @@ jQuery(document).on('p5UIBtnAjax:Storage:checkObjectInstallAjax:ajaxLoaded', fun
 			if (!empty($csvIdProces)) {
 				$userLogin = User::getLogin();
 				$csvIdProces = implode(",", $csvIdProces);
-				UI::tag('h4', [], "Procesy dla '{$userLogin}': [{$csvIdProces}] <small><i>(z tabeli CRM_PROCES_idx_USER_to_PROCES_VIEW)</i></small>");
+				UI::tag('h4', ['style'=>"margin-top:40px"], "Procesy dla '{$userLogin}': [{$csvIdProces}] <small><i>(z tabeli CRM_PROCES_idx_USER_to_PROCES_VIEW)</i></small>");
 				$rows = DB::getPDO()->fetchAll("
 					select ID_PROCES
 					from `CRM_PROCES_idx_USER_to_PROCES_VIEW`
@@ -964,15 +965,12 @@ jQuery(document).on('p5UIBtnAjax:Storage:checkObjectInstallAjax:ajaxLoaded', fun
 						and ID_PROCES in({$csvIdProces})
 					group by ID_PROCES
 				");
-				// UI::table([
-				// 	'caption' => "Procesy dla '{$userLogin}' <small>CRM_PROCES_idx_USER_to_PROCES_VIEW</small>",
-				// 	'rows' => $rows
-				// ]);
 				$userIdProces = array(); foreach ($rows as $row) $userIdProces[] = $row['ID_PROCES'];
 				$userTablePerms = array();
 				foreach ($aclTableRows as $row) {
 					if (!in_array($row['ID_PROCES'], $userIdProces)) continue;
 					if (array_key_exists($row['CELL_NAME'], $userTablePerms)) {
+						$userTablePerms[ $row['CELL_NAME'] ]['w procesie'] .= ",{$row['ID_PROCES']}";
 						$userTablePerms[ $row['CELL_NAME'] ][ 'PERM_R' ] += $row['PERM_R'];
 						$userTablePerms[ $row['CELL_NAME'] ][ 'PERM_W' ] += $row['PERM_W'];
 						$userTablePerms[ $row['CELL_NAME'] ][ 'PERM_X' ] += $row['PERM_X'];
@@ -982,10 +980,19 @@ jQuery(document).on('p5UIBtnAjax:Storage:checkObjectInstallAjax:ajaxLoaded', fun
 						$userTablePerms[ $row['CELL_NAME'] ][ 'PERM_V' ] += $row['PERM_V'];
 						$userTablePerms[ $row['CELL_NAME'] ][ 'PERM_E' ] += $row['PERM_E'];
 					} else {
-						$userTablePerms[ $row['CELL_NAME'] ] = $row;
-						unset($userTablePerms[ $row['CELL_NAME'] ][ 'TABLE_DESCRIPTION' ]);
-						unset($userTablePerms[ $row['CELL_NAME'] ][ 'ID_PROCES' ]);
-						unset($userTablePerms[ $row['CELL_NAME'] ][ 'FORM_TREAT' ]);
+						$userTablePerms[ $row['CELL_NAME'] ] = [
+							'fieldName' => $row['CELL_NAME'],
+							'zasob' => $row['ID_CELL'],
+							'w procesie' => "{$row['ID_PROCES']}",
+							'PERM_R' => $row['PERM_R'],
+							'PERM_W' => $row['PERM_W'],
+							'PERM_X' => $row['PERM_X'],
+							'PERM_C' => $row['PERM_C'],
+							'PERM_S' => $row['PERM_S'],
+							'PERM_O' => $row['PERM_O'],
+							'PERM_V' => $row['PERM_V'],
+							'PERM_E' => $row['PERM_E'],
+						];
 					}
 				}
 				UI::table([