Changeset 529
- Timestamp:
- Apr 23, 2013, 7:12:53 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Form.php
r502 r529 138 138 array('Value' => $DbRow[$Index], 'Name' => $Index, 139 139 'Type' => $Item['Type'], 'Values' => $this->Values)); 140 141 //echo($DbRow[$Index].'='.$this->Values[$Index].'<br/>');142 140 } 143 141 } … … 172 170 $Values[$Index] = $this->FormManager->Type->ExecuteTypeEvent($UseType, 'OnSaveDb', $Parameters); 173 171 if(($Item['Type'] == 'Password') and ($Values[$Index] == '')) unset($Values[$Index]); 174 175 //echo($DbRow[$Index].'='.$this->Values[$Index].'<br/>');176 172 } 177 173 } … … 182 178 } else 183 179 $DbResult = $this->Database->update($this->Definition['Table'], 'Id='.$Id, $Values); 184 //echo($Database->LastQuery);185 180 } 186 181 … … 255 250 var $Database; 256 251 var $Type; 252 var $RootURL; 257 253 258 254 function __construct($Database) -
trunk/Common/Form/Types/OneToMany.php
r502 r529 5 5 class TypeOneToMany extends TypeBase 6 6 { 7 var $EditActions; 8 7 9 function OnView($Item) 8 10 { … … 24 26 function OnEdit($Item) 25 27 { 26 $Output = '<select name="'.$Item['Name'].'" >';28 $Output = '<select name="'.$Item['Name'].'" id="'.$Item['Name'].'">'; 27 29 $Type = $this->FormManager->Type->TypeDefinitionList[$Item['Type']]; 28 30 if(array_key_exists('Condition', $Type['Parameters'])) $Where = ' WHERE '.$Type['Parameters']['Condition']; … … 42 44 } 43 45 $Output .= '</select>'; 46 $Output .= '<img src="'.$this->FormManager->Root.'/images/select.png" alf="Vybrat" language="javascript" '. 47 'onclick="return popupwindow("'.$this->FormManager->Root.'/is/?a=select&t='.$Table.'&r='.$Item['Name'].'","test");" style="cursor:hand;cursor:pointer"/>'; 44 48 return($Output); 45 49 } -
trunk/Common/Global.php
r525 r529 72 72 $System->Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery']; 73 73 $System->RootURLFolder = $Config['Web']['RootFolder']; 74 $System->FormManager->Root = $Config['Web']['RootFolder']; 74 75 75 76 // Check database persistence structure -
trunk/Common/Page.php
r525 r529 9 9 var $ShowRuntimeInfo = false; 10 10 var $ClearPage = false; 11 var $BasicHTML = false; 11 12 var $ParentClass = ''; 12 13 var $ShortTitle; … … 64 65 '<script type="text/javascript" src="'.$this->System->Link('/style/').$this->System->Config['Web']['Style'].'/global.js"></script>'. 65 66 '<title>'.$this->System->Config['Web']['Title'].' - '.$Path.'</title> 66 </head><body'.$BodyParam.'> 67 <div id="Title">'.$Title.'</div> 68 <div class="Navigation"><span class="MenuItem"><strong>Navigace :: </strong> '.$Navigation.'</span><div class="MenuItem2">'; 69 if($this->System->Config['Web']['UserSupport'] == 1) 67 </head><body'.$BodyParam.'>'; 68 if($this->BasicHTML == false) 70 69 { 71 if($this->System->User->User['Id'] == null) 72 $Output .= '<a href="'.$this->System->Link('/?Action=LoginForm').'">Přihlášení</a> <a href="'.$this->System->Link('/?Action=UserRegister').'">Registrace</a>'; 73 else $Output .= $this->System->User->User['Name'].' <a href="'.$this->System->Link('/?Action=Logout').'">Odhlásit</a>'; 74 } else $Output .= ' '; 75 // <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení</a>'; 76 $Output .= '</div></div>'; 70 $Output .= '<div id="Title">'.$Title.'</div> 71 <div class="Navigation"><span class="MenuItem"><strong>Navigace :: </strong> '.$Navigation.'</span><div class="MenuItem2">'; 72 if($this->System->Config['Web']['UserSupport'] == 1) 73 { 74 if($this->System->User->User['Id'] == null) 75 $Output .= '<a href="'.$this->System->Link('/?Action=LoginForm').'">Přihlášení</a> <a href="'.$this->System->Link('/?Action=UserRegister').'">Registrace</a>'; 76 else $Output .= $this->System->User->User['Name'].' <a href="'.$this->System->Link('/?Action=Logout').'">Odhlásit</a>'; 77 } else $Output .= ' '; 78 // <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení</a>'; 79 $Output .= '</div></div>'; 80 } 77 81 return($Output); 78 82 } … … 82 86 global $ScriptTimeStart; 83 87 $Time = round(GetMicrotime() - $ScriptTimeStart, 2); 84 $Output = '<div id="Footer"> 85 <i>| Správa webu: '.$this->System->Config['Web']['Admin'].' | e-mail: '.$this->System->Config['Web']['AdminEmail'].' |'; 86 if($this->ShowRuntimeInfo == true) $Output .= ' Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s | Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B |'; 87 $Output .= '</i></div></body></html>'; 88 $Output = ''; 89 if($this->BasicHTML == false) 90 { 91 $Output .= '<div id="Footer"> 92 <i>| Správa webu: '.$this->System->Config['Web']['Admin'].' | e-mail: '.$this->System->Config['Web']['AdminEmail'].' |'; 93 if($this->ShowRuntimeInfo == true) $Output .= ' Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s | Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B |'; 94 $Output .= '</i></div>'; 95 } 96 $Output .= '</body></html>'; 88 97 return($Output); 89 98 } -
trunk/Common/Version.php
r528 r529 1 1 <?php 2 2 3 $Revision = 52 8; // Subversion revision3 $Revision = 529; // Subversion revision 4 4 $DatabaseRevision = 527; // SQL structure revision 5 $ReleaseTime = '2013-04-2 1';5 $ReleaseTime = '2013-04-23'; 6 6 7 7 ?> -
trunk/Modules/IS/IS.php
r528 r529 9 9 var $ParentClass = 'PagePortal'; 10 10 var $MenuItems = array(); 11 var $HideMenu = false; 11 12 12 13 function Show() … … 22 23 { 23 24 $this->MenuItems[$DbRow['Id']] = $DbRow; 24 } 25 26 $Output = '<table style="width: 100%"><tr><td style="width: 20%; vertical-align: top;">'; 27 $Output .= '<strong>Nabídka:</strong><br/>'.$this->ShowMenuItem(''); 28 $Output .= '</td><td style="width: 80%; vertical-align: top;">'; 25 } 29 26 30 27 if(array_key_exists('t', $_GET)) $_SESSION['Table'] = $_GET['t']; 31 28 if(array_key_exists('a', $_GET)) $_SESSION['Action'] = $_GET['a']; 32 29 if(array_key_exists('id', $_GET)) $_SESSION['Id'] = $_GET['id']; 33 30 if(array_key_exists('r', $_GET)) $_SESSION['Ref'] = $_GET['r']; 31 34 32 if(!array_key_exists('Action', $_SESSION)) $_SESSION['Action'] = 'list'; 35 33 if(!array_key_exists('Id', $_SESSION) or !array_key_exists('Table', $_SESSION) or … … 38 36 $_SESSION['Action'] = ''; 39 37 $_SESSION['Table'] = ''; 40 } 41 42 if($_SESSION['Action'] == 'list') $Output .= $this->ShowList($_SESSION['Table']); 43 else if($_SESSION['Action'] == 'edit') $Output .= $this->ShowEdit($_SESSION['Table'], $_SESSION['Id']); 44 else if($_SESSION['Action'] == 'add') $Output .= $this->ShowAdd($_SESSION['Table']); 45 else if($_SESSION['Action'] == 'view') $Output .= $this->ShowView($_SESSION['Table'], $_SESSION['Id']); 46 else if($_SESSION['Action'] == 'delete') $Output .= $this->ShowDelete($_SESSION['Table'], $_SESSION['Id']); 47 $Output .= '</td></tr></table>'; 38 $_SESSION['Ref'] = ''; 39 } 40 41 if($_SESSION['Action'] == 'list') $Content = $this->ShowList($_SESSION['Table']); 42 else if($_SESSION['Action'] == 'select') $Content = $this->ShowSelect($_SESSION['Table']); 43 else if($_SESSION['Action'] == 'edit') $Content = $this->ShowEdit($_SESSION['Table'], $_SESSION['Id']); 44 else if($_SESSION['Action'] == 'add') $Content = $this->ShowAdd($_SESSION['Table']); 45 else if($_SESSION['Action'] == 'view') $Content = $this->ShowView($_SESSION['Table'], $_SESSION['Id']); 46 else if($_SESSION['Action'] == 'delete') $Content = $this->ShowDelete($_SESSION['Table'], $_SESSION['Id']); 47 else $Content = ''; 48 if($this->HideMenu == false) 49 { 50 $Output = '<table style="width: 100%"><tr><td style="width: 20%; vertical-align: top;">'; 51 $Output .= '<strong>Nabídka:</strong><br/>'.$this->ShowMenuItem(''); 52 $Output .= '</td><td style="width: 80%; vertical-align: top;">'; 53 $Output .= $Content; 54 $Output .= '</td></tr></table>'; 55 } else $Output = $Content; 48 56 49 57 return($Output); … … 70 78 $Form->SetClass($Table); 71 79 $Form->LoadValuesFromDatabase($Id); 72 $Form->OnSubmit = '?a=edit& o=save';80 $Form->OnSubmit = '?a=edit&t='.$Table.'&o=save'; 73 81 $Output .= $Form->ShowEditForm(); 74 82 $Output .= '<ul class="ActionMenu">'; 75 $Output .= '<li><a href="?a=view "><img alt="Prohlížet" title="Prohlížet" src="'.83 $Output .= '<li><a href="?a=view&t='.$Table.'"><img alt="Prohlížet" title="Prohlížet" src="'. 76 84 $this->System->Link('/images/view.png').'"/>Prohlížet</a></li>'; 77 $Output .= '<li><a href="?a=list "><img alt="Seznam" title="Seznam" src="'.85 $Output .= '<li><a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'. 78 86 $this->System->Link('/images/list.png').'"/>Seznam</a></li>'; 79 $Output .= '<li><a href="?a=delete " onclick="return confirmAction(\'Opravdu smazat položku?\');"><img alt="Odstranit" title="Odstranit" src="'.87 $Output .= '<li><a href="?a=delete&t='.$Table.'" onclick="return confirmAction(\'Opravdu smazat položku?\');"><img alt="Odstranit" title="Odstranit" src="'. 80 88 $this->System->Link('/images/delete.png').'"/>Odstranit</a></li>'; 81 89 $Output .= '</ul>'; … … 118 126 $Form = new Form($this->System->FormManager); 119 127 $Form->SetClass($Table); 120 $Form->OnSubmit = '?a=add& o=save';128 $Form->OnSubmit = '?a=add&t='.$Table.'&o=save'; 121 129 $Output .= $Form->ShowEditForm(); 122 130 $Output .= '<ul class="ActionMenu">'; 123 $Output .= '<li><a href="?a=list "><img alt="Seznam" title="Seznam" src="'.131 $Output .= '<li><a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'. 124 132 $this->System->Link('/images/list.png').'"/>Seznam</a></li>'; 125 133 $Output .= '</ul>'; … … 166 174 } 167 175 168 function ShowList($Table, $Filter = '', $Title = '') 169 { 176 function ShowSelect($Table, $Filter = '', $Title = '') 177 { 178 $this->BasicHTML = true; 179 $this->HideMenu = true; 170 180 if($Table != '') $FormClass = $this->System->FormManager->Classes[$Table]; 171 181 else return($this->SystemMessage('Chyba', 'Tabulka nenalezena')); … … 174 184 $PageList = GetPageList($DbRow[0]); 175 185 176 $Output = '<div style="text-align: center;">'.$FormClass['Title'].'</div>'; 186 $Output = '<script type="text/javascript"> 187 function set_return(id, obj) 188 { 189 window.opener.document.getElementById(obj).value = id; 190 } 191 </script>'; 192 $Output .= '<div style="text-align: center;">'.$FormClass['Title'].'</div>'; 177 193 $Output .= $PageList['Output']; 178 194 $Output .= '<table class="WideTable" style="font-size: small;">'; … … 204 220 } 205 221 } 206 $Output .= '<tr><form action="?a= list&filter=1" method="post">';222 $Output .= '<tr><form action="?a=select&filter=1" method="post">'; 207 223 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 208 224 if(!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or … … 252 268 $Output .= '<td>'.$Value.'</td>'; 253 269 } 270 $Output .= '<td><a href="javascript:window.close();" onclick="set_return('.$Row['Id'].',"'.$_SESSION['Ref'].'");"><img alt="Vybrat" title="Vybrat" src="'. 271 $this->System->Link('/images/select.png').'"/></a>'; 272 $Output .= '</td></tr>'; 273 } 274 $Output .= '</table>'; 275 $Output .= $PageList['Output']; 276 return($Output); 277 } 278 279 function ShowList($Table, $Filter = '', $Title = '') 280 { 281 if($Table != '') $FormClass = $this->System->FormManager->Classes[$Table]; 282 else return($this->SystemMessage('Chyba', 'Tabulka nenalezena')); 283 284 // Build user filter 285 $UserFilter = ''; 286 if(array_key_exists('filter', $_GET) and ($_GET['filter'] == 1)) 287 { 288 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 289 if(!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or 290 (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and 291 ($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] != 'ManyToOne'))) 292 { 293 if(array_key_exists('Filter'.$ItemIndex, $_POST) and ($_POST['Filter'.$ItemIndex] != '')) 294 $UserFilter .= ' AND (`'.$ItemIndex.'` LIKE "%'.$_POST['Filter'.$ItemIndex].'%")'; 295 } 296 } 297 if(($Filter == '') and ($UserFilter != '')) $Filter = '1 '.$UserFilter; 298 if($Filter != '') $Filter = ' WHERE '.$Filter; 299 300 $DbResult = $this->Database->query('SELECT COUNT(*) FROM `'.$FormClass['Table'].'`'.$Filter); 301 $DbRow = $DbResult->fetch_row(); 302 $PageList = GetPageList($DbRow[0]); 303 304 $Output = '<div style="text-align: center;">'.$FormClass['Title'].'</div>'; 305 $Output .= $PageList['Output']; 306 $Output .= '<table class="WideTable" style="font-size: small;">'; 307 308 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 309 if(!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or 310 (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and 311 ($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] != 'ManyToOne'))) 312 { 313 $TableColumns[] = array('Name' => $ItemIndex, 'Title' => $FormItem['Caption']); 314 } 315 $TableColumns[] = array('Name' => '', 'Title' => 'Akce'); 316 if(!array_key_exists('DefaultSortColumn', $FormClass)) 317 $FormClass['DefaultSortColumn'] = 'Id'; 318 $Order = GetOrderTableHeader($TableColumns, $FormClass['DefaultSortColumn'], 0); 319 $Output .= $Order['Output']; 320 321 // Show search fields 322 $Output .= '<tr><form action="?a=list&filter=1" method="post">'; 323 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 324 if(!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or 325 (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and 326 ($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] != 'ManyToOne'))) 327 { 328 if(array_key_exists('Filter'.$ItemIndex, $_POST) and ($_POST['Filter'.$ItemIndex] != '')) 329 $Value = $_POST['Filter'.$ItemIndex]; 330 else $Value = ''; 331 $Output .= '<td><input type="text" name="Filter'.$ItemIndex.'" value="'.$Value.'" style="width: 100%"/></td>'; 332 } 333 $Output .= '<td><input type="Submit" value="Hledat"/></td></form></tr>'; 334 335 $Query = 'SELECT * FROM `'.$FormClass['Table'].'`'.$Filter.' '.$Order['SQL'].$PageList['SQLLimit']; 336 337 $DbResult = $this->Database->query($Query); 338 while($Row = $DbResult->fetch_assoc()) 339 { 340 $Output .= '<tr>'; 341 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 342 if(!array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) or 343 (array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes) and 344 ($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] != 'ManyToOne'))) 345 { 346 //$Output .= '<td>'.$Row[$ItemIndex].'</td>'; 347 $UseType = $UseType = $FormItem['Type']; 348 if(array_key_exists($FormItem['Type'], $this->System->FormManager->FormTypes)) 349 { 350 if(!array_key_exists($FormItem['Type'], $this->System->FormManager->Type->TypeDefinitionList)) 351 $this->System->FormManager->Type->RegisterType($FormItem['Type'], '', 352 $this->System->FormManager->FormTypes[$FormItem['Type']]); 353 if($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] == 'Reference') 354 $UseType = 'OneToMany'; 355 else 356 if($this->System->FormManager->FormTypes[$FormItem['Type']]['Type'] == 'Enumeration') 357 $UseType = 'Enumeration'; 358 } 359 $Row[$ItemIndex] = $this->System->FormManager->Type->ExecuteTypeEvent($UseType, 'OnLoadDb', 360 array('Value' => $Row[$ItemIndex], 'Name' => $ItemIndex, 361 'Type' => $FormItem['Type'])); 362 $Value = $this->System->FormManager->Type->ExecuteTypeEvent($UseType, 'OnView', 363 array('Value' => $Row[$ItemIndex], 'Name' => $ItemIndex, 364 'Type' => $FormItem['Type'])); 365 if($Value == '') $Value = ' '; 366 $Output .= '<td>'.$Value.'</td>'; 367 } 254 368 $Output .= '<td><a href="?a=view&t='.$Table.'&id='.$Row['Id'].'"><img alt="Ukázat" title="Ukázat" src="'. 255 369 $this->System->Link('/images/view.png').'"/></a>'. -
trunk/Modules/Network/UserHosts.php
r524 r529 3 3 class PageNetworkHostList extends Page 4 4 { 5 function __construct( )5 function __construct($System) 6 6 { 7 parent::__construct( );7 parent::__construct($System); 8 8 $this->FullTitle = 'Registrované počítače'; 9 9 $this->ShortTitle = 'Registrované počítače'; -
trunk/form_classes.php
r527 r529 627 627 ), 628 628 'Actions' => array( 629 array('Caption' => 'Dostupnost zařízení', 'URL' => '/network/ dostupnost.php'),629 array('Caption' => 'Dostupnost zařízení', 'URL' => '/network/availability/'), 630 630 ), 631 631 ), … … 648 648 'LocalIP' => array('Type' => 'String', 'Caption' => 'IPv4', 'Default' => ''), 649 649 'IPv6' => array('Type' => 'String', 'Caption' => 'IPv6', 'Default' => ''), 650 'ExternalIP' => array('Type' => 'String', 'Caption' => 'Veřejná IPv4', 'Default' => ' 0'),650 'ExternalIP' => array('Type' => 'String', 'Caption' => 'Veřejná IPv4', 'Default' => ''), 651 651 'Device' => array('Type' => 'TNetworkDevice', 'Caption' => 'Zařízení', 'Default' => ''), 652 652 'Online' => array('Type' => 'Boolean', 'Caption' => 'Běží', 'Default' => '0', 'ReadOnly' => true), -
trunk/style/new/global.js
r433 r529 38 38 return is_confirmed; 39 39 } 40 41 function popupwindow(url, title) 42 { 43 var e = document.documentElement; 44 var g = document.getElementsByTagName('body')[0]; 45 var w = window.innerWidth || e.clientWidth || g.clientWidth; 46 var h = window.innerHeight|| e.clientHeight|| g.clientHeight; 47 w = (w * 0.9).toFixed(); 48 h = (h * 0.6).toFixed(); 49 if(w < 640) w = 640; 50 if(h < 480) h = 480; 51 var left = (screen.width / 2) - (w / 2); 52 var top = (screen.height / 2) - (h / 2); 53 return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); 54 }
Note:
See TracChangeset
for help on using the changeset viewer.