Changeset 646
- Timestamp:
- Mar 25, 2014, 12:35:46 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r645 r646 1 1 <?php 2 2 3 $Revision = 64 5; // Subversion revision4 $DatabaseRevision = 64 5; // SQL structure revision5 $ReleaseTime = strtotime('2014-03-2 4');3 $Revision = 646; // Subversion revision 4 $DatabaseRevision = 646; // SQL structure revision 5 $ReleaseTime = strtotime('2014-03-25'); -
trunk/Common/Setup/Updates.php
r645 r646 576 576 } 577 577 578 function UpdateTo646($Manager) 579 { 580 $Manager->Execute('CREATE TABLE IF NOT EXISTS `Contract` ( 581 `Id` int(11) NOT NULL AUTO_INCREMENT, 582 `BillCode` varchar(255) NOT NULL, 583 `Subject` int(11) NOT NULL, 584 `DocumentLine` int(11) NOT NULL, 585 `ValidFrom` date NOT NULL, 586 `ValidTo` date DEFAULT NULL, 587 `File` int(11) DEFAULT NULL, 588 PRIMARY KEY (`Id`), 589 KEY `Subject` (`Subject`), 590 KEY `DocumentLine` (`DocumentLine`), 591 KEY `File` (`File`) 592 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'); 593 $Manager->Execute('ALTER TABLE `Contract` 594 ADD CONSTRAINT `Contract_ibfk_3` FOREIGN KEY (`File`) REFERENCES `File` (`Id`), 595 ADD CONSTRAINT `Contract_ibfk_1` FOREIGN KEY (`Subject`) REFERENCES `Subject` (`Id`), 596 ADD CONSTRAINT `Contract_ibfk_2` FOREIGN KEY (`DocumentLine`) REFERENCES `DocumentLine` (`Id`); 597 '); 598 $Manager->Execute("INSERT INTO `Action` ( 599 `Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` , 600 `Enable`) VALUES (NULL , '', 'Smlouvy', '1', '/is/?t=Contract&a=list', NULL , NULL , NULL , '1' 601 );"); 602 $ActionId = $Manager->Database->insert_id; 603 $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ". 604 "VALUES (NULL , 'Smlouvy', '2', '".$ActionId."', '1');"); 605 $Manager->Execute("INSERT INTO `Action` ( 606 `Id` ,`Name` ,`Title` ,`Type` ,`URL` ,`Group` ,`Icon` ,`PermissionOperation` , 607 `Enable`) VALUES (NULL , '', 'Sazby DPH', '1', '/is/?t=FinanceVAT&a=list', NULL , NULL , NULL , '1' 608 );"); 609 $ActionId = $Manager->Database->insert_id; 610 $Manager->Execute("INSERT INTO `MenuItem` (`Id` ,`Name` ,`Parent` ,`Action` ,`Menu`) ". 611 "VALUES (NULL , 'Sazby DPH', '2', '".$ActionId."', '1');"); 612 } 613 578 614 579 615 class Updates … … 614 650 632 => array('Revision' => 633, 'Function' => 'UpdateTo633'), 615 651 633 => array('Revision' => 645, 'Function' => 'UpdateTo645'), 652 645 => array('Revision' => 646, 'Function' => 'UpdateTo646'), 616 653 )); 617 654 } -
trunk/Modules/Finance/Finance.php
r645 r646 489 489 ), 490 490 )); 491 $this->System->FormManager->RegisterClass('Contract', array( 492 'Title' => 'Smlouvy', 493 'Table' => 'Contract', 494 'Items' => array( 495 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), 496 'BillCode' => array('Type' => 'String', 'Caption' => 'Kód', 'Default' => ''), 497 'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => ''), 498 'ValidFrom' => array('Type' => 'Date', 'Caption' => 'Platnost od', 'Default' => ''), 499 'ValidTo' => array('Type' => 'Date', 'Caption' => 'Platnost do', 'Default' => '', 'Null' => true), 500 'File' => array('Type' => 'TFile', 'Caption' => 'Soubor', 'Default' => '', 'Null' => true), 501 ), 502 'BeforeInsert' => array($this, 'BeforeInsertFinanceOperation'), 503 )); 491 504 492 505 $this->System->AddModule(new Bill($this->System)); … … 502 515 function BeforeInsertFinanceOperation($Form) 503 516 { 504 $Year = date("Y", $Form->Values['Time']); 517 if(array_key_exists('Time', $Form->Values)) $Year = date("Y", $Form->Values['Time']); 518 else $Year = date("Y", $Form->Values['ValidFrom']); 505 519 $DocumentLine = $Form->Values['DocumentLine']; 506 520 $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine, $Year); -
trunk/Modules/IS/IS.php
r639 r646 494 494 '<a href="?a=delete&t='.$Table.'&i=#RowId"><img alt="Smazat" title="Smazat" src="'. 495 495 $this->System->Link('/images/delete.png').'" onclick="return confirmAction(\'Opravdu smazat položku?\');"/></a>'; 496 if( $Table != '') $FormClass = $this->System->FormManager->Classes[$Table];497 else return($this->SystemMessage('Chyba', 'Tabulka nenalezena'));496 if(($Table != '') and (array_key_exists($Table, $this->System->FormManager->Classes))) $FormClass = $this->System->FormManager->Classes[$Table]; 497 else return($this->SystemMessage('Chyba', 'Tabulka '.$Table.' nenalezena')); 498 498 if(array_key_exists('ItemActions', $FormClass)) 499 499 {
Note:
See TracChangeset
for help on using the changeset viewer.