Changeset 16


Ignore:
Timestamp:
Oct 21, 2008, 9:05:41 AM (16 years ago)
Author:
george
Message:
  • Opraveno: Načítání smazaných položek typů a seznamů.
  • Upraveno: Menu nyní realizováno přes seznam SystemMenu namísto vlastností seznamů.
  • Přidáno: Obrázky pro akce zobrazit, editovat a smazat.
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • base.php

    r15 r16  
    6565      }
    6666    }
    67     $Output .= '<td><a href="?Action=ViewItem&amp;Table='.$List['TableName'].'&amp;Item='.$DbRow['ItemId'].'">Zobrazit</a> <a href="?Action=EditItem&amp;Table='.$List['TableName'].'&amp;Item='.$DbRow['ItemId'].'">Editovat</a> <a href="?Action=DeleteItem&amp;Table='.$List['TableName'].'&amp;Item='.$DbRow['ItemId'].'">Smazat</a></td></tr>';
     67    $Output .= '<td><a href="?Action=ViewItem&amp;Table='.$List['TableName'].'&amp;Item='.$DbRow['ItemId'].'"><img border="0" src="images/view.png" alt="Zobrazit" title="Zobrazit"></a> <a href="?Action=EditItem&amp;Table='.$List['TableName'].'&amp;Item='.$DbRow['ItemId'].'"><img border="0" src="images/edit.png" alt="Editovat" title="Editovat"></a> <a href="?Action=DeleteItem&amp;Table='.$List['TableName'].'&amp;Item='.$DbRow['ItemId'].'"><img border="0" src="images/delete.png" alt="Smazat" title="Smazat"></a></td></tr>';
    6868  }
    6969  $Output .= '</table>';
     
    137137
    138138    $Output .= '<td>'.$DbRow['CreationTime'].'</td>';
    139     $Output .= '<td><a href="?Action=ViewItem&amp;Table='.$List['TableName'].'&amp;Item='.$DbRow['Id'].'">Zobrazit</a> </td></tr>';
     139    $Output .= '<td><a href="?Action=ViewItem&amp;Table='.$List['TableName'].'&amp;Item='.$DbRow['Id'].'"><img border="0" src="images/view.png" alt="Zobrazit" title="Zobrazit"></a></td></tr>';
    140140  }
    141141  $Output .= '</table>';
     
    210210  $Output .= ShowViewItem($List, $Id);
    211211  $Form->Values['Column'] = $_POST['Column'];
     212  $Form->Values['ItemId'] = $Id;
     213  $Form->Values['ListTableName'] = $List['TableName'];
    212214  ExecuteListEvent($List['TableName'], 'OnEdit', $Form->Values);
    213215  return($Output);
     
    284286  $NewItemId = $System->Modules['DatabaseList']->AddItem($List['TableName'], $Form->Values);
    285287  $NewId = $Database->insert_id;
    286    $System->Modules['Log']->Add($List['Id'], $NewId, $LogActionType['Add']);
     288  $System->Modules['Log']->Add($List['Id'], $NewId, $LogActionType['Add']);
    287289  $Output = 'Položka přidána';
    288290  $Output .= ShowViewItem($List, $NewItemId);
     
    350352}
    351353
    352 function TableList($System)
    353 {
    354   global $Lists;
    355 
    356   $Type = array('Uživatelské', 'Systémové');
    357   $Output = '<strong>'.$Type[$System].' seznamy:</strong><br />';
    358   foreach($Lists as $Index => $List)
    359   {
    360     if(($List['System'] == $System) and ($List['VisibleInMenu'] == 1))
    361       $Output .= '<a href="?Action=ShowList&amp;Table='.$Index.'">'.$List['Title'].'</a><br />';
     354function ShowMenu()
     355{
     356  global $Lists, $Database;
     357
     358  $DbResult = $Database->query('SELECT t1.* FROM `SystemMenu` AS t1 LEFT JOIN `SystemMenu` AS t2 ON t1.ItemId=t2.ItemId AND t1.Id < t2.Id WHERE (t2.ItemId IS NULL) AND (t1.DeletionTime IS NULL)');
     359  while($DbRow = $DbResult->fetch_assoc())
     360  {
     361    $Output .= '<strong>'.$DbRow['Name'].'</strong><br />';
     362    $DbResult2 = $Database->query('SELECT t1.* FROM `SystemList` AS t1 LEFT JOIN `SystemList` AS t2 ON t1.ItemId=t2.ItemId AND t1.Id < t2.Id WHERE (t2.ItemId IS NULL) AND (t1.DeletionTime IS NULL) AND (t1.`Menu` = '.$DbRow['ItemId'].')');
     363    while($DbRow2 = $DbResult2->fetch_assoc())
     364    {
     365      //if(($List['System'] == $System) and ($List['VisibleInMenu'] == 1))
     366      //if(CheckPermission('Read', $List['Id']))
     367      $Output .= '<a href="?Action=ShowList&amp;Table='.$DbRow2['TableName'].'">'.$DbRow2['Title'].'</a><br />';
     368    }
     369    $Output .= '<br />';
    362370  }
    363371  $Output .= '<br />';
     
    421429  global $Database, $Lists;
    422430
    423   $DbResult = $Database->query('SELECT t1.* FROM `SystemList` AS t1 LEFT JOIN `SystemList` AS t2 ON t1.ItemId=t2.ItemId AND t1.Id < t2.Id WHERE (t2.ItemId IS NULL)');
     431  $DbResult = $Database->query('SELECT t1.* FROM `SystemList` AS t1 LEFT JOIN `SystemList` AS t2 ON t1.ItemId=t2.ItemId AND t1.Id < t2.Id WHERE (t2.ItemId IS NULL) AND (t1.DeletionTime IS NULL)');
    424432  while($DbRow = $DbResult->fetch_assoc())
    425433  {
    426434    $Items = array();
    427     $DbResult2 = $Database->query('SELECT t1.* FROM `SystemListItem` AS t1 LEFT JOIN `SystemListItem` AS t2 ON t1.ItemId=t2.ItemId AND t1.Id < t2.Id WHERE (t2.ItemId IS NULL) AND t1.List='.$DbRow['ItemId']);
     435    $DbResult2 = $Database->query('SELECT t1.* FROM `SystemListItem` AS t1 LEFT JOIN `SystemListItem` AS t2 ON t1.ItemId=t2.ItemId AND t1.Id < t2.Id WHERE (t2.ItemId IS NULL) AND (t1.DeletionTime IS NULL) AND (t1.List='.$DbRow['ItemId'].')');
    428436    while($DbRow2 = $DbResult2->fetch_assoc())
    429437    {
     
    449457  $Types = array();
    450458  $TypeNames = array();
    451   $DbResult = $Database->query('SELECT t1.* FROM `SystemType` AS t1 LEFT JOIN `SystemType` AS t2 ON t1.ItemId=t2.ItemId AND t1.Id < t2.Id WHERE (t2.ItemId IS NULL)');
     459  $DbResult = $Database->query('SELECT t1.* FROM `SystemType` AS t1 LEFT JOIN `SystemType` AS t2 ON t1.ItemId=t2.ItemId AND t1.Id < t2.Id WHERE (t2.ItemId IS NULL) AND (t1.DeletionTime IS NULL)');
    452460  while($DbRow = $DbResult->fetch_assoc())
    453461  {
     
    503511function CheckPermission($Right, $ListId, $ItemId = 0)
    504512{
    505   global $Database;
     513  global $Database, $System;
    506514
    507515  $DbResult = $Database->query('SELECT t1.* FROM `Permission` AS t1 LEFT JOIN `Permission` AS t2 ON t1.ItemId=t2.ItemId AND t1.Id < t2.Id WHERE (t2.ItemId IS NULL) AND t1.PermissionGroup = (SELECT PermissionGroup.Id FROM PermissionGroup WHERE PermissionGroup.Id=(SELECT User.PermissionGroup FROM User WHERE User.ItemId='.$System->Modules['User']->User['Id'].' ORDER BY User.Id DESC LIMIT 1) ORDER BY PermissionGroup.Id DESC LIMIT 1) AND t1.DeletionTime IS NULL AND t1.List='.$ListId);
  • index.php

    r9 r16  
    8686      $Output .= $this->System->Modules['User']->User['UserName'].' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=Logout">Odhlásit</a>';
    8787      $Output .= '<br /><br />';
    88       $Output .= TableList(1);
    89       $Output .= TableList(0);
     88      $Output .= ShowMenu();
    9089      $Output .= '</td><td class="main">';
    9190      $Output .= Output();
  • lists/SystemList.php

    r11 r16  
    1818}
    1919
     20function ListSystemListOnEdit($Parameters)
     21{
     22  global $Database;
     23
     24  $DbResult = $Database->query('SELECT `TableName` FROM `'.$Parameters['ListTableName'].'` WHERE ItemId='.$Parameters['ItemId'].' ORDER BY `Id` DESC LIMIT 1,1');
     25  $DbRow = $DbResult->fetch_assoc();
     26  if($DbRow['TableName'] != $Parameters['TableName'])
     27    $Database->query('RENAME TABLE `'.$DbRow['TableName'].'` TO `'.$Parameters['TableName'].'`');
     28}
     29
    2030?>
  • lists/SystemListItem.php

    r13 r16  
    66
    77  //print_r($Parameters);
    8   $DbResult = $Database->select('SystemType', 'DbDataType', 'Id='.$Parameters['Type']);
     8  $DbResult = $Database->query('SELECT DbDataType FROM SystemType WHERE ItemId='.$Parameters['Type'].' ORDER BY Id DESC LIMIT 1');
    99  //echo($Database->LastQuery);
    1010  $DbRow = $DbResult->fetch_assoc();
    11   $DbResult = $Database->select('SystemList', 'TableName', 'Id='.$Parameters[$Parameters['Column']]);
     11  $DbResult = $Database->query('SELECT TableName FROM SystemList WHERE ItemId='.$Parameters[$Parameters['Column']].' ORDER BY Id DESC LIMIT 1');
    1212  //echo($Database->LastQuery);
    1313  $DbRow2 = $DbResult->fetch_assoc();
Note: See TracChangeset for help on using the changeset viewer.