Jelajahi Sumber

Acl fix use proces init list for table in TableAjax

Piotr Labudda 10 tahun lalu
induk
melakukan
a1b75fb511
2 mengubah file dengan 6 tambahan dan 26 penghapusan
  1. 6 16
      SE/se-lib/TableAjax.php
  2. 0 10
      SE/se-lib/UserAcl.php

+ 6 - 16
SE/se-lib/TableAjax.php

@@ -210,21 +210,7 @@ class TableAjax extends ViewAjax {
 			return $pInitList;
 		}
 		$userAcl = User::getAcl();
-		$pInitListRaw = $userAcl->getProcesInitList($this->_zasobID);
-		if (empty($pInitListRaw)) {
-			return $pInitList;
-		}
-		$db = DB::getDB();
-		$sql = "select p.`ID`, p.`DESC`
-			from `CRM_PROCES` as p
-			where p.`ID` in(" . implode(",", array_values($pInitListRaw)) . ")
-				and p.`TYPE`='PROCES_INIT'
-		";
-		$res = $db->query($sql);
-		while ($r = $db->fetch($res)) {
-			$pInitList[$r->ID] = $r->DESC;
-		}
-		return $pInitList;
+		return $userAcl->getTableProcesInitList($this->_zasobID);
 	}
 
 	public function allowTreeView() {
@@ -415,7 +401,11 @@ class TableAjax extends ViewAjax {
 								<?php endif; ?>
 									<a href="procesy5.php?task=PROCES_VIEW_LIST&id_proces=<?php echo $kId; ?>&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1" target="_blank" style="display:none"><i class="glyphicon glyphicon-info-sign"></i></a>
 									<a href="index.php?FUNCTION_INIT=MENU_SELECT_PROCES&_action=setPermsByProces&id_proces=<?php echo $kId; ?>&MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=<?php echo $this->_zasobID; ?>" title="<?php echo htmlspecialchars("{{$kId}} {$vLabel}"); ?>">
-										<i class="glyphicon glyphicon-info-sign" onclick="window.open('procesy5.php?task=PROCES_VIEW_LIST&id_proces=<?php echo $kId; ?>&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1');return false;"></i>
+										<i class="glyphicon glyphicon-info-sign"
+											 onclick="window.open('procesy5.php?task=PROCES_VIEW_LIST&id_proces=<?php echo $kId; ?>&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1');return false;"
+											 style="color:#aaa;"
+											 onmouseover="this.style.color='#337AB7'"
+											 onmouseout="this.style.color='#aaa'"></i>
 										<?php echo "{{$kId}} " . V::strShortUtf8($vLabel, 50); ?>
 									</a>
 								</li>

+ 0 - 10
SE/se-lib/UserAcl.php

@@ -188,16 +188,6 @@ class UserAcl {
 		return TableAcl::getInstance($tableID);
 	}
 
-	public function getProcesInitList($tblId) {
-		if ($tblId > 0) {
-			$map = $this->_cache_read('foundMap');
-			if (is_array($map) && array_key_exists($tblId, $map)) {
-				return $map[$tblId];
-			}
-		}
-		return null;
-	}
-
 	/**
 	 * Check if perms are only for one proces.
 	 * @returns int or false