Changeset 585
- Timestamp:
- Oct 31, 2013, 8:57:41 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Version.php
r584 r585 1 1 <?php 2 2 3 $Revision = 58 4; // Subversion revision4 $DatabaseRevision = 5 44; // SQL structure revision3 $Revision = 585; // Subversion revision 4 $DatabaseRevision = 584; // SQL structure revision 5 5 $ReleaseTime = '2013-10-31'; -
trunk/Modules/IS/IS.php
r584 r585 8 8 var $ShortTitle = 'Správa dat'; 9 9 var $ParentClass = 'PagePortal'; 10 var $MenuItems = array(); 11 var $MenuItemsLoaded = false; 10 var $MenuItems; 12 11 var $HideMenu = false; 13 12 … … 36 35 { 37 36 $Output = '<table style="width: 100%"><tr><td style="width: 20%; vertical-align: top;">'; 38 $Output .= '<strong>Nabídka:</strong>'.$this->ShowMenu Item('');37 $Output .= '<strong>Nabídka:</strong>'.$this->ShowMenu(); 39 38 $Output .= '</td><td style="width: 80%; vertical-align: top;">'; 40 39 $Output .= $Content; … … 75 74 { 76 75 $Output = ''; 77 if(!$this->System->User->CheckPermission($ Table, 'Write'))76 if(!$this->System->User->CheckPermission($this->TableToModule($Table), 'Write')) 78 77 return('Nemáte oprávnění'); 79 78 if(array_key_exists('o', $_GET)) … … 125 124 { 126 125 $Output = ''; 127 if(!$this->System->User->CheckPermission($ Table, 'Write'))126 if(!$this->System->User->CheckPermission($this->TableToModule($Table), 'Write')) 128 127 return('Nemáte oprávnění'); 129 128 $this->Database->delete($Table, 'Id='.$Id); … … 136 135 { 137 136 $Output = ''; 138 if(!$this->System->User->CheckPermission($ Table, 'Write'))137 if(!$this->System->User->CheckPermission($this->TableToModule($Table), 'Write')) 139 138 return('Nemáte oprávnění'); 140 139 if(array_key_exists('o', $_GET)) … … 188 187 if($Table != '') $FormClass = $this->System->FormManager->Classes[$Table]; 189 188 else return($this->SystemMessage('Chyba', 'Tabulka nenalezena')); 190 if(!$this->System->User->CheckPermission($ Table, 'Read'))189 if(!$this->System->User->CheckPermission($this->TableToModule($Table), 'Read')) 191 190 return('Nemáte oprávnění'); 192 191 … … 391 390 function ShowSelect($Table, $Filter = '', $Title = '') 392 391 { 393 if(!$this->System->User->CheckPermission($ Table, 'Read'))392 if(!$this->System->User->CheckPermission($this->TableToModule($Table), 'Read')) 394 393 return('Nemáte oprávnění'); 395 394 $this->BasicHTML = true; … … 404 403 function ShowMapSelect($Table, $Filter = '', $Title = '') 405 404 { 406 if(!$this->System->User->CheckPermission($ Table, 'Write'))405 if(!$this->System->User->CheckPermission($this->TableToModule($Table), 'Write')) 407 406 return('Nemáte oprávnění'); 408 407 $MapApi = new MapApiGoogle($this->System); … … 419 418 function ShowList($Table, $Filter = '', $Title = '', $ExcludeColumn = '') 420 419 { 421 if(!$this->System->User->CheckPermission($ Table, 'Read'))420 if(!$this->System->User->CheckPermission($this->TableToModule($Table), 'Read')) 422 421 return('Nemáte oprávnění'); 423 422 $RowActions = '<a href="?a=view&t='.$Table.'&i=#RowId"><img alt="Ukázat" title="Ukázat" src="'. … … 457 456 } 458 457 458 function ShowMenu() 459 { 460 $this->MenuItems = array(); 461 $DbResult = $this->Database->query('SELECT `MenuItem`.`Id`, `MenuItem`.`Name`, `MenuItem`.`Parent`, `Action`.`URL` AS `URL`, `ActionIcon`.`Name` AS `IconName`, `Action`.`PermissionOperation` AS `Permission` FROM `MenuItem` '. 462 'LEFT JOIN `Action` ON `Action`.`Id` = `MenuItem`.`Action` '. 463 'LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '. 464 'WHERE `MenuItem`.`Menu`=1 '. 465 'ORDER BY `MenuItem`.`Parent`,`MenuItem`.`Name`'); 466 while($DbRow = $DbResult->fetch_assoc()) 467 { 468 //if($DbRow['Permission'] != '') 469 $this->MenuItems[$DbRow['Id']] = $DbRow; 470 } 471 return($this->ShowMenuItem('')); 472 } 473 459 474 function ShowMenuItem($Parent) 460 475 { 461 if($this->MenuItemsLoaded == false)462 {463 $DbResult = $this->Database->query('SELECT `MenuItem`.`Id`, `MenuItem`.`Name`, `MenuItem`.`Parent`, `Action`.`URL` AS `URL`, `ActionIcon`.`Name` AS `IconName` FROM `MenuItem` '.464 'LEFT JOIN `Action` ON `Action`.`Id` = `MenuItem`.`Action` '.465 'LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '.466 'ORDER BY `MenuItem`.`Parent`,`MenuItem`.`Name`');467 while($DbRow = $DbResult->fetch_assoc())468 {469 $this->MenuItems[$DbRow['Id']] = $DbRow;470 }471 $this->MenuItemsLoaded = true;472 }473 474 476 $Output = '<ul style="list-style: none; margin-left:1em; padding-left:0em;">'; 475 477 foreach($this->MenuItems as $MenuItem) … … 489 491 $Output .= '</ul>'; 490 492 return($Output); 493 } 494 495 function TableToModule($Table) 496 { 497 $DbResult = $this->Database->query('SELECT (SELECT Name FROM Module WHERE Module.Id=Model.Module) AS Name FROM Model WHERE Name="'.$Table.'"'); 498 if($DbResult->num_rows == 1) 499 { 500 $DbRow = $DbResult->fetch_assoc(); 501 return($DbRow['Name']); 502 } else return(''); 491 503 } 492 504 }
Note:
See TracChangeset
for help on using the changeset viewer.