Changeset 736
- Timestamp:
- Apr 6, 2015, 11:08:10 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/FormClasses.php
r723 r736 304 304 'Filter' => '1', 305 305 ), 306 'TNetworkLinkListInterface1' => array(307 'Type' => 'ManyToOne',308 'Table' => 'NetworkLink',309 'Id' => 'Id',310 'Ref' => 'Interface1',311 'Filter' => '1',312 ),313 'TNetworkLinkListInterface2' => array(314 'Type' => 'ManyToOne',315 'Table' => 'NetworkLink',316 'Id' => 'Id',317 'Ref' => 'Interface2',318 'Filter' => '1',319 ),320 'TNetworkInterfaceUpDown' => array(321 'Type' => 'ManyToOne',322 'Table' => 'NetworkInterfaceUpDown',323 'Id' => 'Id',324 'Ref' => 'Interface',325 'Filter' => '1',326 ),327 306 'TNetworkSignalListInterface' => array( 328 307 'Type' => 'ManyToOne', -
trunk/Application/Version.php
r735 r736 1 1 <?php 2 2 3 $Revision = 73 5; // Subversion revision4 $DatabaseRevision = 73 5; // SQL structure revision3 $Revision = 736; // Subversion revision 4 $DatabaseRevision = 736; // SQL structure revision 5 5 $ReleaseTime = strtotime('2015-04-06'); -
trunk/Common/Setup/Updates.php
r735 r736 1330 1330 1, '.$ActionId.', "", NULL, "", 5);'); 1331 1331 $Manager->Execute('ALTER TABLE `Scheduler` CHANGE `ScheduledTime` `ScheduledTime` DATETIME NULL;'); 1332 } 1333 1334 function UpdateTo736($Manager) 1335 { 1336 $Manager->Execute('CREATE TABLE IF NOT EXISTS `NetworkLinkType` ( 1337 `Id` int(11) NOT NULL, 1338 `Name` varchar(255) NOT NULL 1339 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 1340 1341 $Manager->Execute('ALTER TABLE `NetworkLinkType` ADD PRIMARY KEY (`Id`);'); 1342 1343 $Manager->Execute('ALTER TABLE `NetworkLinkType` 1344 MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;'); 1332 1345 } 1333 1346 … … 1397 1410 730 => array('Revision' => 731, 'Function' => 'UpdateTo731'), 1398 1411 731 => array('Revision' => 735, 'Function' => 'UpdateTo735'), 1412 735 => array('Revision' => 736, 'Function' => 'UpdateTo736'), 1399 1413 )); 1400 1414 } -
trunk/Modules/Employee/Employee.php
r711 r736 42 42 'Table' => 'Employee', 43 43 'Id' => 'Id', 44 'Name' => 'CONCAT (FirstName, " ", SecondName)',44 'Name' => 'CONCAT_WS(" ", NULLIF(`FirstName`, ""), NULLIF(`SecondName`, ""))', 45 45 'Filter' => '1', 46 46 )); -
trunk/Modules/IS/IS.php
r732 r736 353 353 if(defined('NEW_PERMISSION') and !$this->System->User->CheckPermission($this->TableToModule($Table), 'Read')) 354 354 return('Nemáte oprávnění'); 355 355 356 $FormClass = $this->System->FormManager->Classes[$Table]; 357 if(array_key_exists('BaseTable', $FormClass)) $TableModify = $FormClass['BaseTable']; 358 else $TableModify = $Table; 359 356 360 $Form = new Form($this->System->FormManager); 357 361 $Form->SetClass($Table); … … 363 367 { 364 368 $Actions = array( 365 $this->ShowAction('Upravit', '?a=edit&t='.$Table .'&i='.$Id,369 $this->ShowAction('Upravit', '?a=edit&t='.$TableModify.'&i='.$Id, 366 370 $this->System->Link('/images/edit.png')), 367 371 $this->ShowAction('Seznam', '?a=list&t='.$Table, … … 369 373 $this->ShowAction('Odstranit', '?a=delete&t='.$Table.'&i='.$Id, 370 374 $this->System->Link('/images/delete.png'), 'Opravdu smazat položku?'), 371 $this->ShowAction('Přidat', '?a=add&t='.$Table ,375 $this->ShowAction('Přidat', '?a=add&t='.$TableModify, 372 376 $this->System->Link('/images/add.png')) 373 377 ); … … 625 629 if(defined('NEW_PERMISSION') and !$this->System->User->CheckPermission($this->TableToModule($Table), 'Read')) 626 630 return('Nemáte oprávnění'); 631 $FormClass = $this->System->FormManager->Classes[$Table]; 632 if(array_key_exists('BaseTable', $FormClass)) $TableModify = $FormClass['BaseTable']; 633 else $TableModify = $Table; 634 627 635 $RowActions = '<a href="?a=view&t='.$Table.'&i=#RowId"><img alt="Ukázat" title="Ukázat" src="'. 628 636 $this->System->Link('/images/view.png').'"/></a>'. 629 '<a href="?a=edit&t='.$Table .'&i=#RowId"><img alt="Upravit" title="Upravit" src="'.637 '<a href="?a=edit&t='.$TableModify.'&i=#RowId"><img alt="Upravit" title="Upravit" src="'. 630 638 $this->System->Link('/images/edit.png').'"/></a>'. 631 639 '<a href="?a=delete&t='.$Table.'&i=#RowId"><img alt="Smazat" title="Smazat" src="'. … … 634 642 $FormClass = $this->System->FormManager->Classes[$Table]; 635 643 else return($this->SystemMessage('Chyba', 'Tabulka '.$Table.' nenalezena')); 636 $this->ShortTitle .= ' - '.$FormClass['Title'];644 if($ExcludeColumn == '') $this->ShortTitle .= ' - '.$FormClass['Title']; 637 645 if(array_key_exists('ItemActions', $FormClass)) 638 646 { … … 646 654 $Output .= '<div style="text-align: center;">'.$FormClass['Title'].'</div>'; 647 655 $Output .= '<ul class="ActionMenu">'; 648 $Output .= '<li>'.$this->ShowAction('Přidat', '?a=add&t='.$Table .'&preset'.$ExcludeColumn.'='.$ExcludeValue, $this->System->Link('/images/add.png')).'</li>';656 $Output .= '<li>'.$this->ShowAction('Přidat', '?a=add&t='.$TableModify.'&preset'.$ExcludeColumn.'='.$ExcludeValue, $this->System->Link('/images/add.png')).'</li>'; 649 657 $Output .= '<li>'.$this->ShowAction('Seznam', '?a=list&t='.$Table, $this->System->Link('/images/list.png')).'</li>'; 650 658 $MI = 0; -
trunk/Modules/Network/Availability.php
r687 r736 85 85 86 86 $DbResult2 = $this->Database->query('SELECT `NetworkInterface`.`Name` AS `InterfaceName`'.$Columns.', '. 87 'CONCAT (`NetworkDevice`.`Name`, "-", `NetworkInterface`.`Name`) AS `Name`, `NetworkDevice`.`Name` AS `DeviceName` FROM `NetworkInterface` '.87 'CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")) AS `Name`, `NetworkDevice`.`Name` AS `DeviceName` FROM `NetworkInterface` '. 88 88 $Join.' JOIN `NetworkDevice` ON `NetworkInterface`.`Device` = `NetworkDevice`.`Id` WHERE `NetworkDevice`.`Used` = 1 AND `NetworkDevice`.`PermanentOnline`=1'. 89 89 $Order['SQL'].$PageList['SQLLimit']); -
trunk/Modules/Network/Network.php
r731 r736 186 186 'Online' => array('Type' => 'TOnlineState', 'Caption' => 'Běží', 'Default' => '0', 'ReadOnly' => true), 187 187 'LastOnline' => array('Type' => 'DateTime', 'Caption' => 'Naposledy běželo', 'Default' => '', 'ReadOnly' => true), 188 'Links1' => array('Type' => 'TNetworkLinkListInterface1', 'Caption' => 'Propojení 1', 'Default' => ''), 189 'Links2' => array('Type' => 'TNetworkLinkListInterface2', 'Caption' => 'Propojení 2', 'Default' => ''), 188 'Links' => array('Type' => 'TNetworkLinkListInterface', 'Caption' => 'Propojení', 'Default' => ''), 190 189 'UpDown' => array('Type' => 'TNetworkInterfaceUpDown', 'Caption' => 'Změny stavu', 'Default' => ''), 191 190 'Signal' => array('Type' => 'TNetworkSignalListInterface', 'Caption' => 'Signál', 'Default' => ''), … … 193 192 194 193 ), 195 )); 194 )); 196 195 $this->System->FormManager->RegisterClass('NetworkInterfaceType', array( 197 196 'Title' => 'Typ síťového rozhraní', … … 229 228 'Table' => 'NetworkLink', 230 229 'Items' => array( 231 'Type' => array('Type' => ' Integer', 'Caption' => 'Typ', 'Default' => '1'),230 'Type' => array('Type' => 'TNetworkLinkType', 'Caption' => 'Typ', 'Default' => '1'), 232 231 'Interface1' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní 1', 'Default' => ''), 233 232 'Interface2' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní 2', 'Default' => ''), 233 ), 234 )); 235 $this->System->FormManager->RegisterClass('NetworkLinkUnion', array( 236 'Title' => 'Síťové propojení', 237 'BaseTable' => 'NetworkLink', 238 'SQL' => '(SELECT `Id`, `Type`, `Interface1` AS `Interface`, `Interface2` AS `InterfaceOther` FROM `NetworkLink`) '. 239 'UNION (SELECT `Id`, `Type`, `Interface2` AS `Interface`, `Interface1` AS `InterfaceOther` FROM `NetworkLink`)', 240 'Items' => array( 241 'Type' => array('Type' => 'TNetworkLinkType', 'Caption' => 'Typ', 'Default' => '1', 'ReadOnly' => true), 242 'Interface' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní 1', 'Default' => '', 'ReadOnly' => true), 243 'InterfaceOther' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní 2', 'Default' => '', 'ReadOnly' => true), 244 ), 245 )); 246 247 $this->System->FormManager->RegisterClass('NetworkLinkType', array( 248 'Title' => 'Typ síťového propojení', 249 'Table' => 'NetworkLinkType', 250 'Items' => array( 251 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 234 252 ), 235 253 )); … … 369 387 'Type' => 'Reference', 370 388 'Table' => 'NetworkInterface', 371 'View' => '(SELECT NetworkInterface.*, CONCAT (NetworkDevice.Name, "-", NetworkInterface.Name) AS DeviceName FROM NetworkInterface '.389 'View' => '(SELECT NetworkInterface.*, CONCAT_WS("-", NetworkDevice.Name, NULLIF(NetworkInterface.Name, "")) AS DeviceName FROM NetworkInterface '. 372 390 'LEFT JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device) AS T', 373 391 'Id' => 'Id', … … 396 414 'Filter' => '1', 397 415 )); 416 $this->System->FormManager->RegisterFormType('TNetworkLinkType', array( 417 'Type' => 'Reference', 418 'Table' => 'NetworkLinkType', 419 'Id' => 'Id', 420 'Name' => 'Name', 421 'Filter' => '1', 422 )); 398 423 $this->System->FormManager->RegisterFormType('TDeviceAPIType', array( 399 424 'Type' => 'Reference', … … 417 442 'Filter' => '1', 418 443 )); 444 $this->System->FormManager->RegisterFormType('TNetworkLinkListInterface', array( 445 'Type' => 'ManyToOne', 446 'Table' => 'NetworkLinkUnion', 447 'Id' => 'Id', 448 'Ref' => 'Interface', 449 'Filter' => '1', 450 )); 451 $this->System->FormManager->RegisterFormType('TNetworkLinkListInterface1', array( 452 'Type' => 'ManyToOne', 453 'Table' => 'NetworkLink', 454 'Id' => 'Id', 455 'Ref' => 'Interface1', 456 'Filter' => '1', 457 )); 458 $this->System->FormManager->RegisterFormType('TNetworkLinkListInterface2', array( 459 'Type' => 'ManyToOne', 460 'Table' => 'NetworkLink', 461 'Id' => 'Id', 462 'Ref' => 'Interface2', 463 'Filter' => '1', 464 )); 465 $this->System->FormManager->RegisterFormType('TNetworkInterfaceUpDown', array( 466 'Type' => 'ManyToOne', 467 'Table' => 'NetworkInterfaceUpDown', 468 'Id' => 'Id', 469 'Ref' => 'Interface', 470 'Filter' => '1', 471 )); 472 419 473 } 420 474 -
trunk/Modules/Stock/Stock.php
r715 r736 68 68 'ReadOnly' => true, 'SQL' => '(SELECT SUM(`SellPrice`) FROM `StockSerialNumber` WHERE '. 69 69 '(`StockSerialNumber`.`Stock`=#Id) AND (`StockSerialNumber`.`TimeElimination` IS NULL))', 'Suffix' => 'Kč'), 70 'Moves' => array('Type' => 'TStockMoveStock', 'Caption' => 'Pohyby', 'Default' => ''), 70 71 ), 71 72 )); … … 83 84 'Price' => array('Type' => 'Float', 'Caption' => 'Cena', 'Default' => '', 84 85 'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => '(SELECT SUM(`StockMoveItem`.`UnitPrice` * `StockMoveItem`.`Amount`) FROM `StockMoveItem` '. 86 'WHERE `StockMoveItem`.`StockMove`=#Id)'), 87 'Items' => array('Type' => 'TStockMoveItemListStockMove', 'Caption' => 'Položky', 'Default' => ''), 88 ), 89 'BeforeInsert' => array($this, 'BeforeInsertStockMove'), 90 )); 91 $this->System->FormManager->RegisterClass('StockMoveUnion', array( 92 'Title' => 'Skladový pohyb', 93 'BaseTable' => 'StockMove', 94 'DefaultSortColumn' => 'Time', 95 'SQL' => '(SELECT *, -1 AS `Direction`, `StockFrom` AS `Stock`, `StockTo` AS `StockOther` FROM `StockMove`) '. 96 'UNION (SELECT *, 1 AS `Direction`, `StockTo` AS `Stock`, `StockFrom` AS `StockOther` FROM `StockMove`)', 97 'Items' => array( 98 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), 99 'BillCode' => array('Type' => 'String', 'Caption' => 'Označení', 'Default' => ''), 100 'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => ''), 101 'Stock' => array('Type' => 'TStock', 'Caption' => 'První sklad', 'Default' => '', 'Null' => true), 102 'StockOther' => array('Type' => 'TStock', 'Caption' => 'Druhý sklad', 'Default' => '', 'Null' => true), 103 'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true), 104 'Price' => array('Type' => 'Float', 'Caption' => 'Cena', 'Default' => '', 105 'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => '(SELECT `TX`.`Direction` * SUM(`StockMoveItem`.`UnitPrice` * `StockMoveItem`.`Amount`) FROM `StockMoveItem` '. 85 106 'WHERE `StockMoveItem`.`StockMove`=#Id)'), 86 107 'Items' => array('Type' => 'TStockMoveItemListStockMove', 'Caption' => 'Položky', 'Default' => ''), … … 107 128 'Filter' => '1', 108 129 )); 130 $this->System->FormManager->RegisterFormType('TStockMoveStock', array( 131 'Type' => 'ManyToOne', 132 'Table' => 'StockMoveUnion', 133 'Id' => 'Id', 134 'Ref' => 'Stock', 135 'Filter' => '1', 136 )); 109 137 $this->System->FormManager->RegisterFormType('TStockMove', array( 110 138 'Type' => 'Reference',
Note:
See TracChangeset
for help on using the changeset viewer.