Changeset 521


Ignore:
Timestamp:
Apr 14, 2013, 9:04:17 PM (11 years ago)
Author:
chronos
Message:
  • Upraveno: Finance přepracovány na aplikační modul. Upraveny URL adresy stránek.
  • Přidáno: Slučování registrovaných stránek do stromu stránek. Registgrovat lze nyní také pomocí cesty jako pole adresářů URL.
Location:
trunk
Files:
1 deleted
8 edited
12 copied

Legend:

Unmodified
Added
Removed
  • trunk/Common/Global.php

    r518 r521  
    2222include_once(dirname(__FILE__).'/Page.php');
    2323include_once(dirname(__FILE__).'/Form/Form.php');
    24 include_once(dirname(__FILE__).'/../finance/bills.php');
    25 include_once(dirname(__FILE__).'/../finance/finance.php');
    2624include_once(dirname(__FILE__).'/../form_classes.php');
    2725
     
    7068  function RegisterPage($Path, $Handler)
    7169  {
    72     $this->Pages[$Path] = $Handler;
     70    if(is_array($Path))
     71    {
     72      $Page = &$this->Pages;
     73      $LastKey = array_pop($Path);
     74      foreach($Path as $PathItem)
     75      {
     76        $Page = &$Page[$PathItem];       
     77      }
     78      if(!is_array($Page)) $Page = array('' => $Page);
     79      $Page[$LastKey] = $Handler;
     80    } else $this->Pages[$Path] = $Handler;
    7381  }
    7482 
    7583  function SearchPage($PathItems, $Pages)
    7684  {
    77     $PathItem = $PathItems[0];
     85    if(count($PathItems) > 0) $PathItem = $PathItems[0];
     86      else $PathItem = '';
    7887    if(array_key_exists($PathItem, $Pages))
    7988    {
     
    8695  }
    8796 
     97  function PageNotFound()
     98  {
     99    return('Page '.implode('/', $this->PathItems).' not found.');
     100  }
     101 
    88102  function ShowPage()
    89103  {
     
    96110      $Page->Database = &$this->Database;
    97111      $Page->GetOutput();
    98     } else echo('Page '.implode('/', $this->PathItems).' not found.');
     112    } else echo($this->PageNotFound());
    99113  }
    100114 
  • trunk/Common/Page.php

    r519 r521  
    3333    while(strpos($ScriptName, '//') !== false)
    3434      $ScriptName = str_replace('//', '/', $ScriptName);
     35    if(strpos($ScriptName, '?') !== false)
     36      $ScriptName = substr($ScriptName, 0, strrpos($ScriptName, '?'));
    3537    $ScriptName = substr($ScriptName, strlen($this->System->Link('')));
    3638    if(substr($ScriptName, -1, 1) == '/') $ScriptName = substr($ScriptName, 0, -1);
  • trunk/Common/Version.php

    r519 r521  
    11<?php
    22
    3 $Revision = 519; // Subversion revision
    4 $DatabaseRevision = 517;
    5 $ReleaseTime = '2013-04-13';
     3$Revision = 521; // Subversion revision
     4$DatabaseRevision = 517; // SQL structure revision
     5$ReleaseTime = '2013-04-14';
    66
    77?>
  • trunk/Modules/Finance/Consumption.php

    r519 r521  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class FinanceConsumption extends Page
     3class PageFinanceConsumption extends Page
    64{
    75  var $FullTitle = 'Spotřeba energie';
    86  var $ShortTitle = 'Spotřeba';
     7  var $ParentClass = 'PageFinance';
    98
    109  function Show()
     
    3029}
    3130
    32 $System->AddModule(new FinanceConsumption());
    33 $System->Modules['FinanceConsumption']->GetOutput();
    34 
    3531?>
  • trunk/Modules/Finance/Customers.php

    r519 r521  
    11<?php
    2 include_once('../Common/Global.php');
    32
    4 class FinanceUserList extends Page
     3class PageFinanceCustomers extends Page
    54{
    6   var $FullTitle = 'Seznam účastníků sítě';
    7   var $ShortTitle = 'Seznam účastníků';
     5  var $FullTitle = 'Seznam zákazníků sítě';
     6  var $ShortTitle = 'Zákazníci';
     7  var $ParentClass = 'PageFinance';
    88
    99  function Show()
     
    7979}
    8080
    81 $System->AddModule(new FinanceUserList());
    82 $System->Modules['FinanceUserList']->GetOutput();
    83 
    8481?>
  • trunk/Modules/Finance/Devices.php

    r519 r521  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class FinanceDeviceListPage extends Page
     3class PageFinanceDeviceList extends Page
    64{
    75  var $FullTitle = 'Zařízení sítě';
    86  var $ShortTitle = 'Zařízení';
     7  var $ParentClass = 'PageFinance';
    98
    109  function Show()
     
    3534}
    3635
    37 $System->AddModule(new FinanceDeviceListPage());
    38 $System->Modules['FinanceDeviceListPage']->GetOutput()
    39 
    4036?>
  • trunk/Modules/Finance/Finance.php

    r505 r521  
    11<?php
     2
     3include_once(dirname(__FILE__).'/Overview.php');
     4include_once(dirname(__FILE__).'/Consumption.php');
     5include_once(dirname(__FILE__).'/Devices.php');
     6include_once(dirname(__FILE__).'/Bill.php');
     7include_once(dirname(__FILE__).'/Services.php');
     8include_once(dirname(__FILE__).'/Customers.php');
     9include_once(dirname(__FILE__).'/MonthlyOverall.php');
     10include_once(dirname(__FILE__).'/Manage.php');
     11include_once(dirname(__FILE__).'/UserState.php');
     12include_once(dirname(__FILE__).'/Import.php');
     13include_once(dirname(__FILE__).'/Zivnost.php');
     14include_once(dirname(__FILE__).'/finance.php');
    215
    316class ModuleFinance extends AppModule
     
    2538  {
    2639    parent::Start();
     40    $this->System->RegisterPage('finance', 'PageFinance');
     41    $this->System->RegisterPage(array('finance', 'spotreba'), 'PageFinanceConsumption');
     42    $this->System->RegisterPage(array('finance', 'zarizeni'), 'PageFinanceDeviceList');
     43    $this->System->RegisterPage(array('finance', 'sluzby'), 'PageFinanceServices');
     44    $this->System->RegisterPage(array('finance', 'mesicni-prehledy'), 'PageFinanceMonthlyOverall');
     45    $this->System->RegisterPage(array('finance', 'zakaznici'), 'PageFinanceCustomers');
     46    $this->System->RegisterPage(array('finance', 'sprava'), 'PageFinanceManage');
     47    $this->System->RegisterPage(array('finance', 'platby'), 'PageFinanceUserState');
     48    $this->System->RegisterPage(array('finance', 'import'), 'PageFinanceImportPayment');   
     49    $this->System->RegisterPage(array('finance', 'zivnost'), 'PageFinanceTaxFiling');   
    2750  } 
    2851 
  • trunk/Modules/Finance/Import.php

    r519 r521  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class FinanceImportPayment extends Page
     3class PageFinanceImportPayment extends Page
    64{
    75  var $FullTitle = 'Import plateb';
    86  var $ShortTitle = 'Import plateb';
     7  var $ParentClass = 'PageFinance';
    98
    109  function Show()
     
    146145}
    147146
    148 $System->AddModule(new FinanceImportPayment());
    149 $System->Modules['FinanceImportPayment']->GetOutput();
    150 
    151147?>
  • trunk/Modules/Finance/Manage.php

    r519 r521  
    11<?php
    22
    3 include_once(dirname(__FILE__).'/../Common/Global.php');
    4 
    5 class FinanceManagePage extends Page
     3class PageFinanceManage extends Page
    64{
    75  var $FullTitle = 'Správa financí';
    86  var $ShortTitle = 'Správa financí';
    9 
     7  var $ParentClass = 'PageFinance';
     8 
    109  function Show()
    1110  {
     
    7473        $Output .= '<a href="?Operation=ShowMonthlyPayment">Měsíční vyúčtování</a><br />';
    7574        //$Output .= '<a href="clenove.php">Seznam členů</a><br />';
    76         $Output .= '<a href="zivnost.php">Živnost</a><br />';
     75        $Output .= '<a href="'.$this->System->Link('/finance/zivnost/').'">Živnost</a><br />';
    7776        $Output .= '<a href="?Operation=GenerateBills">Generovat chybějící doklady</a><br />';
    78         $Output .= '<a href="import.php">Import plateb</a><br />';
     77        $Output .= '<a href="'.$this->System->Link('/finance/import/').'">Import plateb</a><br />';
    7978    }
    8079    return($Output);
     
    632631}
    633632
    634 $System->AddModule(new FinanceManagePage());
    635 $System->Modules['FinanceManagePage']->GetOutput();
    636 
    637633?>
  • trunk/Modules/Finance/MonthlyOverall.php

    r519 r521  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class FinanceMonthlyOverallPage extends Page
     3class PageFinanceMonthlyOverall extends Page
    64{
    75  var $FullTitle = 'Měsíční přehledy';
    86  var $ShortTitle = 'Měsíční přehledy';
     7  var $ParentClass = 'PageFinance';
    98
    109  function Show()
     
    3332}
    3433
    35 $System->AddModule(new FinanceMonthlyOverallPage());
    36 $System->Modules['FinanceMonthlyOverallPage']->GetOutput();
    37 
    3834?>
  • trunk/Modules/Finance/Overview.php

    r519 r521  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class FinanceOverview extends Page
     3class PageFinance extends Page
    64{
    75  var $FullTitle = 'Přehled financování sítě';
     
    1412    $Output = '<table><tr><td valign="top">';
    1513   
    16     $Output .= '<a href="monthly_overall.php">Měsíční přehledy</a><br />';
    17     $Output .= '<a href="tarify.php">Tarify</a><br />';
    18     $Output .= '<a href="zarizeni.php">Výpis zařízení</a><br />';
    19     if($this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) $Output .= '<a href="clenove.php">Seznam členů</a><br />';
    20     $Output .= '<a href="spotreba.php">Spotřeba energie</a><br />';
    21     $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/aktuality/index.php?category=9">Investice v síti</a><br />';
    22     //$Output .= '<a href="faktury/">Faktury za internet</a><br />';
     14    $Output .= '<a href="'.$this->System->Link('/finance/mesicni-prehledy/').'">Měsíční přehledy</a><br />';
     15    $Output .= '<a href="'.$this->System->Link('/finance/sluzby/').'">Přehled nabízených služeb</a><br />';
     16    $Output .= '<a href="'.$this->System->Link('/finance/zarizeni/').'">Výpis zařízení</a><br />';
     17    if($this->System->Modules['User']->CheckPermission('Finance', 'SubjectList'))
     18      $Output .= '<a href="'.$this->System->Link('/finance/zakaznici/').'">Seznam zákazníků</a><br />';
     19    $Output .= '<a href="'.$this->System->Link('/finance/spotreba/').'">Spotřeba energie</a><br />';
     20    //$Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/aktuality/index.php?category=9">Investice v síti</a><br />';
    2321   
    2422    $Output .= '<br /><strong>Souhrn:</strong><br />';
     
    9593}
    9694
    97 $System->AddModule(new FinanceOverview());
    98 $System->Modules['FinanceOverview']->GetOutput();
    99 
    10095?>
  • trunk/Modules/Finance/Services.php

    r519 r521  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class FinanceTarrifsPage extends Page
     3class PageFinanceServices extends Page
    64{
    75  var $FullTitle = 'Přehled tarifů';
    86  var $ShortTitle = 'Tarify';
     7  var $ParentClass = 'PageFinance';
    98
    109  function TariffTable()
     
    6968}
    7069
    71 $System->AddModule(new FinanceTarrifsPage());
    72 $System->Modules['FinanceTarrifsPage']->GetOutput();
    73 
    7470?>
  • trunk/Modules/Finance/UserState.php

    r519 r521  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class FinanceUserState extends Page
     3class PageFinanceUserState extends Page
    64{
    75  var $FullTitle = 'Stav financí účastníka';
    86  var $ShortTitle = 'Stav financí';
     7  var $ParentClass = 'PageFinance';
    98
    109  function Show()
     
    150149}
    151150
    152 $System->AddModule(new FinanceUserState());
    153 $System->Modules['FinanceUserState']->GetOutput();
    154 
    155151?>
  • trunk/Modules/Finance/Zivnost.php

    r519 r521  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class FinanceTaxFilingPage extends Page
     3class PageFinanceTaxFiling extends Page
    64{
    75  var $FullTitle = 'Daňová evidence';
    86  var $ShortTitle = 'Daňová evidence';
     7  var $ParentClass = 'PageFinance';
    98  var $ExternalSubject = 96;
    109  var $StartEvidence = 0;
     
    376375}
    377376
    378 $System->AddModule(new FinanceTaxFilingPage());
    379 $System->Modules['FinanceTaxFilingPage']->GetOutput();
    380 
    381377?>
  • trunk/Modules/FinanceBankAPI/FinanceBankAPI.php

    r502 r521  
    3939    );
    4040    $this->System->FormManager->RegisterClass('ImportBankFile', $FormClass);
    41     $this->System->RegisterPage('finance', array('import-api' => 'PageImportAPI',
    42       'import-soubor' => 'PageImportFile'));
     41    $this->System->RegisterPage(array('finance', 'import-api'), 'PageImportAPI');
     42    $this->System->RegisterPage(array('finance', 'import-soubor'), 'PageImportFile');
    4343  } 
    4444 
  • trunk/Modules/Network/Network.php

    r519 r521  
    88include_once(dirname(__FILE__).'/UserHosts.php');
    99
    10 class PageNetwork extends Page
     10class PageFrequencyPlan extends Page
    1111{
    12   var $FullTitle = 'Technické informace o síti';
    13   var $ShortTitle = 'Síť';
    14   var $ParentClass = 'PagePortal';
     12  var $FullTitle = 'Výpis obsazení frekvenčních kanálů';
     13  var $ShortTitle = 'Frekvenční plán';
     14  var $ParentClass = 'PageNetwork';
    1515
    1616  function Show()
    1717  {
    18     if(count($this->System->PathItems) > 1)
    19     {
    20       $this->ClearPage = true;
    21       if($this->System->PathItems[1] == 'administration') $Output = $this->NewPage('PageNetworkAdministration')->GetOutput();
    22       else if($this->System->PathItems[1] == 'availability') $Output = $this->NewPage('PageAvailability')->GetOutput();
    23       else if($this->System->PathItems[1] == 'subnet') $Output = $this->NewPage('PageSubnet')->GetOutput();
    24       else if($this->System->PathItems[1] == 'user_hosts') $Output = $this->NewPage('PageNetworkHostList')->GetOutput();
    25       else if($this->System->PathItems[1] == 'hosting') $Output = $this->NewPage('PageHosting')->GetOutput();
    26       else if($this->System->PathItems[1] == 'hosts') $Output = $this->NewPage('PageHostList')->GetOutput();
    27       else {
    28         $this->ClearPage = false;
    29         $Output = $this->ShowInformation();
    30       }
    31     } else $Output = $this->ShowInformation();
    32     return($Output); 
    33   }
    34  
    35   function ShowInformation()
    36   {
    37     $Output = '';
    38     if(!array_key_exists('section', $_GET)) $_GET['section'] = '';
    39     switch($_GET['section'])
    40     {
    41       case 'obsazeni_wifi_kanalu':
    4218        // http://en.wikipedia.org/wiki/List_of_WLAN_channels
    4319        //$ChannelList = array(2412 => 1, 2417 => 2, 2422 => 3, 2427 => 4, 2432 => 5, 2437 => 6, 2442 => 7, 2447 => 8, 2452 => 9, 2457 => 10, 2462 => 11, 2467 => 12, 2472 => 13, 5200 => 40, 5205 => 41, 5210 => 42, 5215 => 43, 5220 => 44, 5225 => 45, 5230 => 46, 5235 => 47, 5240 => 48, 5245 => 49, 5250 => 50, 5255 => 51, 5260 => 52, 5265 => 53, 5270 => 54, 5275 => 55, 5280 => 56, 5285 => 57, 5290 => 58, 5295 => 59, 5300 => 60, 5500 => 100, 5520 => 104, 5540 => 108, 5560 => 112, 5580 => 116, 5600 => 120, 5620 => 124, 5640 => 128, 5660 => 132, 5700 => 140, 5720 => 144);
    44         $Output .= '<div align="center">'.
     20        $Output = '<div align="center">'.
    4521        '<a href="?section=obsazeni_wifi_kanalu&range=a">Pásmo 2,4 GHz (a)</a> '.
    4622        '<a href="?section=obsazeni_wifi_kanalu&amp;range=bc">Pásmo 5 GHz dolní (b, c)</a> '.
     
    9470        }
    9571        $Output .= '</table>';
    96         break;
    97       default:
    98         $Output .= '<a href="?section=obsazeni_wifi_kanalu">Obsazení Wi-Fi kanálů</a><br />';
    99         $Output .= '<a href="'.$this->System->Link('/network/availability/').'">Měření dostupnosti zařízení</a><br />';
    100         $Output .= '<a href="'.$this->System->Link('/network/subnet/').'">Výpis registrovaných podsítí</a><br />';
    101         //$Output .= '<a href="tkr.php">Kanály kabelové televize</a>';
    102     }
     72    return($Output);
     73  } 
     74}
     75 
     76class PageNetwork extends Page
     77{
     78  var $FullTitle = 'Technické informace o síti';
     79  var $ShortTitle = 'Síť';
     80  var $ParentClass = 'PagePortal';
     81
     82  function Show()
     83  {
     84    if(count($this->System->PathItems) > 1)
     85    {
     86      $Output = $this->PageNotFound();
     87    } else $Output = $this->ShowInformation();
     88    return($Output); 
     89  }
     90 
     91  function ShowInformation()
     92  {
     93    $Output = '<a href="'.$this->System->Link('/network/frequency-plan/').'">Frekvenční plán</a><br />';
     94    $Output .= '<a href="'.$this->System->Link('/network/availability/').'">Měření dostupnosti zařízení</a><br />';
     95    $Output .= '<a href="'.$this->System->Link('/network/subnet/').'">Výpis registrovaných podsítí</a><br />';
     96    $Output .= '<a href="'.$this->System->Link('/network/hosts/').'">Registrované zařízení</a><br />';
    10397    return($Output);
    10498  }
     
    130124    parent::Start();
    131125    $this->System->RegisterPage('network', 'PageNetwork');   
     126    $this->System->RegisterPage(array('network', 'administration'), 'PageNetworkAdministration');
     127    $this->System->RegisterPage(array('network', 'availability'), 'PageAvailability');
     128    $this->System->RegisterPage(array('network', 'subnet'), 'PageSubnet');
     129    $this->System->RegisterPage(array('network', 'user-hosts'), 'PageNetworkHostList');
     130    $this->System->RegisterPage(array('network', 'hosting'),'PageHosting');
     131    $this->System->RegisterPage(array('network', 'hosts'), 'PageHostList');
     132    $this->System->RegisterPage(array('network', 'frequency-plan'), 'PageFrequencyPlan');
    132133  } 
    133134 
  • trunk/Modules/News/NewsPage.php

    r515 r521  
    77  var $FullTitle = 'Aktualní informace';
    88  var $ShortTitle = 'Aktuality';
     9  var $ParentClass = 'PagePortal';
    910  var $UploadedFilesFolder = 'uploads/';
    1011
  • trunk/Modules/Portal/Portal.php

    r519 r521  
    7575      $Output .= '<a href="'.$this->System->Link('/?Action=MemberOptions').'">Domácnost</a><br />';
    7676    if($this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState'))
    77       $Output .= '<a href="'.$this->System->Link('/finance/user_state.php').'">Finance</a><br />';
     77      $Output .= '<a href="'.$this->System->Link('/finance/platby/').'">Finance</a><br />';
    7878    if($this->System->Modules['User']->CheckPermission('Network', 'RegistredHostList'))
    79       $Output .= '<a href="'.$this->System->Link('/network/user_hosts/').'">Počítače</a><br />';
     79      $Output .= '<a href="'.$this->System->Link('/network/user-hosts/').'">Počítače</a><br />';
    8080    if($this->System->Modules['User']->CheckPermission('News', 'Insert'))
    8181      $Output .= '<a href="'.$this->System->Link('/aktuality/?action=add').'">Vložení aktuality</a><br />';
     
    8383      $Output .= '<a href="'.$this->System->Link('/jidelna/menuedit.php').'">Úprava jídelníčků</a><br />';
    8484    if($this->System->Modules['User']->CheckPermission('Finance', 'Manage'))
    85       $Output .= '<a href="'.$this->System->Link('/finance/manage.php').'">Správa financí</a><br />';
     85      $Output .= '<a href="'.$this->System->Link('/finance/sprava/').'">Správa financí</a><br />';
    8686    if($this->System->Modules['User']->CheckPermission('Network', 'Administration'))
    8787      $Output .= '<a href="'.$this->System->Link('/network/administration/').'">Správa sítě</a><br />';
Note: See TracChangeset for help on using the changeset viewer.