Ignore:
Timestamp:
Jan 23, 2012, 10:37:31 AM (13 years ago)
Author:
chronos
Message:
  • Přidáno: Kostra základního systémového modulu System.
  • Přidáno: Obsluha datových typů pro HTML kód a HTTP protokol.
  • Upraveno: Do ViewList zkopírování generování tabulky se stránkováním a řazením.
File:
1 edited

Legend:

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

    r378 r383  
    1515      if($HyperLink['IconFile'] == '') $HyperLink['IconFile'] = 'clear.png';
    1616        if(substr($HyperLink['URL'], 0, 4) != 'http') $HyperLink['URL'] = $this->System->Config['Web']['RootFolder'].$HyperLink['URL'];
    17         if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Models['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))       
     17        if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Modules['User']->Models['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))       
    1818        $Output .= '<img alt="'.$HyperLink['Name'].'" src="images/favicons/'.$HyperLink['IconFile'].'" width="16" height="16" /> <a href="'.$HyperLink['URL'].'">'.$HyperLink['Name'].'</a><br />';
    1919    }
     
    5454    //$Output .= 'Server běží: '.$this->GetServerUptime().' &nbsp;  &nbsp; ';
    5555
    56     if($this->System->Models['User']->CheckPermission('Finance', 'DisplaySubjectState'))
    57     {
    58       $DbResult = $this->Database->select('Subject', 'Money', 'Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$this->System->Models['User']->User['Id'].'))');
     56    if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'DisplaySubjectState'))
     57    {
     58      $DbResult = $this->Database->select('Subject', 'Money', 'Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$this->System->Modules['User']->Models['User']->User['Id'].'))');
    5959      if($DbResult->num_rows > 0)
    6060      {
     
    7171  {
    7272    $Output = '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Profil</a><br />';
    73     if($this->System->Models['User']->CheckPermission('Finance', 'MemberOptions'))
     73    if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'MemberOptions'))
    7474      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'?Action=MemberOptions">Domácnost</a><br />';
    75     if($this->System->Models['User']->CheckPermission('Finance', 'DisplaySubjectState'))
     75    if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'DisplaySubjectState'))
    7676      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/uzivatel/">Finance</a><br />';
    77     if($this->System->Models['User']->CheckPermission('Network', 'RegistredHostList'))
     77    if($this->System->Modules['User']->Models['User']->CheckPermission('Network', 'RegistredHostList'))
    7878      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/sit/registrovane-pocitace/">Počítače</a><br />';
    79     if($this->System->Models['User']->CheckPermission('News', 'Insert'))
     79    if($this->System->Modules['User']->Models['User']->CheckPermission('News', 'Insert'))
    8080      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/aktuality/?action=add">Vložení aktuality</a><br />';
    81     if($this->System->Models['User']->CheckPermission('EatingPlace', 'Edit'))
     81    if($this->System->Modules['User']->Models['User']->CheckPermission('EatingPlace', 'Edit'))
    8282      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/jidelna/edit/">Editace jídelníčků</a><br />';
    83     if($this->System->Models['User']->CheckPermission('Finance', 'Manage'))
     83    if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'Manage'))
    8484      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/sprava/">Správa financí</a><br />';
    85     if($this->System->Models['User']->CheckPermission('Network', 'Administration'))
     85    if($this->System->Modules['User']->Models['User']->CheckPermission('Network', 'Administration'))
    8686      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/sit/sprava/">Správa sítě</a><br />';
    8787    return($Output);
     
    149149        $Form = new UserLoginView($this->Database);
    150150        $Form->OnSubmit = '?Action=Login';
    151         $Result = $this->System->Models['User']->Login($_POST['Username'], $_POST['Password']);
     151        $Result = $this->System->Modules['User']->Models['User']->Login($_POST['Username'], $_POST['Password']);
    152152        $Output .= $this->SystemMessage('Přihlášení', $Result);
    153153        if($Result <> USER_LOGGED_IN)
     
    162162      if($_GET['Action'] == 'Logout')
    163163      {
    164         $Output .= $this->SystemMessage('Odhlášení', $this->System->Models['User']->Logout());
     164        $Output .= $this->SystemMessage('Odhlášení', $this->System->Modules['User']->Models['User']->Logout());
    165165      } else
    166166      if($_GET['Action'] == 'UserOptions')
    167167      {
    168168        $UserOptions = new UserOptionsView($this->Database);
    169         $UserOptions->LoadValuesFromDatabase($this->System->Models['User']->User['Id']);
     169        $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->Models['User']->User['Id']);
    170170        $UserOptions->OnSubmit = '?Action=UserOptionsSave';
    171171        $Output .= $UserOptions->ShowEditForm();
     
    175175        $UserOptions = new UserOptionsView($this->Dstabase, array());
    176176        $UserOptions->LoadValuesFromForm();
    177         $UserOptions->SaveValuesToDatabase($this->System->Models['User']->User['Id']);
     177        $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->Models['User']->User['Id']);
    178178        $Output .= $this->SystemMessage('Nastavení', 'Nastavení uloženo.');
    179179        $this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']);
    180         $UserOptions->LoadValuesFromDatabase($this->System->Models['User']->User['Id']);
     180        $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->Models['User']->User['Id']);
    181181        $UserOptions->OnSubmit = '?Action=UserOptionsSave';
    182182        $Output .= $UserOptions->ShowEditForm();
     
    191191      if($_GET['Action'] == 'UserRegisterConfirm')
    192192      {
    193         $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Models['User']->RegisterConfirm($_GET['User'], $_GET['H']));
     193        $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->Models['User']->RegisterConfirm($_GET['User'], $_GET['H']));
    194194      } else
    195195      if($_GET['Action'] == 'PasswordRecovery')
     
    203203        $Form = new PasswordRecoveryView($this->Database);
    204204        $Form->LoadValuesFromForm();
    205         $Result = $this->System->Models['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
     205        $Result = $this->System->Modules['User']->Models['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
    206206        $Output .= $this->SystemMessage('Obnova hesla', $Result);
    207207        if($Result <> USER_PASSWORD_RECOVERY_SUCCESS)
     
    212212      if($_GET['Action'] == 'PasswordRecoveryConfirm')
    213213      {
    214         $Output .= $this->SystemMessage('Obnova hesla', $this->System->Models['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));
     214        $Output .= $this->SystemMessage('Obnova hesla', $this->System->Modules['User']->Models['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));
    215215      } else
    216216      if($_GET['Action'] == 'UserRegisterSave')
     
    218218        $Form = new UserRegisterView($this->Database, array());
    219219        $Form->LoadValuesFromForm();
    220         $Result = $this->System->Models['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']);
     220        $Result = $this->System->Modules['User']->Models['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']);
    221221        $Output .= $this->SystemMessage('Registrace nového účtu', $Result);
    222222        if($Result <> USER_REGISTRATED)
     
    229229      {
    230230        $UserOptions = new MemberOptionsView($this->Database);
    231         $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Models['User']->User['Member']);
     231        $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Modules['User']->Models['User']->User['Member']);
    232232        $DbRow = $DbResult->fetch_array();
    233233        foreach($UserOptions->Items as $Index => $Item)
     
    247247          $UserOptions->Values['BillingPeriodNext'] = 2;
    248248         
    249         $DbResult = $this->Database->update('Member', 'Id='.$this->System->Models['User']->User['Member'], array('InternetTariffNextMonth' => $UserOptions->Values['InternetTariffNextMonth'], 'FamilyMemberCount' => $UserOptions->Values['FamilyMemberCount'], 'BillingPeriodNext' => $UserOptions->Values['BillingPeriodNext']));
    250         $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->Models['User']->User['Member']);
     249        $DbResult = $this->Database->update('Member', 'Id='.$this->System->Modules['User']->Models['User']->User['Member'], array('InternetTariffNextMonth' => $UserOptions->Values['InternetTariffNextMonth'], 'FamilyMemberCount' => $UserOptions->Values['FamilyMemberCount'], 'BillingPeriodNext' => $UserOptions->Values['BillingPeriodNext']));
     250        $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->Modules['User']->Models['User']->User['Member']);
    251251        $Member = $DbResult->fetch_assoc();
    252252        $DbResult = $this->Database->update('Subject', 'Id='.$Member['Subject'], array('Name' => $UserOptions->Values['Name'], 'AddressStreet' => $UserOptions->Values['AddressStreet'], 'AddressTown' => $UserOptions->Values['AddressTown'], 'AddressPSC' => $UserOptions->Values['AddressPSC'], 'IC' => $UserOptions->Values['IC'], 'DIC' => $UserOptions->Values['DIC']));
    253253        $Output .= $this->SystemMessage('Nastavení', 'Nastavení domácnosti uloženo.');
    254254        $this->System->Modules['Log']->NewRecord('Member+Subject', 'Nastavení člena/subjektu změněno', $UserOptions->Values['Name']);
    255         $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Models['User']->User['Member']);
     255        $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Modules['User']->Models['User']->User['Member']);
    256256        $DbRow = $DbResult->fetch_array();
    257257        foreach($UserOptions->Items as $Index => $Item)
     
    288288        else if($Panel['Module'] == 'UserOptions')
    289289        {
    290           if($this->System->Models['User']->User['Id'] != $this->System->Models['User']->AnonymousUserId)
     290          if($this->System->Modules['User']->Models['User']->User['Id'] != $this->System->Modules['User']->Models['User']->AnonymousUserId)
    291291            $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel());
    292292        } else
Note: See TracChangeset for help on using the changeset viewer.