Quellcode durchsuchen

added p5:www_link to simpleSchema in UserProcess, use UserProcess acl in UserTest route

Piotr Labudda vor 9 Jahren
Ursprung
Commit
4db9b70fee

+ 1 - 0
SE/se-lib/Core/AclSimpleSchemaBase.php

@@ -212,6 +212,7 @@ class Core_AclSimpleSchemaBase extends Core_AclBase {
     $fieldsById = array();
     foreach ($this->getXsdTypes() as $fieldName => $field) {
       $field['name'] = $fieldName;
+      if ('p5:www_link' == $field['xsdType']) $field['simpleType'] = 'p5:www_link';
       $fieldsById[ $field['idZasob'] ] = $field;
     }
     return $fieldsById;

+ 5 - 1
SE/se-lib/Route/UserTest.php

@@ -17,8 +17,11 @@ class Route_UserTest extends RouteBase {
       $procesMenu = ProcesMenu::getInstance();
       // $procesMenu->menuAction();// like UI::menu() ?
       $userAcl = User::getAcl();
+      $acl = Core_AclHelper::getAclByNamespace('default_objects/UserProcess');
+      $userProcessList = $acl->getItems();
+      DBG::nicePrint($userProcessList, '$userProcessList');
       $procesyInitGroup = $this->getUsedProcesInitGroupedList($userAcl);
-      DBG::nicePrint($procesyInitGroup);
+      DBG::nicePrint($procesyInitGroup, '$procesyInitGroup');
   		if (empty($procesyInitGroup)) {
   			echo '<p>' . "Brak przypisanych procesów." . '</p>';
   			return;
@@ -33,6 +36,7 @@ class Route_UserTest extends RouteBase {
   public function getUsedProcesInitGroupedList($userAcl) {
 		$procesyInitGroup = array();
 		$procesyInitList = $this->getUserProcesInitList($userAcl);
+    DBG::nicePrint($procesyInitList, '$procesyInitList');
 		if (empty($procesyInitList)) {
 			return;
 		}

+ 6 - 1
SE/se-lib/Schema/UserProcessStorageAcl.php

@@ -11,6 +11,7 @@ class Schema_UserProcessStorageAcl extends Core_AclSimpleSchemaBase {
       'ID' => [ '@type' => 'xsd:integer' ],
       'nazwa' => [ '@type' => 'xsd:string', '@alias' => 'DESC' ],
       'opis' => [ '@type' => 'xsd:string', '@alias' => 'OPIS' ],
+      'link_uruchom_filtr_procesu' => [ '@type' => 'p5:www_link' ],
       'autor' => [ '@type' => 'xsd:string' , '@alias' => 'A_RECORD_CREATE_AUTHOR' ],
       'utworzono' => [ '@type' => 'xsd:date' , '@alias' => 'A_RECORD_CREATE_DATE' ],
       'zaktualizował' => [ '@type' => 'xsd:string' , '@alias' => 'A_RECORD_UPDATE_AUTHOR' ],
@@ -78,7 +79,7 @@ class Schema_UserProcessStorageAcl extends Core_AclSimpleSchemaBase {
     if (empty($idGroupList)) throw new Exception("Brak przyipsanych grup do użytwkonika");
     $sqlIdGroupCsv = implode(",", $idGroupList);
 
-    return DB::getPDO()->fetchAllByKey("
+    $items = DB::getPDO()->fetchAllByKey("
       select p.ID
         , p.`DESC` as nazwa
         , p.`OPIS` as opis
@@ -99,6 +100,10 @@ class Schema_UserProcessStorageAcl extends Core_AclSimpleSchemaBase {
       {$sqlOrderBy}
       {$sqlLimitOffset}
     ", 'ID');
+    array_walk($items, function (&$item, $key) {
+      $item['link_uruchom_filtr_procesu'] = Request::getPathUri() . "index.php?FUNCTION_INIT=MENU_SELECT_PROCES&_action=setPermsByProces&id_proces={$item['ID']}";
+    });
+    return $items;
   }
 
   public function _getUserIdGroupList() {

+ 1 - 0
SE/se-lib/TableAjax.php

@@ -5793,6 +5793,7 @@ jQuery(document).ready(function(){
 			}
 			$colType = $acl->getFieldType($col);
 			if ($colType) {// @see MarkTableAjaxFilterColType
+				if($DBG){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">field('.$col.') $colType (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($colType);echo'</pre>';}
 				if ($colType['type'] == 'date') {
 					//$columnConfig->type = 'date';// TODO: require datetimepicker
 				}