Ignore:
Timestamp:
Oct 25, 2015, 9:51:51 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Now IS Dashboard is not dependent on other modules. They need to register their view to IS dashboard.
  • Fixed: Wrong sign of created finance operations from bank import.
  • Added: Storno invoices now have special groups in FinanceInvoiceGroup table.

Both Storno and previous storned documents should be linked together using new table FinanceInvoiceStorno.
Also they should be marked as not visible to user.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/IS/IS.php

    r747 r755  
    8181  {
    8282    $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;
    11192  }
    11293
     
    780761class ModuleIS extends AppModule
    781762{
     763  var $DashboardItems;
     764
    782765  function __construct($System)
    783766  {
     
    790773    $this->Description = 'User interface for generic information system';
    791774    $this->Dependencies = array();
     775
     776    $this->DashboardItems = array();
    792777  }
    793778
     
    849834  {
    850835  }
     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  }
    851846}
Note: See TracChangeset for help on using the changeset viewer.