[470] | 1 | <?php
|
---|
| 2 |
|
---|
[501] | 3 | include_once(dirname(__FILE__).'/../../Common/Global.php');
|
---|
[470] | 4 |
|
---|
| 5 | class PageIS extends Page
|
---|
| 6 | {
|
---|
| 7 | var $FullTitle = 'Správa dat';
|
---|
| 8 | var $ShortTitle = 'Správa dat';
|
---|
[519] | 9 | var $ParentClass = 'PagePortal';
|
---|
[585] | 10 | var $MenuItems;
|
---|
[529] | 11 | var $HideMenu = false;
|
---|
[470] | 12 |
|
---|
| 13 | function Show()
|
---|
| 14 | {
|
---|
[639] | 15 | if(!$this->System->User->CheckPermission('IS', 'Manage'))
|
---|
[470] | 16 | return('Nemáte oprávnění');
|
---|
[540] | 17 | $this->System->FormManager->ShowRelation = true;
|
---|
[639] | 18 |
|
---|
[530] | 19 | if(array_key_exists('a', $_GET)) $Action = $_GET['a'];
|
---|
| 20 | else $Action = '';
|
---|
| 21 | if(array_key_exists('t', $_GET)) $Table = $_GET['t'];
|
---|
| 22 | else $Table = '';
|
---|
| 23 | if(array_key_exists('i', $_GET)) $ItemId = $_GET['i'];
|
---|
| 24 | else $ItemId = 0;
|
---|
[639] | 25 |
|
---|
[530] | 26 | if($Action == 'list') $Content = $this->ShowList($Table);
|
---|
| 27 | else if($Action == 'select') $Content = $this->ShowSelect($Table);
|
---|
[574] | 28 | else if($Action == 'mapselect') $Content = $this->ShowMapSelect($Table);
|
---|
[530] | 29 | else if($Action == 'edit') $Content = $this->ShowEdit($Table, $ItemId);
|
---|
| 30 | else if($Action == 'add') $Content = $this->ShowAdd($Table);
|
---|
[639] | 31 | else if($Action == 'addsub') $Content = $this->ShowAddSub($Table);
|
---|
[530] | 32 | else if($Action == 'view') $Content = $this->ShowView($Table, $ItemId);
|
---|
| 33 | else if($Action == 'delete') $Content = $this->ShowDelete($Table, $ItemId);
|
---|
[531] | 34 | else $Content = $this->Dashboard();
|
---|
[529] | 35 | if($this->HideMenu == false)
|
---|
| 36 | {
|
---|
| 37 | $Output = '<table style="width: 100%"><tr><td style="width: 20%; vertical-align: top;">';
|
---|
[639] | 38 | $Output .= '<strong>Nabídka:</strong>'.$this->ShowMenu();
|
---|
[529] | 39 | $Output .= '</td><td style="width: 80%; vertical-align: top;">';
|
---|
| 40 | $Output .= $Content;
|
---|
| 41 | $Output .= '</td></tr></table>';
|
---|
| 42 | } else $Output = $Content;
|
---|
[639] | 43 |
|
---|
[470] | 44 | return($Output);
|
---|
| 45 | }
|
---|
[639] | 46 |
|
---|
[531] | 47 | function Dashboard()
|
---|
| 48 | {
|
---|
[639] | 49 | $Output = '<strong>Nástěnka:</strong><br/>';
|
---|
[531] | 50 | $DbResult = $this->Database->select('Task', 'COUNT(*)', 'Progress < 100');
|
---|
| 51 | $DbRow = $DbResult->fetch_row();
|
---|
| 52 | $Output .= 'Nedokončených úkolů: '.$DbRow['0'].'<br/>';
|
---|
| 53 | $DbResult = $this->Database->select('Member', 'COUNT(*)', '1');
|
---|
| 54 | $DbRow = $DbResult->fetch_row();
|
---|
| 55 | $Output .= 'Zákazníků: '.$DbRow['0'].'<br/>';
|
---|
| 56 | $DbResult = $this->Database->select('Subject', 'COUNT(*)', '1');
|
---|
| 57 | $DbRow = $DbResult->fetch_row();
|
---|
| 58 | $Output .= 'Subjektů: '.$DbRow['0'].'<br/>';
|
---|
| 59 | $DbResult = $this->Database->select('User', 'COUNT(*)', '1');
|
---|
| 60 | $DbRow = $DbResult->fetch_row();
|
---|
| 61 | $Output .= 'Uživatelů: '.$DbRow['0'].'<br/>';
|
---|
| 62 | $DbResult = $this->Database->select('NetworkDevice', 'COUNT(*)', '1');
|
---|
| 63 | $DbRow = $DbResult->fetch_row();
|
---|
| 64 | $Output .= 'Registrovaných zařízení: '.$DbRow['0'].'<br/>';
|
---|
| 65 | $DbResult = $this->Database->select('FinanceOperation', 'SUM(Value)', '1');
|
---|
| 66 | $DbRow = $DbResult->fetch_row();
|
---|
| 67 | $Output .= 'Stav placení: '.$DbRow['0'].'<br/>';
|
---|
[551] | 68 | $DbResult = $this->Database->select('FinanceBankImport', 'COUNT(*)', 'FinanceOperation IS NULL');
|
---|
| 69 | $DbRow = $DbResult->fetch_row();
|
---|
| 70 | $Output .= 'Nezpárovaných plateb: '.$DbRow['0'].'<br/>';
|
---|
[531] | 71 | return($Output);
|
---|
| 72 | }
|
---|
[639] | 73 |
|
---|
[470] | 74 | function ShowEdit($Table, $Id)
|
---|
| 75 | {
|
---|
[647] | 76 | $this->ShortTitle .= ' - Úprava '.$Table;
|
---|
[470] | 77 | $Output = '';
|
---|
[599] | 78 | if(defined('NEW_PERMISSION') and !$this->System->User->CheckPermission($this->TableToModule($Table), 'Write'))
|
---|
[584] | 79 | return('Nemáte oprávnění');
|
---|
[470] | 80 | if(array_key_exists('o', $_GET))
|
---|
| 81 | {
|
---|
| 82 | if($_GET['o'] == 'save')
|
---|
| 83 | {
|
---|
[501] | 84 | $Form = new Form($this->System->FormManager);
|
---|
| 85 | $Form->SetClass($Table);
|
---|
[470] | 86 | $Form->LoadValuesFromForm();
|
---|
[647] | 87 | $this->ShortTitle .= ' - úprava '.$Form->Definition['Title'];
|
---|
[545] | 88 | try {
|
---|
[605] | 89 | $Form->Validate();
|
---|
[545] | 90 | $Form->SaveValuesToDatabase($Id);
|
---|
[639] | 91 | $Values = $Table.': '.str_replace('=>', '=', str_replace('array', '', var_export($Form->Values, true)));
|
---|
[608] | 92 | $this->System->ModuleManager->Modules['Log']->NewRecord('IS', 'Edit', $Values);
|
---|
[545] | 93 | $Output .= $this->SystemMessage('Úprava položky', 'Položka upravena');
|
---|
[639] | 94 | $Output .= $this->ShowView($Table, $Id);
|
---|
[545] | 95 | } catch (Exception $E)
|
---|
| 96 | {
|
---|
[627] | 97 | $Output .= $this->SystemMessage('Úprava položky', 'Položku se nepodařilo uložit. Opravte problém a opakujte akci.<br/>'.$E->getMessage());
|
---|
[545] | 98 | $Form->OnSubmit = '?a=edit&t='.$Table.'&i='.$_GET['i'].'&o=save';
|
---|
| 99 | $Output .= $Form->ShowEditForm();
|
---|
| 100 | $Output .= '<ul class="ActionMenu">';
|
---|
| 101 | $Output .= '<li><a href="?a=view&t='.$Table.'&i='.$Id.'"><img alt="Prohlížet" title="Prohlížet" src="'.
|
---|
| 102 | $this->System->Link('/images/view.png').'"/>Prohlížet</a></li>';
|
---|
| 103 | $Output .= '<li><a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'.
|
---|
| 104 | $this->System->Link('/images/list.png').'"/>Seznam</a></li>';
|
---|
| 105 | $Output .= '<li><a href="?a=delete&t='.$Table.'&i='.$Id.'" onclick="return confirmAction(\'Opravdu smazat položku?\');"><img alt="Odstranit" title="Odstranit" src="'.
|
---|
| 106 | $this->System->Link('/images/delete.png').'"/>Odstranit</a></li>';
|
---|
| 107 | $Output .= '</ul>';
|
---|
| 108 | }
|
---|
[470] | 109 | }
|
---|
[639] | 110 | } else
|
---|
[470] | 111 | {
|
---|
[501] | 112 | $Form = new Form($this->System->FormManager);
|
---|
| 113 | $Form->SetClass($Table);
|
---|
[470] | 114 | $Form->LoadValuesFromDatabase($Id);
|
---|
[647] | 115 | $this->ShortTitle .= ' - úprava '.$Form->Definition['Title'];
|
---|
[533] | 116 | $Form->OnSubmit = '?a=edit&t='.$Table.'&i='.$_GET['i'].'&o=save';
|
---|
[470] | 117 | $Output .= $Form->ShowEditForm();
|
---|
| 118 | $Output .= '<ul class="ActionMenu">';
|
---|
[536] | 119 | $Output .= '<li><a href="?a=view&t='.$Table.'&i='.$Id.'"><img alt="Prohlížet" title="Prohlížet" src="'.
|
---|
[470] | 120 | $this->System->Link('/images/view.png').'"/>Prohlížet</a></li>';
|
---|
[529] | 121 | $Output .= '<li><a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'.
|
---|
[470] | 122 | $this->System->Link('/images/list.png').'"/>Seznam</a></li>';
|
---|
[530] | 123 | $Output .= '<li><a href="?a=delete&t='.$Table.'&i='.$Id.'" onclick="return confirmAction(\'Opravdu smazat položku?\');"><img alt="Odstranit" title="Odstranit" src="'.
|
---|
[470] | 124 | $this->System->Link('/images/delete.png').'"/>Odstranit</a></li>';
|
---|
| 125 | $Output .= '</ul>';
|
---|
| 126 | }
|
---|
| 127 | return($Output);
|
---|
| 128 | }
|
---|
[639] | 129 |
|
---|
[470] | 130 | function ShowDelete($Table, $Id)
|
---|
| 131 | {
|
---|
| 132 | $Output = '';
|
---|
[599] | 133 | if(defined('NEW_PERMISSION') and !$this->System->User->CheckPermission($this->TableToModule($Table), 'Write'))
|
---|
[584] | 134 | return('Nemáte oprávnění');
|
---|
[647] | 135 | $this->ShortTitle .= ' - odstranění '.$Table;
|
---|
[608] | 136 | $DbResult = $this->Database->select($Table, '*', '`Id`='.$Id);
|
---|
| 137 | if($DbResult->num_rows > 0)
|
---|
| 138 | {
|
---|
| 139 | $DbRow = $DbResult->fetch_assoc();
|
---|
| 140 | try {
|
---|
| 141 | $this->Database->delete($Table, '`Id`='.$Id);
|
---|
| 142 | $Values = $Table.': '.str_replace('=>', '=', str_replace('array', '', var_export($DbRow, true)));
|
---|
| 143 | $this->System->ModuleManager->Modules['Log']->NewRecord('IS', 'Delete', $Values);
|
---|
| 144 | $Output .= $this->SystemMessage('Smazání položky', 'Položka odstraněna');
|
---|
| 145 | } catch (Exception $E)
|
---|
| 146 | {
|
---|
| 147 | $Output .= $this->SystemMessage('Smazání položky', 'Položku se nepodařilo smazat. Pravděpodobně na ni závisejí další položky.');
|
---|
| 148 | }
|
---|
[639] | 149 | } else $Output .= $this->SystemMessage('Smazání položky', 'Položka nenalezena');
|
---|
| 150 | $Output .= $this->ShowList($Table);
|
---|
[470] | 151 | return($Output);
|
---|
| 152 | }
|
---|
[639] | 153 |
|
---|
| 154 | function ShowAdd($Table, $Actions = array())
|
---|
[470] | 155 | {
|
---|
| 156 | $Output = '';
|
---|
[599] | 157 | if(defined('NEW_PERMISSION') and !$this->System->User->CheckPermission($this->TableToModule($Table), 'Write'))
|
---|
[584] | 158 | return('Nemáte oprávnění');
|
---|
[470] | 159 | if(array_key_exists('o', $_GET))
|
---|
| 160 | {
|
---|
| 161 | if($_GET['o'] == 'save')
|
---|
| 162 | {
|
---|
[501] | 163 | $Form = new Form($this->System->FormManager);
|
---|
| 164 | $Form->SetClass($Table);
|
---|
[639] | 165 | $Form->LoadValuesFromForm();
|
---|
[647] | 166 | $this->ShortTitle .= ' - přidání '.$Form->Definition['Title'];
|
---|
[545] | 167 | try {
|
---|
[605] | 168 | $Form->Validate();
|
---|
[551] | 169 | if(array_key_exists('BeforeInsert', $Form->Definition))
|
---|
| 170 | {
|
---|
| 171 | $Class = $Form->Definition['BeforeInsert'][0];
|
---|
| 172 | $Method = $Form->Definition['BeforeInsert'][1];
|
---|
| 173 | $this->Values = $Class->$Method($Form);
|
---|
| 174 | }
|
---|
[628] | 175 | $Form->Validate();
|
---|
[608] | 176 | $Form->SaveValuesToDatabase(0);
|
---|
| 177 | $Id = $this->Database->insert_id;
|
---|
[639] | 178 | $Values = $Table.': '.str_replace('=>', '=', str_replace('array', '', var_export($Form->Values, true)));
|
---|
[608] | 179 | $this->System->ModuleManager->Modules['Log']->NewRecord('IS', 'Add', $Values);
|
---|
[545] | 180 | $Output .= $this->SystemMessage('Přidání položky', 'Nová položka vytvořena');
|
---|
[639] | 181 | $Output .= $this->ShowView($Table, $Id, $_GET['a'] == 'addsub');
|
---|
[628] | 182 | if(array_key_exists('AfterInsert', $Form->Definition))
|
---|
| 183 | {
|
---|
| 184 | $Class = $Form->Definition['AfterInsert'][0];
|
---|
| 185 | $Method = $Form->Definition['AfterInsert'][1];
|
---|
| 186 | $this->Values = $Class->$Method($Form);
|
---|
| 187 | }
|
---|
[639] | 188 | // Add action to update caller form
|
---|
| 189 | if($_GET['a'] == 'addsub')
|
---|
| 190 | {
|
---|
| 191 | $Type = $this->System->FormManager->FormTypes[$_GET['rt']];
|
---|
| 192 | $DbResult = $this->Database->select($Table, '('.$Type['Name'].') AS Name', 'Id='.$Id);
|
---|
| 193 | $DbRow = $DbResult->fetch_assoc();
|
---|
| 194 | $Actions[] = '<a href="javascript:window.close();" onclick="add_select_item('.$Id.',"'.$DbRow['Name'].'","'.
|
---|
| 195 | $_GET['r'].'"); set_return('.$Id.',"'.
|
---|
| 196 | $_GET['r'].'");"><img alt="Vybrat" title="Vybrat" src="'.
|
---|
| 197 | $this->System->Link('/images/select.png').'"/> Vybrat</a>';
|
---|
| 198 | }
|
---|
| 199 |
|
---|
| 200 | //$this->Database->update($Table, 'Id='.$Id,
|
---|
| 201 | // array('UserCreate' => $this->System->User->User['Id'],
|
---|
[470] | 202 | // 'TimeCreate' => 'NOW()'));
|
---|
[545] | 203 | } catch (Exception $E)
|
---|
| 204 | {
|
---|
[627] | 205 | $Output .= $this->SystemMessage('Přidání položky', 'Položku se nepodařilo přidat. Opravte problém a opakujte akci.<br/>'.$E->getMessage());
|
---|
[545] | 206 | $Form->OnSubmit = '?a=add&t='.$Table.'&o=save';
|
---|
| 207 | $Output .= $Form->ShowEditForm();
|
---|
[639] | 208 | $Actions[] = '<a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'.
|
---|
| 209 | $this->System->Link('/images/list.png').'"/>Seznam</a>';
|
---|
[545] | 210 | }
|
---|
[470] | 211 | }
|
---|
[639] | 212 | } else
|
---|
[470] | 213 | {
|
---|
[501] | 214 | $Form = new Form($this->System->FormManager);
|
---|
| 215 | $Form->SetClass($Table);
|
---|
[647] | 216 | $this->ShortTitle .= ' - přidání '.$Form->Definition['Title'];
|
---|
[639] | 217 | // Load presets from URL
|
---|
| 218 | foreach($_GET as $Key => $Value)
|
---|
| 219 | if(substr($Key, 0, 6) == 'preset')
|
---|
| 220 | {
|
---|
| 221 | $Key = substr($Key, 6);
|
---|
| 222 | if(($Key != '') and array_key_exists($Key, $Form->Values))
|
---|
| 223 | $Form->Values[$Key] = $Value;
|
---|
| 224 | }
|
---|
| 225 | if(array_key_exists('r', $_GET)) $URL = '&r='.$_GET['r'].'&rt='.$_GET['rt'];
|
---|
| 226 | else $URL = '';
|
---|
| 227 | $Form->OnSubmit = '?a='.$_GET['a'].'&t='.$Table.'&o=save'.$URL;
|
---|
[470] | 228 | $Output .= $Form->ShowEditForm();
|
---|
[639] | 229 | $Actions[] = '<a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'.
|
---|
| 230 | $this->System->Link('/images/list.png').'"/>Seznam</a>';
|
---|
[470] | 231 | }
|
---|
[639] | 232 | $Output .= '<ul class="ActionMenu">';
|
---|
| 233 | foreach($Actions as $Action)
|
---|
| 234 | {
|
---|
| 235 | $Output .= '<li>'.$Action.'</li>';
|
---|
| 236 | }
|
---|
| 237 | $Output .= '</ul>';
|
---|
[470] | 238 | return($Output);
|
---|
| 239 | }
|
---|
[639] | 240 |
|
---|
| 241 | function ShowAddSub($Table, $Filter = '', $Title = '')
|
---|
[470] | 242 | {
|
---|
[639] | 243 | if(defined('NEW_PERMISSION') and !$this->System->User->CheckPermission($this->TableToModule($Table), 'Write'))
|
---|
| 244 | return('Nemáte oprávnění');
|
---|
| 245 | $this->BasicHTML = true;
|
---|
| 246 | $this->HideMenu = true;
|
---|
| 247 | $Output = $this->ShowAdd($Table);
|
---|
| 248 | return($Output);
|
---|
| 249 | }
|
---|
| 250 |
|
---|
| 251 | function ShowView($Table, $Id, $WithoutActions = false)
|
---|
| 252 | {
|
---|
[508] | 253 | if($Table != '') $FormClass = $this->System->FormManager->Classes[$Table];
|
---|
| 254 | else return($this->SystemMessage('Chyba', 'Tabulka nenalezena'));
|
---|
[599] | 255 | if(defined('NEW_PERMISSION') and !$this->System->User->CheckPermission($this->TableToModule($Table), 'Read'))
|
---|
[584] | 256 | return('Nemáte oprávnění');
|
---|
[639] | 257 |
|
---|
[501] | 258 | $Form = new Form($this->System->FormManager);
|
---|
| 259 | $Form->SetClass($Table);
|
---|
[647] | 260 | $this->ShortTitle .= ' - položka '.$Form->Definition['Title'];
|
---|
[470] | 261 | $Form->LoadValuesFromDatabase($Id);
|
---|
| 262 | $Form->OnSubmit = '?a=view';
|
---|
| 263 | $Output = $Form->ShowViewForm();
|
---|
[639] | 264 | if($WithoutActions == false)
|
---|
| 265 | {
|
---|
| 266 | $Actions = array(
|
---|
| 267 | '<a href="?a=edit&t='.$Table.'&i='.$Id.'"><img alt="Upravit" title="Upravit" src="'.
|
---|
| 268 | $this->System->Link('/images/edit.png').'"/>Upravit</a>',
|
---|
| 269 | '<a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'.
|
---|
| 270 | $this->System->Link('/images/list.png').'"/>Seznam</a>',
|
---|
| 271 | '<a href="?a=delete&t='.$Table.'&i='.$Id.'" onclick="return confirmAction(\'Opravdu smazat položku?\');"><img alt="Odstranit" title="Odstranit" src="'.
|
---|
| 272 | $this->System->Link('/images/delete.png').'" />Odstranit</a>',
|
---|
| 273 | '<a href="?a=add&t='.$Table.'"><img alt="Přidat" title="Přidat" src="'.
|
---|
| 274 | $this->System->Link('/images/add.png').'"/>Přidat</a>');
|
---|
[508] | 275 | if(array_key_exists('ItemActions', $FormClass))
|
---|
| 276 | {
|
---|
| 277 | foreach($FormClass['ItemActions'] as $Action)
|
---|
[561] | 278 | {
|
---|
| 279 | $URL = $this->System->Link($Action['URL']);
|
---|
[639] | 280 | if(strpos($URL, '?') === false) $URL .= '?';
|
---|
[561] | 281 | else if((substr($URL, -5, 5) !== '&') and (substr($URL, -1, 1) !== '?')) $URL .= '&';
|
---|
[639] | 282 | $URL .= 'i='.$Id;
|
---|
| 283 | $Actions[] = '<a href="'.$URL.'"><img alt="'.$Action['Caption'].'" title="'.$Action['Caption'].'" src="'.
|
---|
| 284 | $this->System->Link('/images/action.png').'"/>'.$Action['Caption'].'</a>';
|
---|
[561] | 285 | }
|
---|
[639] | 286 | }
|
---|
| 287 | $Output .= '<ul class="ActionMenu">';
|
---|
| 288 | foreach($Actions as $Action)
|
---|
| 289 | {
|
---|
| 290 | $Output .= '<li>'.$Action.'</li>';
|
---|
| 291 | }
|
---|
[470] | 292 | $Output .= '</ul><br/>';
|
---|
[639] | 293 |
|
---|
[470] | 294 | // Show ManyToOne relations
|
---|
| 295 | foreach($Form->Definition['Items'] as $Index => $Item)
|
---|
[639] | 296 | if((array_key_exists($Item['Type'], $this->System->FormManager->FormTypes) and
|
---|
[501] | 297 | ($this->System->FormManager->FormTypes[$Item['Type']]['Type'] == 'ManyToOne')))
|
---|
[470] | 298 | {
|
---|
[501] | 299 | $Output .= $this->ShowList($this->System->FormManager->FormTypes[$Item['Type']]['Table'], '`'.
|
---|
[639] | 300 | $this->System->FormManager->FormTypes[$Item['Type']]['Ref'].'`='.$Id, $Item['Caption'],
|
---|
[602] | 301 | $this->System->FormManager->FormTypes[$Item['Type']]['Ref'], $Id).'<br/>';
|
---|
[639] | 302 | }
|
---|
| 303 | }
|
---|
[470] | 304 | return($Output);
|
---|
| 305 | }
|
---|
[639] | 306 |
|
---|
[557] | 307 | function ShowTable($Table, $Filter = '', $Title = '', $RowActions = array(), $ExcludeColumn = '')
|
---|
[639] | 308 | {
|
---|
[557] | 309 | if($Table != '') $FormClass = $this->System->FormManager->Classes[$Table];
|
---|
[470] | 310 | else return($this->SystemMessage('Chyba', 'Tabulka nenalezena'));
|
---|
[654] | 311 |
|
---|
[647] | 312 | if(array_key_exists('SQL', $FormClass))
|
---|
| 313 | $SourceTable = '('.$FormClass['SQL'].') AS `TX`';
|
---|
| 314 | else $SourceTable = '`'.$FormClass['Table'].'` AS `TX`';
|
---|
[470] | 315 |
|
---|
[536] | 316 | // Build user filter
|
---|
[528] | 317 | $UserFilter = '';
|
---|
[536] | 318 | $Columns = array('Id' => '`Id`');
|
---|
[528] | 319 | if(array_key_exists('filter', $_GET) and ($_GET['filter'] == 1))
|
---|
| 320 | {
|
---|
| 321 | foreach($FormClass['Items'] as $ItemIndex => $FormItem)
|
---|
| 322 | if(!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or
|
---|
[557] | 323 | (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and
|
---|
[639] | 324 | ($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] != 'ManyToOne')))
|
---|
[528] | 325 | {
|
---|
[470] | 326 | $UseType = $UseType = $FormItem['Type'];
|
---|
[501] | 327 | if(array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes))
|
---|
[470] | 328 | {
|
---|
[639] | 329 | if(!array_key_exists($FormItem['Type'], $this->System->FormManager->Type->TypeDefinitionList))
|
---|
| 330 | $this->System->FormManager->Type->RegisterType($FormItem['Type'], '',
|
---|
[501] | 331 | $this->System->FormManager->FormTypes[$FormItem['Type']]);
|
---|
[639] | 332 | if($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] == 'Reference')
|
---|
[470] | 333 | $UseType = 'OneToMany';
|
---|
[639] | 334 | else
|
---|
| 335 | if($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] == 'Enumeration')
|
---|
[470] | 336 | $UseType = 'Enumeration';
|
---|
| 337 | }
|
---|
[536] | 338 | $FilterName = $this->System->FormManager->Type->ExecuteTypeEvent($UseType, 'OnFilterName',
|
---|
| 339 | array('Name' => $ItemIndex, 'Type' => $FormItem['Type']));
|
---|
| 340 | if(array_key_exists('Filter'.$ItemIndex, $_POST) and ($_POST['Filter'.$ItemIndex] != ''))
|
---|
| 341 | $UserFilter .= ' AND ('.$FilterName.' LIKE "%'.$_POST['Filter'.$ItemIndex].'%")';
|
---|
[470] | 342 | }
|
---|
[639] | 343 | }
|
---|
[536] | 344 | if(($Filter == '') and ($UserFilter != '')) $Filter = '1 '.$UserFilter;
|
---|
| 345 | if($Filter != '') $Filter = ' WHERE '.$Filter;
|
---|
[639] | 346 |
|
---|
[536] | 347 | foreach($FormClass['Items'] as $ItemIndex => $FormItem)
|
---|
[529] | 348 | if(!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or
|
---|
[557] | 349 | (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and
|
---|
| 350 | ($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] != 'ManyToOne')))
|
---|
[529] | 351 | {
|
---|
[557] | 352 | if($ExcludeColumn != $ItemIndex)
|
---|
| 353 | $TableColumns[] = array('Name' => $ItemIndex, 'Title' => $FormItem['Caption']);
|
---|
[536] | 354 | $UseType = $UseType = $FormItem['Type'];
|
---|
| 355 | if(array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes))
|
---|
| 356 | {
|
---|
| 357 | if(!array_key_exists($FormItem['Type'], $this->System->FormManager->Type->TypeDefinitionList))
|
---|
| 358 | $this->System->FormManager->Type->RegisterType($FormItem['Type'], '',
|
---|
| 359 | $this->System->FormManager->FormTypes[$FormItem['Type']]);
|
---|
| 360 | if($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] == 'Reference')
|
---|
| 361 | $UseType = 'OneToMany';
|
---|
| 362 | else
|
---|
| 363 | if($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] == 'Enumeration')
|
---|
| 364 | $UseType = 'Enumeration';
|
---|
| 365 | }
|
---|
[529] | 366 | if(array_key_exists('Filter'.$ItemIndex, $_POST) and ($_POST['Filter'.$ItemIndex] != ''))
|
---|
[536] | 367 | $Value = $_POST['Filter'.$ItemIndex];
|
---|
[639] | 368 | else $Value = '';
|
---|
[536] | 369 | if($ItemIndex == 'Id') unset($Columns['Id']);
|
---|
[639] | 370 |
|
---|
[581] | 371 | if(!array_key_exists('SQL', $FormItem)) $FormItem['SQL'] = '';
|
---|
[647] | 372 | else $FormItem['SQL'] = str_replace('#Id', '`TX`.`Id`', $FormItem['SQL']);
|
---|
[536] | 373 | $Columns[] = $this->System->FormManager->Type->ExecuteTypeEvent($UseType, 'OnFilterNameQuery',
|
---|
| 374 | array('Value' => $Value, 'Name' => $ItemIndex,
|
---|
[581] | 375 | 'Type' => $FormItem['Type'], 'SQL' => $FormItem['SQL']));
|
---|
[529] | 376 | }
|
---|
[639] | 377 |
|
---|
[536] | 378 | // Get total item count in database
|
---|
[647] | 379 | $Query = 'SELECT COUNT(*) FROM '.$SourceTable;
|
---|
[536] | 380 | $DbResult = $this->Database->query($Query);
|
---|
| 381 | $DbRow = $DbResult->fetch_assoc();
|
---|
| 382 | $TotalCount = $DbRow['COUNT(*)'];
|
---|
[639] | 383 |
|
---|
[536] | 384 | // Get total filtered item count in database
|
---|
| 385 | $Columns = implode(',', $Columns);
|
---|
[639] | 386 | if($Filter != '')
|
---|
[536] | 387 | {
|
---|
[647] | 388 | $Query = 'SELECT COUNT(*) FROM (SELECT '.$Columns.' FROM '.$SourceTable.') AS `TS` '.$Filter;
|
---|
[536] | 389 | $DbResult = $this->Database->query($Query);
|
---|
| 390 | $DbRow = $DbResult->fetch_row();
|
---|
| 391 | $TotalFilteredCount = $DbRow[0];
|
---|
| 392 | } else $TotalFilteredCount = $TotalCount;
|
---|
[639] | 393 | $PageList = GetPageList($TotalFilteredCount);
|
---|
[529] | 394 |
|
---|
| 395 | $Output = '<div style="text-align: center;">'.$FormClass['Title'].'</div>';
|
---|
| 396 | $Output .= $PageList['Output'];
|
---|
| 397 | $Output .= '<table class="WideTable" style="font-size: small;">';
|
---|
[639] | 398 |
|
---|
[529] | 399 | $TableColumns[] = array('Name' => '', 'Title' => 'Akce');
|
---|
| 400 | if(!array_key_exists('DefaultSortColumn', $FormClass))
|
---|
| 401 | $FormClass['DefaultSortColumn'] = 'Id';
|
---|
[660] | 402 | if(!array_key_exists('DefaultSortOrder', $FormClass))
|
---|
| 403 | $FormClass['DefaultSortOrder'] = 0;
|
---|
| 404 | $Order = GetOrderTableHeader($TableColumns, $FormClass['DefaultSortColumn'], $FormClass['DefaultSortOrder']);
|
---|
[529] | 405 | $Output .= $Order['Output'];
|
---|
[639] | 406 |
|
---|
[529] | 407 | // Show search fields
|
---|
[547] | 408 | if(array_key_exists('r', $_GET)) $Addition = '&r='.$_GET['r'];
|
---|
| 409 | else $Addition = '';
|
---|
| 410 | $Output .= '<tr><form action="?a='.$_GET['a'].'&t='.$Table.'&filter=1'.$Addition.'" method="post">';
|
---|
[529] | 411 | foreach($FormClass['Items'] as $ItemIndex => $FormItem)
|
---|
[557] | 412 | if((!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or
|
---|
| 413 | (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and
|
---|
| 414 | ($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] != 'ManyToOne'))) and
|
---|
| 415 | ($ExcludeColumn != $ItemIndex))
|
---|
[529] | 416 | {
|
---|
| 417 | if(array_key_exists('Filter'.$ItemIndex, $_POST) and ($_POST['Filter'.$ItemIndex] != ''))
|
---|
| 418 | $Value = $_POST['Filter'.$ItemIndex];
|
---|
[639] | 419 | else $Value = '';
|
---|
| 420 | $Output .= '<td><input type="text" name="Filter'.$ItemIndex.'" value="'.$Value.'" style="width: 100%"/></td>';
|
---|
[529] | 421 | }
|
---|
| 422 | $Output .= '<td><input type="Submit" value="Hledat"/></td></form></tr>';
|
---|
[639] | 423 |
|
---|
[531] | 424 | // Load and show items
|
---|
[647] | 425 | $Query = 'SELECT * FROM (SELECT '.$Columns.' FROM '.$SourceTable.') AS `TS` '.
|
---|
[639] | 426 | $Filter.' '.$Order['SQL'].$PageList['SQLLimit'];
|
---|
[531] | 427 | $VisibleItemCount = 0;
|
---|
[529] | 428 | $DbResult = $this->Database->query($Query);
|
---|
[639] | 429 | while($Row = $DbResult->fetch_assoc())
|
---|
| 430 | {
|
---|
[529] | 431 | $Output .= '<tr>';
|
---|
| 432 | foreach($FormClass['Items'] as $ItemIndex => $FormItem)
|
---|
[639] | 433 | if((!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or
|
---|
| 434 | (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and
|
---|
[557] | 435 | ($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] != 'ManyToOne'))) and
|
---|
| 436 | ($ExcludeColumn != $ItemIndex))
|
---|
[529] | 437 | {
|
---|
[557] | 438 | //$Output .= '<td>'.$Row[$ItemIndex].'</td>';
|
---|
[529] | 439 | $UseType = $UseType = $FormItem['Type'];
|
---|
| 440 | if(array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes))
|
---|
| 441 | {
|
---|
[639] | 442 | if(!array_key_exists($FormItem['Type'], $this->System->FormManager->Type->TypeDefinitionList))
|
---|
| 443 | $this->System->FormManager->Type->RegisterType($FormItem['Type'], '',
|
---|
[529] | 444 | $this->System->FormManager->FormTypes[$FormItem['Type']]);
|
---|
[639] | 445 | if($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] == 'Reference')
|
---|
[529] | 446 | $UseType = 'OneToMany';
|
---|
[639] | 447 | else
|
---|
| 448 | if($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] == 'Enumeration')
|
---|
[529] | 449 | $UseType = 'Enumeration';
|
---|
| 450 | }
|
---|
[639] | 451 | $Row[$ItemIndex] = $this->System->FormManager->Type->ExecuteTypeEvent($UseType, 'OnLoadDb',
|
---|
| 452 | array('Value' => $Row[$ItemIndex], 'Name' => $ItemIndex,
|
---|
[529] | 453 | 'Type' => $FormItem['Type']));
|
---|
[639] | 454 | $Value = $this->System->FormManager->Type->ExecuteTypeEvent($UseType, 'OnView',
|
---|
| 455 | array('Value' => $Row[$ItemIndex], 'Name' => $ItemIndex,
|
---|
[536] | 456 | 'Type' => $FormItem['Type'], 'Filter' => $Row[$ItemIndex.'_Filter']));
|
---|
[529] | 457 | if($Value == '') $Value = ' ';
|
---|
| 458 | $Output .= '<td>'.$Value.'</td>';
|
---|
| 459 | }
|
---|
[536] | 460 | $Output .= '<td>'.str_replace('#RowId', $Row['Id'], $RowActions).'</td></tr>';
|
---|
[531] | 461 | $VisibleItemCount = $VisibleItemCount + 1;
|
---|
[470] | 462 | }
|
---|
[531] | 463 | $Output .= '<tr><td colspan="'.count($TableColumns).'" style="text-align: right;">Zobrazeno <strong>'.$VisibleItemCount.'</strong>';
|
---|
| 464 | if($UserFilter != '') $Output .= ' z filtrovaných <strong>'.$TotalFilteredCount.'</strong>';
|
---|
| 465 | $Output .= ' z celkem <strong>'.$TotalCount.'</strong></td></tr>';
|
---|
[470] | 466 | $Output .= '</table>';
|
---|
| 467 | $Output .= $PageList['Output'];
|
---|
[536] | 468 | return($Output);
|
---|
| 469 | }
|
---|
[639] | 470 |
|
---|
[536] | 471 | function ShowSelect($Table, $Filter = '', $Title = '')
|
---|
[639] | 472 | {
|
---|
[599] | 473 | if(defined('NEW_PERMISSION') and !$this->System->User->CheckPermission($this->TableToModule($Table), 'Read'))
|
---|
[584] | 474 | return('Nemáte oprávnění');
|
---|
[536] | 475 | $this->BasicHTML = true;
|
---|
| 476 | $this->HideMenu = true;
|
---|
[574] | 477 | $RowActions = '<a href="javascript:window.close();" onclick="set_return(#RowId,"'.
|
---|
| 478 | $_GET['r'].'");"><img alt="Vybrat" title="Vybrat" src="'.
|
---|
[536] | 479 | $this->System->Link('/images/select.png').'"/></a>';
|
---|
[639] | 480 | $Output = $this->ShowTable($Table, $Filter, $Title, $RowActions);
|
---|
[536] | 481 | return($Output);
|
---|
[639] | 482 | }
|
---|
| 483 |
|
---|
[574] | 484 | function ShowMapSelect($Table, $Filter = '', $Title = '')
|
---|
| 485 | {
|
---|
[599] | 486 | if(defined('NEW_PERMISSION') and !$this->System->User->CheckPermission($this->TableToModule($Table), 'Write'))
|
---|
[584] | 487 | return('Nemáte oprávnění');
|
---|
[574] | 488 | $MapApi = new MapApiGoogle($this->System);
|
---|
[639] | 489 | $MapApi->Position = array('Lat' => $this->System->Config['Map']['DefaultLatitude'],
|
---|
[574] | 490 | 'Lng' => $this->System->Config['Map']['DefaultLongitude']);
|
---|
| 491 | $MapApi->Zoom = $this->System->Config['Map']['DefaultZoom'];
|
---|
| 492 | $MapApi->Key = $this->System->Config['Map']['GoogleMapsApiKey'];
|
---|
| 493 | $MapApi->OnClickObject = $_GET['r'];
|
---|
| 494 | //$MapApi->ShowMarker = true;
|
---|
[639] | 495 | $Output = $MapApi->ShowPage($this);
|
---|
[574] | 496 | return($Output);
|
---|
[639] | 497 | }
|
---|
| 498 |
|
---|
| 499 | function ShowList($Table, $Filter = '', $Title = '', $ExcludeColumn = '', $ExcludeValue = '')
|
---|
[536] | 500 | {
|
---|
[599] | 501 | if(defined('NEW_PERMISSION') and !$this->System->User->CheckPermission($this->TableToModule($Table), 'Read'))
|
---|
[584] | 502 | return('Nemáte oprávnění');
|
---|
[536] | 503 | $RowActions = '<a href="?a=view&t='.$Table.'&i=#RowId"><img alt="Ukázat" title="Ukázat" src="'.
|
---|
| 504 | $this->System->Link('/images/view.png').'"/></a>'.
|
---|
| 505 | '<a href="?a=edit&t='.$Table.'&i=#RowId"><img alt="Upravit" title="Upravit" src="'.
|
---|
| 506 | $this->System->Link('/images/edit.png').'"/></a>'.
|
---|
| 507 | '<a href="?a=delete&t='.$Table.'&i=#RowId"><img alt="Smazat" title="Smazat" src="'.
|
---|
| 508 | $this->System->Link('/images/delete.png').'" onclick="return confirmAction(\'Opravdu smazat položku?\');"/></a>';
|
---|
[661] | 509 | if(($Table != '') and (array_key_exists($Table, $this->System->FormManager->Classes)))
|
---|
| 510 | $FormClass = $this->System->FormManager->Classes[$Table];
|
---|
[646] | 511 | else return($this->SystemMessage('Chyba', 'Tabulka '.$Table.' nenalezena'));
|
---|
[536] | 512 | if(array_key_exists('ItemActions', $FormClass))
|
---|
| 513 | {
|
---|
| 514 | foreach($FormClass['ItemActions'] as $Action)
|
---|
[561] | 515 | {
|
---|
| 516 | $URL = $this->System->Link($Action['URL']);
|
---|
[639] | 517 | if(strpos($URL, '?') === false) $URL .= '?';
|
---|
[561] | 518 | else if((substr($URL, -5, 5) !== '&') and (substr($URL, -1, 1) !== '?')) $URL .= '&';
|
---|
[639] | 519 | $URL .= 'i=#RowId';
|
---|
[561] | 520 | $RowActions .= '<a href="'.$URL.'"><img alt="'.$Action['Caption'].'" title="'.$Action['Caption'].'" src="'.
|
---|
[536] | 521 | $this->System->Link('/images/action.png').'"/></a>';
|
---|
[561] | 522 | }
|
---|
[639] | 523 | }
|
---|
[557] | 524 | $Output = $this->ShowTable($Table, $Filter, $Title, $RowActions, $ExcludeColumn);
|
---|
[470] | 525 | $Output .= '<ul class="ActionMenu">';
|
---|
[639] | 526 | $Output .= '<li><a href="?a=add&t='.$Table.'&preset'.$ExcludeColumn.'='.$ExcludeValue.'"><img alt="Přidat" title="Přidat" src="'.
|
---|
[497] | 527 | $this->System->Link('/images/add.png').'"/>Přidat</a></li>';
|
---|
[470] | 528 | $Output .= '<li><a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'.
|
---|
[497] | 529 | $this->System->Link('/images/list.png').'"/>Seznam</a></li>';
|
---|
| 530 | if(array_key_exists('Actions', $FormClass))
|
---|
| 531 | {
|
---|
| 532 | foreach($FormClass['Actions'] as $Action)
|
---|
| 533 | $Output .= '<li><a href="'.$this->System->Link($Action['URL']).'"><img alt="'.$Action['Caption'].'" title="'.$Action['Caption'].'" src="'.
|
---|
| 534 | $this->System->Link('/images/action.png').'"/>'.$Action['Caption'].'</a></li>';
|
---|
| 535 | }
|
---|
[485] | 536 | $Output .= '</ul>';
|
---|
[639] | 537 | return($Output);
|
---|
[470] | 538 | }
|
---|
[639] | 539 |
|
---|
[585] | 540 | function ShowMenu()
|
---|
| 541 | {
|
---|
| 542 | $this->MenuItems = array();
|
---|
| 543 | $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` '.
|
---|
| 544 | 'LEFT JOIN `Action` ON `Action`.`Id` = `MenuItem`.`Action` '.
|
---|
| 545 | 'LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '.
|
---|
| 546 | 'WHERE `MenuItem`.`Menu`=1 '.
|
---|
| 547 | 'ORDER BY `MenuItem`.`Parent`,`MenuItem`.`Name`');
|
---|
| 548 | while($DbRow = $DbResult->fetch_assoc())
|
---|
| 549 | {
|
---|
| 550 | //if($DbRow['Permission'] != '')
|
---|
| 551 | $this->MenuItems[$DbRow['Id']] = $DbRow;
|
---|
| 552 | }
|
---|
| 553 | return($this->ShowMenuItem(''));
|
---|
| 554 | }
|
---|
[639] | 555 |
|
---|
[470] | 556 | function ShowMenuItem($Parent)
|
---|
| 557 | {
|
---|
| 558 | $Output = '<ul style="list-style: none; margin-left:1em; padding-left:0em;">';
|
---|
| 559 | foreach($this->MenuItems as $MenuItem)
|
---|
| 560 | if($MenuItem['Parent'] == $Parent)
|
---|
| 561 | {
|
---|
| 562 | $LinkTitle = $MenuItem['Name'];
|
---|
[639] | 563 | if($MenuItem['URL'] != '')
|
---|
[527] | 564 | {
|
---|
[654] | 565 | $Icon = 'Device.png';
|
---|
[527] | 566 | if(substr($MenuItem['URL'], 0, 4) != 'http') $MenuItem['URL'] = $this->System->Link($MenuItem['URL']);
|
---|
| 567 | $LinkTitle = MakeLink($MenuItem['URL'], $LinkTitle);
|
---|
[654] | 568 | } else $Icon = 'Folder.png';
|
---|
[597] | 569 | if($MenuItem['IconName'] != '') $Image = '<img src="'.$this->System->Link('/images/favicons/'.$MenuItem['IconName']).'"/> ';
|
---|
[654] | 570 | else $Image = '<img src="'.$this->System->Link('/images/favicons/'.$Icon).'"/> ';
|
---|
[639] | 571 | //if($this->System->User->CheckPermission($this->TableToModule($Table), 'Write') or !defined('NEW_PERMISSION'))
|
---|
[597] | 572 | $Output .= '<li>'.$Image.$LinkTitle.'</li>';
|
---|
[470] | 573 | $Output .= $this->ShowMenuItem($MenuItem['Id']);
|
---|
| 574 | }
|
---|
| 575 | $Output .= '</ul>';
|
---|
| 576 | return($Output);
|
---|
| 577 | }
|
---|
[639] | 578 |
|
---|
[585] | 579 | function TableToModule($Table)
|
---|
| 580 | {
|
---|
[597] | 581 | $DbResult = $this->Database->query('SELECT (SELECT `Name` FROM `Module` '.
|
---|
| 582 | 'WHERE `Module`.`Id`=`Model`.`Module`) AS `Name` FROM `Model` WHERE `Name`="'.$Table.'"');
|
---|
[585] | 583 | if($DbResult->num_rows == 1)
|
---|
| 584 | {
|
---|
| 585 | $DbRow = $DbResult->fetch_assoc();
|
---|
[639] | 586 | return($DbRow['Name']);
|
---|
[585] | 587 | } else return('');
|
---|
| 588 | }
|
---|
[470] | 589 | }
|
---|
| 590 |
|
---|
[479] | 591 | class ModuleIS extends AppModule
|
---|
[470] | 592 | {
|
---|
| 593 | function __construct($System)
|
---|
| 594 | {
|
---|
| 595 | parent::__construct($System);
|
---|
| 596 | $this->Name = 'Information system';
|
---|
| 597 | $this->Version = '1.0';
|
---|
| 598 | $this->Creator = 'Chronos';
|
---|
| 599 | $this->License = 'GNU/GPLv3';
|
---|
| 600 | $this->Description = 'User interface for generic information system';
|
---|
| 601 | $this->Dependencies = array();
|
---|
[639] | 602 | }
|
---|
[470] | 603 |
|
---|
[586] | 604 | function DoInstall()
|
---|
[470] | 605 | {
|
---|
| 606 | }
|
---|
[639] | 607 |
|
---|
[586] | 608 | function DoUninstall()
|
---|
[639] | 609 | {
|
---|
[470] | 610 | }
|
---|
[639] | 611 |
|
---|
[586] | 612 | function DoStart()
|
---|
[470] | 613 | {
|
---|
| 614 | $this->System->RegisterPage('is', 'PageIS');
|
---|
[538] | 615 | $this->System->FormManager->RegisterClass('MenuItem', array(
|
---|
| 616 | 'Title' => 'Položky nabídky',
|
---|
| 617 | 'Table' => 'MenuItem',
|
---|
| 618 | 'Items' => array(
|
---|
| 619 | 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''),
|
---|
| 620 | 'Parent' => array('Type' => 'TMenuItem', 'Caption' => 'Rodič', 'Default' => '', 'Null' => true),
|
---|
| 621 | 'Action' => array('Type' => 'TAction', 'Caption' => 'Akce', 'Default' => ''),
|
---|
| 622 | 'Menu' => array('Type' => 'TMenu', 'Caption' => 'Nabídka', 'Default' => ''),
|
---|
| 623 | 'Items' => array('Type' => 'TMenuItemListParent', 'Caption' => 'Položky'),
|
---|
| 624 | ),
|
---|
| 625 | ));
|
---|
| 626 | $this->System->FormManager->RegisterClass('Menu', array(
|
---|
| 627 | 'Title' => 'Nabídky',
|
---|
| 628 | 'Table' => 'Menu',
|
---|
| 629 | 'Items' => array(
|
---|
| 630 | 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''),
|
---|
| 631 | 'Items' => array('Type' => 'TMenuItemListMenu', 'Caption' => 'Položky'),
|
---|
| 632 | ),
|
---|
[639] | 633 | ));
|
---|
| 634 | }
|
---|
| 635 |
|
---|
[586] | 636 | function DoStop()
|
---|
[639] | 637 | {
|
---|
| 638 | }
|
---|
[470] | 639 | }
|
---|