Changeset 755
- Timestamp:
- Oct 25, 2015, 9:51:51 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/FormClasses.php
r747 r755 356 356 'Filter' => '1', 357 357 ), 358 'TFinanceInvoiceStornoListBy' => array( 359 'Type' => 'ManyToOne', 360 'Table' => 'FinanceInvoiceStorno', 361 'Id' => 'Id', 362 'Ref' => 'StornoBy', 363 'Filter' => '1', 364 ), 365 'TFinanceInvoiceStornoListOf' => array( 366 'Type' => 'ManyToOne', 367 'Table' => 'FinanceInvoiceStorno', 368 'Id' => 'Id', 369 'Ref' => 'StornoOf', 370 'Filter' => '1', 371 ), 372 'TFinanceInvoiceListGroup' => array( 373 'Type' => 'ManyToOne', 374 'Table' => 'FinanceInvoice', 375 'Id' => 'Id', 376 'Ref' => 'Group', 377 'Filter' => '1', 378 ), 358 379 'TFinanceOperationListAccount' => array( 359 380 'Type' => 'ManyToOne', -
trunk/Application/Version.php
r754 r755 1 1 <?php 2 2 3 $Revision = 75 2; // Subversion revision4 $DatabaseRevision = 75 2; // SQL structure revision5 $ReleaseTime = strtotime('2015-10-2 1');3 $Revision = 755; // Subversion revision 4 $DatabaseRevision = 755; // SQL structure revision 5 $ReleaseTime = strtotime('2015-10-25'); -
trunk/Common/Setup/Updates.php
r754 r755 1523 1523 'VALUES (NULL, "Kontrola změn stavů", "SchedulerNotifyCheck");'); 1524 1524 1525 $ this->Database->query('1525 $Manager->Database->query(' 1526 1526 CREATE TABLE IF NOT EXISTS `NotifyUser` ( 1527 1527 `Id` int(11) NOT NULL AUTO_INCREMENT, … … 1533 1533 KEY `Contact` (`Contact`) 1534 1534 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'); 1535 $ this->Database->query('ALTER TABLE `NotifyUser`1535 $Manager->Database->query('ALTER TABLE `NotifyUser` 1536 1536 ADD CONSTRAINT `NotifyUser_ibfk_1` FOREIGN KEY (`User`) REFERENCES `User` (`Id`), 1537 1537 ADD CONSTRAINT `NotifyUser_ibfk_2` FOREIGN KEY (`Contact`) REFERENCES `Contact` (`Id`);'); 1538 1538 1539 $ this->Database->query('CREATE TABLE IF NOT EXISTS `NotifyCategory` (1539 $Manager->Database->query('CREATE TABLE IF NOT EXISTS `NotifyCategory` ( 1540 1540 `Id` int(11) NOT NULL AUTO_INCREMENT, 1541 1541 `Name` varchar(255) NOT NULL, … … 1544 1544 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;'); 1545 1545 1546 $ this->Database->query("INSERT INTO `NotifyCategory` (`Id`, `Name`, `SysName`) VALUES1546 $Manager->Database->query("INSERT INTO `NotifyCategory` (`Id`, `Name`, `SysName`) VALUES 1547 1547 (1, 'Dostupnost zařízení (ping)', 'NetworkReachability'), 1548 1548 (2, 'Dostupnost URL', 'URL'), … … 1553 1553 } 1554 1554 1555 function UpdateTo755($Manager) 1556 { 1557 $Manager->Execute("INSERT INTO `FinanceInvoiceGroup` (`Id`, `Name`, `DocumentLine`, `ValueSign`, `Direction`) '. 1558 'VALUES (NULL, 'Přijaté faktury - storno', '5', '1', '0'), (NULL, 'Vydané faktury - storno', '6', '-1', '1')"); 1559 $Manager->Execute("ALTER TABLE `FinanceInvoice` ADD `VisibleToUser` INT NOT NULL DEFAULT '1' AFTER `Generate`;ALTER TABLE `FinanceInvoice` ADD `VisibleToUser` INT NOT NULL DEFAULT '1' AFTER `Generate`;"); 1560 1561 $Manager->Execute("CREATE TABLE IF NOT EXISTS `FinanceInvoiceStorno` ( 1562 `Id` int(11) NOT NULL AUTO_INCREMENT, 1563 `StornoBy` int(11) NOT NULL, 1564 `StornoOf` int(11) NOT NULL, 1565 PRIMARY KEY (`Id`), 1566 KEY `StornoBy` (`StornoBy`), 1567 KEY `StornoOf` (`StornoOf`) 1568 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); 1569 1570 $Manager->Execute("ALTER TABLE `FinanceInvoiceStorno` 1571 ADD CONSTRAINT `FinanceInvoiceStorno_ibfk_1` FOREIGN KEY (`StornoBy`) REFERENCES `FinanceInvoice` (`Id`), 1572 ADD CONSTRAINT `FinanceInvoiceStorno_ibfk_2` FOREIGN KEY (`StornoOf`) REFERENCES `FinanceInvoice` (`Id`); 1573 "); 1574 } 1555 1575 1556 1576 class Updates … … 1627 1647 747 => array('Revision' => 748, 'Function' => 'UpdateTo748'), 1628 1648 748 => array('Revision' => 752, 'Function' => 'UpdateTo752'), 1649 752 => array('Revision' => 755, 'Function' => 'UpdateTo755'), 1629 1650 )); 1630 1651 } -
trunk/Modules/Customer/Customer.php
r738 r755 148 148 'Filter' => '1', 149 149 )); 150 151 $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('Customer', 152 array('ModuleCustomer', 'ShowDashboardItem')); 150 153 } 154 155 function ShowDashboardItem() 156 { 157 $DbResult = $this->Database->select('Member', 'COUNT(*)', '1'); 158 $DbRow = $DbResult->fetch_row(); 159 $Output = 'Zákazníků: registrovaných:'.$DbRow['0']; 160 161 $DbResult = $this->Database->select('Member', 'COUNT(*)', '`Blocked`=0 AND `BillingPeriod`<>1'); 162 $DbRow = $DbResult->fetch_row(); 163 $Output .= ' platících:'.$DbRow['0'].'<br/>'; 164 165 return($Output); 166 } 167 151 168 } -
trunk/Modules/Finance/Finance.php
r750 r755 333 333 'PeriodTo' => array('Type' => 'Date', 'Caption' => 'Období do', 'Default' => '', 'Null' => true), 334 334 'Cash' => array('Type' => 'Boolean', 'Caption' => 'Platit hotově', 'Default' => ''), 335 'VisibleToUser' => array('Type' => 'Boolean', 'Caption' => 'Viditelné uživatelům', 'Default' => '1'), 335 336 'Items' => array('Type' => 'TFinanceInvoiceItemListInvoice', 'Caption' => 'Položky', 'Default' => ''), 337 'StornoBy' => array('Type' => 'TFinanceInvoiceStornoListBy', 'Caption' => 'Storno doklady', 'Default' => ''), 338 'StornoOf' => array('Type' => 'TFinanceInvoiceStornoListOf', 'Caption' => 'Původní doklady', 'Default' => ''), 336 339 'OperationRel' => array('Type' => 'TFinanceInvoiceOperationRelListInvoice', 'Caption' => 'Platba', 'Default' => ''), 337 340 'OperationRelCount' => array('Type' => 'Integer', 'Caption' => 'Plateb', … … 365 368 'ValueSign' => array('Type' => 'TFinanceValueSign', 'Caption' => 'Znaménko hodnoty', 'Default' => '0'), 366 369 'Direction' => array('Type' => 'TFinanceDirection', 'Caption' => 'Směr', 'Default' => '0'), 370 'Items' => array('Type' => 'TFinanceInvoiceListGroup', 'Caption' => 'Faktury', 'Default' => ''), 371 ), 372 )); 373 374 $this->System->FormManager->RegisterClass('FinanceInvoiceStorno', array( 375 'Title' => 'Storno faktur', 376 'Table' => 'FinanceInvoiceStorno', 377 'Items' => array( 378 'StornoBy' => array('Type' => 'TFinanceInvoice', 'Caption' => 'Storno doklad', 'Default' => ''), 379 'StornoOf' => array('Type' => 'TFinanceInvoice', 'Caption' => 'Původní doklad', 'Default' => ''), 367 380 ), 368 381 )); … … 557 570 )); 558 571 572 559 573 $this->System->AddModule(new Bill($this->System)); 560 574 $this->System->AddModule(new Finance($this->System)); 561 575 $this->System->Modules['Finance']->MainSubject = $Config['Finance']['MainSubjectId']; 562 576 $this->System->Modules['Finance']->DirectoryId = $Config['Finance']['DirectoryId']; 577 578 $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('Finance', 579 array('ModuleFinance', 'ShowDashboardItem')); 580 } 581 582 function ShowDashboardItem() 583 { 584 $DbResult = $this->Database->select('FinanceOperation', 'ROUND(SUM(`Value`))', '1'); 585 $DbRow = $DbResult->fetch_row(); 586 $Output = 'Stav placení: '.$DbRow['0'].' Kč<br/>'; 587 return $Output; 563 588 } 564 589 -
trunk/Modules/FinanceBankAPI/FileImport.php
r747 r755 42 42 $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumberId($FinanceGroup['DocumentLine'], $Year); 43 43 $DbResult3 = $this->Database->insert('FinanceOperation', array('Subject' => $DbRow2['Id'], 'Cash' => 0, 44 'Value ' => Abs($DbRow['Value']), 'Taxable' => 1, 'BankAccount' => $DbRow['BankAccount'], 'Network' => 1,44 'ValueUser' => Abs($DbRow['Value']), 'Taxable' => 1, 'BankAccount' => $DbRow['BankAccount'], 'Network' => 1, 45 45 'Time' => $DbRow['Time'], 'Text' => $DbRow['Description'], 'BillCode' => $BillCode, 'Group' => $FinanceGroup['Id'])); 46 $this->Database->update('FinanceBankImport', 'Id='.$DbRow['Id'], array('FinanceOperation' => $this->Database->insert_id)); 46 $Id = $this->Database->insert_id; 47 $this->Database->update('FinanceBankImport', 'Id='.$DbRow['Id'], array('FinanceOperation' => $Id)); 48 49 // Execute after insert event 50 $Form = new Form($this->System->FormManager); 51 $Form->SetClass('FinanceOperation'); 52 $Form->LoadValuesFromDatabase($Id); 53 if(array_key_exists('AfterInsert', $Form->Definition)) 54 { 55 $Class = $Form->Definition['AfterInsert'][0]; 56 $Method = $Form->Definition['AfterInsert'][1]; 57 $Form->Values = $Class->$Method($Form, $Id); 58 } 47 59 } 48 60 } -
trunk/Modules/FinanceBankAPI/FinanceBankAPI.php
r740 r755 60 60 $this->System->RegisterPage(array('finance', 'import-api'), 'PageImportAPI'); 61 61 $this->System->RegisterPage(array('finance', 'import-soubor'), 'PageImportFile'); 62 63 $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('FinanceBankAPI', 64 array('ModuleFinanceBankAPI', 'ShowDashboardItem')); 62 65 } 63 66 64 67 function DoStop() 65 68 { 69 } 70 71 function ShowDashboardItem() 72 { 73 $DbResult = $this->Database->select('FinanceBankImport', 'COUNT(*)', '`FinanceOperation` IS NULL'); 74 $DbRow = $DbResult->fetch_row(); 75 $Output = 'Nezpárovaných plateb: '.$DbRow['0'].'<br/>'; 76 return($Output); 66 77 } 67 78 -
trunk/Modules/IS/IS.php
r747 r755 81 81 { 82 82 $Output = '<strong>Nástěnka:</strong><br/>'; 83 $DbResult = $this->Database->select('Task', 'COUNT(*)', '`Progress` < 100'); 84 $DbRow = $DbResult->fetch_row(); 85 $Output .= 'Nedokončených úkolů: '.$DbRow['0'].'<br/>'; 86 87 $DbResult = $this->Database->select('Member', 'COUNT(*)', '1'); 88 $DbRow = $DbResult->fetch_row(); 89 $Output .= 'Zákazníků: '.$DbRow['0'].'<br/>'; 90 91 $DbResult = $this->Database->select('Subject', 'COUNT(*)', '1'); 92 $DbRow = $DbResult->fetch_row(); 93 $Output .= 'Subjektů: '.$DbRow['0'].'<br/>'; 94 95 $DbResult = $this->Database->select('User', 'COUNT(*)', '1'); 96 $DbRow = $DbResult->fetch_row(); 97 $Output .= 'Uživatelů: '.$DbRow['0'].'<br/>'; 98 99 $DbResult = $this->Database->select('NetworkDevice', 'COUNT(*)', '1'); 100 $DbRow = $DbResult->fetch_row(); 101 $Output .= 'Registrovaných zařízení: '.$DbRow['0'].'<br/>'; 102 103 $DbResult = $this->Database->select('FinanceOperation', 'SUM(`Value`)', '1'); 104 $DbRow = $DbResult->fetch_row(); 105 $Output .= 'Stav placení: '.$DbRow['0'].'<br/>'; 106 107 $DbResult = $this->Database->select('FinanceBankImport', 'COUNT(*)', '`FinanceOperation` IS NULL'); 108 $DbRow = $DbResult->fetch_row(); 109 $Output .= 'Nezpárovaných plateb: '.$DbRow['0'].'<br/>'; 110 return($Output); 83 foreach($this->System->ModuleManager->Modules['IS']->DashboardItems as $Item) 84 { 85 if(is_string($Item['Callback'][0])) 86 { 87 $Class = new $Item['Callback'][0]($this->System); 88 $Output .= $Class->$Item['Callback'][1](); 89 } else $Output .= call_user_func($Item['Callback']); 90 } 91 return $Output; 111 92 } 112 93 … … 780 761 class ModuleIS extends AppModule 781 762 { 763 var $DashboardItems; 764 782 765 function __construct($System) 783 766 { … … 790 773 $this->Description = 'User interface for generic information system'; 791 774 $this->Dependencies = array(); 775 776 $this->DashboardItems = array(); 792 777 } 793 778 … … 849 834 { 850 835 } 836 837 function RegisterDashboardItem($Name, $Callback) 838 { 839 $this->DashboardItems[$Name] = array('Callback' => $Callback); 840 } 841 842 function UnregisterDashboardItem($Name) 843 { 844 unset($this->DashboardItems[$Name]); 845 } 851 846 } -
trunk/Modules/Network/Network.php
r739 r755 490 490 )); 491 491 492 $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('Network', 493 array('ModuleNetwork', 'ShowDashboardItem')); 494 } 495 496 function ShowDashboardItem() 497 { 498 $Output = ''; 499 $DbResult = $this->Database->select('NetworkDevice', 'COUNT(*)', '1'); 500 $DbRow = $DbResult->fetch_row(); 501 $Output .= 'Síťových zařízení: registrovaných:'.$DbRow['0']; 502 503 $DbResult = $this->Database->select('NetworkDevice', 'COUNT(*)', '`Used`=1'); 504 $DbRow = $DbResult->fetch_row(); 505 $Output .= ' použitých:'.$DbRow['0'].'<br>'; 506 507 $DbResult = $this->Database->select('NetworkInterface', 'COUNT(*)', '1'); 508 $DbRow = $DbResult->fetch_row(); 509 $Output .= 'Síťových rozhraní: '.$DbRow['0'].'<br>'; 510 511 $DbResult = $this->Database->select('NetworkSubnet', 'COUNT(*)', '1'); 512 $DbRow = $DbResult->fetch_row(); 513 $Output .= 'Síťových podsítí: '.$DbRow['0'].'<br/>'; 514 return $Output; 492 515 } 493 516 -
trunk/Modules/Subject/Subject.php
r754 r755 126 126 'Filter' => '1', 127 127 )); 128 $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('Subject', 129 array('ModuleSubject', 'ShowDashboardItem')); 128 130 } 129 131 … … 176 178 $this->Database->query('DROP TABLE `Subject`'); 177 179 } 180 181 function ShowDashboardItem() 182 { 183 $DbResult = $this->Database->select('Subject', 'COUNT(*)', '1'); 184 $DbRow = $DbResult->fetch_row(); 185 $Output = 'Subjektů: '.$DbRow['0'].'<br/>'; 186 return($Output); 187 } 178 188 } -
trunk/Modules/Task/Task.php
r746 r755 88 88 'Filter' => '1', 89 89 )); 90 91 $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('Task', 92 array('ModuleTask', 'ShowDashboardItem')); 90 93 } 91 94 … … 94 97 95 98 } 99 100 function ShowDashboardItem() 101 { 102 $DbResult = $this->Database->select('Task', 'COUNT(*)', '`Progress` < 100'); 103 $DbRow = $DbResult->fetch_row(); 104 $Output = 'Nedokončených úkolů: '.$DbRow['0'].'<br/>'; 105 return $Output; 106 } 96 107 } -
trunk/Modules/User/User.php
r746 r755 270 270 'Filter' => '1', 271 271 )); 272 272 $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('User', 273 array('ModuleUser', 'ShowDashboardItem')); 274 } 275 276 function ShowDashboardItem() 277 { 278 $DbResult = $this->Database->select('User', 'COUNT(*)', '1'); 279 $DbRow = $DbResult->fetch_row(); 280 $Output = 'Uživatelů: '.$DbRow['0'].'<br/>'; 281 return $Output; 273 282 } 274 283
Note:
See TracChangeset
for help on using the changeset viewer.