Changeset 737


Ignore:
Timestamp:
Apr 14, 2015, 10:16:16 PM (10 years ago)
Author:
chronos
Message:
  • Added: Experimental models internal database structure regeneration.
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/System.php

    r730 r737  
    179179    if($this->Setup->CheckState())
    180180    {
    181       $this->ModuleManager->Start();   
    182     }
    183   }
    184  
     181      $this->ModuleManager->Start();
     182    }
     183  }
     184
    185185  function Run()
    186186  {
     
    196196  {
    197197        global $argv;
    198        
     198
    199199        $this->RunCommon();
    200         if(count($argv) > 1) 
     200        if(count($argv) > 1)
    201201        {
    202202      if(array_key_exists($argv[1], $this->CommandLine))
     
    206206              {
    207207                $Class = new $Command['Callback'][0]($this);
    208                 $Output = $Class->$Command['Callback'][1]();           
     208                $Output = $Class->$Command['Callback'][1]();
    209209              } else $Output = call_user_func($Command['Callback']);
    210210              echo($Output);
    211       } else echo('Command "'.$argv[1].'" not supported.'."\n");       
     211      } else echo('Command "'.$argv[1].'" not supported.'."\n");
    212212        } else echo('No command was given as parameter'."\n");
    213213  }
    214  
     214
    215215  function RegisterCommandLine($Name, $Callback)
    216216  {
    217217        $this->CommandLine[$Name] = array('Name' => $Name, 'Callback' => $Callback);
    218218  }
    219  
     219
    220220  function RegisterPageBar($Name)
    221221  {
  • trunk/Common/Form/Form.php

    r719 r737  
    4949    ($this->FormManager->FormTypes[$Item['Type']]['Type'] != 'ManyToOne')))
    5050    {
    51       if(!array_key_exists($Index, $this->Values) and isset($Item['Default'])) 
     51      if(!array_key_exists($Index, $this->Values) and isset($Item['Default']))
    5252        $this->Values[$Index] = $Item['Default'];
    5353    }
     
    8585    );
    8686    foreach($this->Definition['Items'] as $Index => $Item)
    87     if(!array_key_exists('Hidden', $Item) or ($Item['Hidden'] == false)) 
     87    if(!array_key_exists('Hidden', $Item) or ($Item['Hidden'] == false))
    8888    if(!array_key_exists($Item['Type'], $this->FormManager->FormTypes) or
    8989    (array_key_exists($Item['Type'], $this->FormManager->FormTypes) and
     
    302302          $Parameters);
    303303    }
    304     } else 
     304    } else
    305305    {
    306306      if(isset($Item['Default'])) {
     
    418418    unset($this->FormTypes[$Name]);
    419419  }
     420
     421  function UpdateSQLMeta()
     422  {
     423    $this->Database->query('DELETE FROM ModelField');
     424    $this->Database->query('DELETE FROM Model');
     425    $this->Database->query('DELETE FROM DataType WHERE Parent IS NOT NULL');
     426    $this->Database->query('DELETE FROM DataType');
     427
     428    foreach($this->Type->TypeDefinitionList as $Name => $Type)
     429    {
     430      $DbResult = $this->Database->select('DataType', 'Id', 'Name="'.$Name.'"');
     431      if($DbResult->num_rows == 0)
     432      {
     433        $this->Database->insert('DataType', array('Name' => $Name,
     434          'Title' => $Type['Class']));
     435      } else
     436      {
     437        $DbRow = $DbResult->fetch_assoc();
     438        $this->Database->update('DataType', 'Id='.$DbRow['Id'], array('Name' => $Name,
     439          'Title' => $Type['Class']));
     440      }
     441    }
     442
     443    foreach($this->Classes as $Class)
     444    if(!array_key_exists('SQL', $Class) and ($Class['Table'] != ''))
     445    {
     446      $DbResult = $this->Database->query('SELECT * FROM information_schema.tables  WHERE table_schema = "centrala_big"
     447          AND table_name = "'.$Class['Table'].'" LIMIT 1');
     448      if($DbResult->num_rows == 0) continue;
     449
     450      echo($Class['Table'].'<br>');
     451      $Module = 1;
     452      $DbResult = $this->Database->select('Model', 'Id', 'Name="'.$Class['Table'].'"');
     453      if($DbResult->num_rows == 0)
     454      {
     455        $this->Database->insert('Model', array('Name' => $Class['Table'], 'Title' => $Class['Title'], 'Module' => $Module));
     456        $Model = $this->Database->insert_id;
     457      } else
     458      {
     459        $DbRow = $DbResult->fetch_assoc();
     460        $Model = $DbRow['Id'];
     461        $this->Database->update('Model', 'Id='.$DbRow['Id'], array('Name' => $Class['Table'],
     462          'Title' => $Class['Title'], 'Module' => $Module));
     463      }
     464
     465      foreach($Class['Items'] as $Name => $Field)
     466      {
     467        echo($Name.', ');
     468        $DbResult = $this->Database->select('DataType', 'Id', 'Name="'.$Field['Type'].'"');
     469        if($DbResult->num_rows > 0)
     470        {
     471          $DbRow = $DbResult->fetch_assoc();
     472          $Type = $DbRow['Id'];
     473        } else {
     474          $Type = $this->FormTypes[$Field['Type']];
     475
     476          // Search parent type
     477          $DbResult = $this->Database->select('DataType', 'Id', 'Name="'.$Type['Type'].'"');
     478          if($DbResult->num_rows > 0)
     479          {
     480            $DbRow = $DbResult->fetch_assoc();
     481            $ParentType = $DbRow['Id'];
     482          } else $ParentType = null;
     483
     484          $this->Database->insert('DataType', array('Name' => $Field['Type'],
     485            'Title' => '', 'Parent' => $ParentType));
     486          $Type = $this->Database->insert_id;
     487        }
     488
     489        $DbResult = $this->Database->select('ModelField', 'Id', '(Name="'.$Name.'") AND (Model='.$Model.')');
     490        if($DbResult->num_rows == 0)
     491        {
     492          $this->Database->insert('ModelField', array('Name' => $Name,
     493            'Title' => $Field['Caption'], 'Model' => $Model, 'Type' => $Type));
     494        } else
     495        {
     496          $DbRow = $DbResult->fetch_assoc();
     497          $this->Database->update('ModelField', 'Id='.$DbRow['Id'], array('Name' => $Name,
     498            'Title' => $Field['Caption'], 'Model' => $Model, 'Type' => $Type));
     499        }
     500      }
     501      echo('<br>');
     502    }
     503  }
    420504}
  • trunk/Common/Form/Types/Type.php

    r659 r737  
    6060      'Image' => array('Name' => 'Image', 'Class' => 'Image', 'ParentType' => '', 'Parameters' => array()),
    6161      'TimeDiff' => array('Name' => 'TimeDiff', 'Class' => 'TimeDiff', 'ParentType' => 'Integer', 'Parameters' => array()),
     62      'Reference' => array('Name' => 'Reference', 'Class' => 'Reference', 'ParentType' => 'Integer', 'Parameters' => array()),
     63      'ManyToOne' => array('Name' => 'ManyToOne', 'Class' => 'ManyToOne', 'ParentType' => '', 'Parameters' => array()),
    6264    );
    6365  }
  • trunk/Common/Setup/Setup.php

    r731 r737  
    1515  var $Updates;
    1616  var $ConfigDir;
    17  
     17
    1818  function __construct($System)
    1919  {
     
    2424    $this->ConfigDir = dirname(__FILE__).'/../..';
    2525  }
    26  
     26
    2727  function LoginPanel()
    2828  {
     
    3636    return($Output);
    3737  }
    38  
     38
    3939  function ControlPanel()
    4040  {
    4141    global $YesNo;
    4242    $Output = '';
    43  
     43
    4444    $Output .= 'Je připojení k databázi: '.$YesNo[$this->UpdateManager->Database->Connected()].'<br/>';
    4545    if($this->UpdateManager->Database->Connected())
     
    5858        $Output .= '<a href="?action=uninstall">Odinstalovat</a> ';
    5959        $Output .= '<a href="?action=modules">Správa modulů</a> ';
     60        $Output .= '<a href="?action=models">Přegenerovat modely</a> ';
    6061      } else $Output .= '<a href="?action=install">Instalovat</a> ';
    6162    }
     
    6566    return($Output);
    6667  }
    67  
     68
    6869  function Show()
    6970  {
    7071          global $ConfigDefinition, $DatabaseRevision, $Config, $Updates;
    71          
     72
    7273          $this->UpdateManager = $this->System->Setup->UpdateManager;
    7374          $DefaultConfig = new DefaultConfig();
    7475          $this->ConfigDefinition = $DefaultConfig->Get();
    7576          $this->DatabaseRevision = $DatabaseRevision;
    76           $this->Config = &$Config; 
     77          $this->Config = &$Config;
    7778
    7879          $Output = '';
     
    8586        $Output .= $this->LoginPanel();
    8687      } else
    87       { 
     88      {
    8889        if(array_key_exists('action', $_GET)) $Action = $_GET['action'];
    8990          else $Action = '';
     
    9495          $Output .= $this->LoginPanel();
    9596        } else
     97        if($Action == 'models')
     98        {
     99          $this->System->FormManager->UpdateSQLMeta();
     100        } else
    96101        if($Action == 'upgrade')
    97102        {
    98103          $Output .= '<h3>Povýšení</h3>';
    99           try {   
     104          try {
    100105            $Output .= $this->System->Setup->Upgrade();
    101106          } catch (Exception $E) {
     
    134139        if($Action == 'modules')
    135140        {
    136           $Output .= $this->ShowModules(); 
     141          $Output .= $this->ShowModules();
    137142        } else
    138143        if($Action == 'configure_save')
     
    161166    return($Output);
    162167  }
    163  
     168
    164169  function ShowModules()
    165170  {
     
    201206    return($Output);
    202207  }
    203  
     208
    204209  function ShowList()
    205210  {
    206211    global $YesNo;
    207    
     212
    208213    $Output = '';
    209    
     214
    210215    $Pageing = new Paging();
    211216    $Pageing->TotalCount = count($this->System->ModuleManager->Modules);
     
    227232       else $Dependencies = '&nbsp;';
    228233      $Actions = '';
    229       if($Module->Installed == true) 
     234      if($Module->Installed == true)
    230235      {
    231236        $Actions .= ' <a href="?action=modules&amp;op=uninstall&amp;name='.$Module->Name.'">Odinstalovat</a>';
     
    234239        if($Module->InstalledVersion != $Module->Version) $Actions .= ' <a href="?action=modules&amp;op=upgrade&amp;name='.$Module->Name.'">Povýšit</a>';
    235240      } else $Actions .= ' <a href="?action=modules&amp;op=install&amp;name='.$Module->Name.'">Instalovat</a>';
    236    
     241
    237242      $Table->Table->Cells[] = array($Module->Name,
    238         $Module->Creator, $Module->Version, 
     243        $Module->Creator, $Module->Version,
    239244        $Module->License, $YesNo[$Module->Installed],
    240245        $YesNo[$Module->Enabled], $Module->Description,
    241246        $Dependencies, $Actions);
    242247    }
    243     $Output .= $Pageing->Show(); 
     248    $Output .= $Pageing->Show();
    244249    $Output .= $Table->Show();
    245     $Output .= $Pageing->Show();   
     250    $Output .= $Pageing->Show();
    246251    //$Output .= '<p><a href="?A=SaveToDb">Uložit do databáze</a></p>';
    247252    return($Output);
    248253  }
    249  
     254
    250255  function PrepareConfig($Config)
    251256  {
     
    283288    return($Output);
    284289  }
    285  
     290
    286291  function ConfigSave($DefaultConfig)
    287292  {
     
    319324    return($Output);
    320325  }
    321  
     326
    322327  function CreateConfig($Config)
    323328  {
    324329    $Output = "<?php\n\n".
    325330        "\$IsDeveloper = in_array(\$_SERVER['REMOTE_ADDR'], array('127.0.0.1'));\n\n";
    326  
     331
    327332    foreach($this->ConfigDefinition as $Def)
    328333    {
     
    353358          if(!$this->Database->Connected()) $Output .= 'Nelze se připojit k databázi.<br>';
    354359          else {
    355             if(!$this->System->Setup->UpdateManager->IsInstalled()) 
     360            if(!$this->System->Setup->UpdateManager->IsInstalled())
    356361              $Output .= 'Systém vyžaduje instalaci databáze.<br>';
    357362            else
    358             if(!$this->System->Setup->UpdateManager->IsUpToDate()) 
     363            if(!$this->System->Setup->UpdateManager->IsUpToDate())
    359364              $Output .= 'Systém vyžaduje aktualizaci databáze.<br>';
    360365          }
     
    367372{
    368373  var $UpdateManager;
    369  
     374
    370375  function Start()
    371376  {
    372377    global $DatabaseRevision;
    373    
     378
    374379    $this->System->RegisterPage('', 'PageSetupRedirect');
    375380    $this->System->RegisterPage('setup', 'PageSetup');
     
    382387    $this->UpdateManager->Trace = $Updates->Get();
    383388    $this->UpdateManager->InstallMethod = 'FullInstall';
    384   } 
    385  
     389  }
     390
    386391  function Stop()
    387392  {
     
    390395    $this->System->UnregisterPage('setup');
    391396  }
    392  
     397
    393398  function CheckState()
    394399  {
     
    396401      $this->UpdateManager->IsUpToDate());
    397402  }
    398  
     403
    399404  function Install()
    400405  {
    401406        global $DatabaseRevision;
    402        
     407
    403408    $this->Database->query('CREATE TABLE IF NOT EXISTS `SystemVersion` (
    404409  `Id` int(11) NOT NULL AUTO_INCREMENT,
     
    415420) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;");
    416421  }
    417  
     422
    418423  function Uninstall()
    419424  {
     
    422427    $this->Database->query('DROP TABLE `SystemVersion`');
    423428  }
    424  
     429
    425430  function IsInstalled()
    426431  {
     
    428433    return($DbResult->num_rows > 0);
    429434  }
    430  
     435
    431436  function Upgrade()
    432437  {
  • trunk/Modules/File/File.php

    r721 r737  
    149149      'Name' => 'Name',
    150150      'Filter' => '1',
    151     ));       
     151    ));
    152152    $this->System->FormManager->RegisterFormType('TFile', array(
    153153                'Type' => 'Reference',
  • trunk/Modules/Finance/Finance.php

    r729 r737  
    222222      'BeforeInsert' => array($this, 'BeforeInsertFinanceOperation'),
    223223    ));
    224    
     224
    225225    $this->System->FormManager->RegisterClass('FinanceTreasuryIn', $this->System->FormManager->Classes['FinanceOperation']);
    226226    $this->System->FormManager->Classes['FinanceTreasuryIn']['Title'] = 'Pokladní příjmy';
     
    232232    $this->System->FormManager->Classes['FinanceTreasuryIn']['Items']['DocumentLine']['Filter'] = true;
    233233    $this->System->FormManager->Classes['FinanceTreasuryIn']['Items']['BankAccount']['Hidden'] = true;
    234        
     234
    235235    $this->System->FormManager->RegisterClass('FinanceTreasuryOut', $this->System->FormManager->Classes['FinanceOperation']);
    236236    $this->System->FormManager->Classes['FinanceTreasuryOut']['Title'] = 'Pokladní výdeje';
     
    242242    $this->System->FormManager->Classes['FinanceTreasuryOut']['Items']['DocumentLine']['Filter'] = true;
    243243    $this->System->FormManager->Classes['FinanceTreasuryOut']['Items']['BankAccount']['Hidden'] = true;
    244    
     244
    245245    $this->System->FormManager->RegisterClass('FinanceAccountIn', $this->System->FormManager->Classes['FinanceOperation']);
    246246    $this->System->FormManager->Classes['FinanceAccountIn']['Title'] = 'Příjmy na účet';
     
    252252    $this->System->FormManager->Classes['FinanceAccountIn']['Items']['DocumentLine']['Filter'] = true;
    253253    $this->System->FormManager->Classes['FinanceAccountIn']['Items']['Treasury']['Hidden'] = true;
    254    
    255    
     254
     255
    256256    $this->System->FormManager->RegisterClass('FinanceAccountOut', $this->System->FormManager->Classes['FinanceOperation']);
    257257    $this->System->FormManager->Classes['FinanceAccountOut']['Title'] = 'Výdeje z účtu';
     
    263263    $this->System->FormManager->Classes['FinanceAccountOut']['Items']['DocumentLine']['Filter'] = true;
    264264    $this->System->FormManager->Classes['FinanceAccountOut']['Items']['Treasury']['Hidden'] = true;
    265    
     265
    266266    $this->System->FormManager->RegisterFormType('TFinanceOperationDirection', array(
    267267      'Type' => 'Enumeration',
     
    303303    $this->System->FormManager->Classes['FinanceInvoiceIn']['Items']['DocumentLine']['Hidden'] = true;
    304304    $this->System->FormManager->Classes['FinanceInvoiceIn']['Items']['DocumentLine']['Filter'] = true;
    305        
     305
    306306    $this->System->FormManager->RegisterClass('FinanceInvoiceOut', $this->System->FormManager->Classes['FinanceInvoice']);
    307307    $this->System->FormManager->Classes['FinanceInvoiceOut']['Title'] = 'Vydané faktury';
     
    317317                'States' => array(-1 => 'Příjem', 1 => 'Výdej'),
    318318    ));
    319    
     319
    320320    $this->System->FormManager->RegisterClass('Company', array(
    321321      'Title' => 'Firma',
     
    333333        'Description' => array('Type' => 'String', 'Caption' => 'Popis', 'Default' => 'Položka'),
    334334        'Price' => array('Type' => 'Float', 'Caption' => 'Částka', 'Default' => '0', 'Suffix' => 'Kč'),
    335         'Quantity' => array('Type' => 'Integer', 'Caption' => 'Množství', 'Default' => '1'),
     335        'Quantity' => array('Type' => 'Float', 'Caption' => 'Množství', 'Default' => '1'),
    336336        'VAT' => array('Type' => 'Integer', 'Caption' => 'Daň', 'Default' => '21', 'Suffix' => '%'),
    337337        'Total' => array('Type' => 'Integer', 'Caption' => 'Celkem', 'Default' => '', 'Suffix' => 'Kč',
     
    393393        'Name' => 'Comment',
    394394        'Filter' => '1',
    395     ));   
     395    ));
    396396    $this->System->FormManager->RegisterClass('FinanceBank', array(
    397397      'Title' => 'Banky',
     
    495495        '(SELECT `FinanceBank`.`Code` FROM `FinanceBank` WHERE `FinanceBank`.`Id`=`FinanceBankAccount`.`Bank`), ")")',
    496496        'Filter' => '1',
    497     ));   
     497    ));
    498498
    499499    $this->System->AddModule(new Bill($this->System));
  • trunk/Modules/Portal/Portal.php

    r686 r737  
    1414    $this->Description = 'Community portal.';
    1515    $this->Dependencies = array('News');
    16   } 
     16  }
    1717
    1818  function DoInstall()
    1919  {
    2020  }
    21  
     21
    2222  function DoUninstall()
    23   {     
    24   }
    25  
     23  {
     24  }
     25
    2626  function DoStart()
    2727  {
     
    2929    $this->System->FormManager->RegisterClass('MemberOptions', array(
    3030      'Title' => 'Nastavení domácnosti',
    31       'Table' => '(SELECT Member.Id, Member.FamilyMemberCount, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject)',
     31      'SQL' => '(SELECT Member.Id, Member.FamilyMemberCount, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject)',
     32      'Table' => 'MemberOptions',
    3233      'Items' => array(
    3334        'Name' => array('Type' => 'String', 'Caption' => 'Fakturační jméno', 'Default' => ''),
     
    4344    ));
    4445    $this->System->ModuleManager->Modules['User']->UserPanel[] = array('PagePortal', 'UserPanel');
    45   } 
    46  
     46  }
     47
    4748  function DoStop()
    48   { 
    49   } 
     49  {
     50  }
    5051}
    5152
     
    5455  var $FullTitle = 'Zděchovský rozcestník';
    5556  var $ShortTitle = 'Rozcestník';
    56  
     57
    5758  function ShowActions($ActionGroup)
    5859  {
    59     $Output = '';   
    60     $DbResult = $this->Database->query('SELECT `Id` FROM `Action` '.     
     60    $Output = '';
     61    $DbResult = $this->Database->query('SELECT `Id` FROM `Action` '.
    6162      'WHERE (`Action`.`Group`='.$ActionGroup['Id'].') AND (`Action`.`Enable` = 1)');
    6263    while($Action = $DbResult->fetch_assoc())
     
    7677
    7778    $DbResult = $this->Database->query('SELECT COUNT(*) FROM NetworkDevice LEFT JOIN NetworkDeviceType ON NetworkDeviceType.Id = NetworkDevice.Type WHERE (NetworkDeviceType.ShowOnline = 1) AND (NetworkDevice.Online = 1)');
    78     $DbRow = $DbResult->fetch_array();   
     79    $DbRow = $DbResult->fetch_array();
    7980    $OnlineComputers = $DbRow[0];
    8081
     
    115116  {
    116117    $Output = '<a href="'.$this->System->Link('/user/?Action=UserOptions').'">Profil</a><br />';
    117     if($this->System->User->CheckPermission('Finance', 'MemberOptions')) 
     118    if($this->System->User->CheckPermission('Finance', 'MemberOptions'))
    118119      $Output .= '<a href="'.$this->System->Link('/?Action=MemberOptions').'">Domácnost</a><br />';
    119     if($this->System->User->CheckPermission('Finance', 'DisplaySubjectState')) 
     120    if($this->System->User->CheckPermission('Finance', 'DisplaySubjectState'))
    120121      $Output .= '<a href="'.$this->System->Link('/finance/platby/').'">Finance</a><br />';
    121     if($this->System->User->CheckPermission('Network', 'RegistredHostList')) 
     122    if($this->System->User->CheckPermission('Network', 'RegistredHostList'))
    122123      $Output .= '<a href="'.$this->System->Link('/network/user-hosts/').'">Počítače</a><br />';
    123     if($this->System->User->CheckPermission('News', 'Insert')) 
     124    if($this->System->User->CheckPermission('News', 'Insert'))
    124125      $Output .= '<a href="'.$this->System->Link('/aktuality/?action=add').'">Vložení aktuality</a><br />';
    125126    if($this->System->User->CheckPermission('EatingPlace', 'Edit'))
     
    143144    return($Output);
    144145  }
    145  
     146
    146147  function OnlineHostList()
    147148  {
     
    167168    return($Output);
    168169  }
    169    
     170
    170171  function Panel($Title, $Content, $Menu = array())
    171172  {
    172     if(count($Menu) > 0) 
     173    if(count($Menu) > 0)
    173174      foreach($Menu as $Item)
    174175        $Title .= '<div class="Action">'.$Item.'</div>';
     
    197198            'Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, '.
    198199            'Subject.AddressTown, Subject.AddressPSC, Subject.AddressCountry, Subject.IC, Subject.DIC FROM Member JOIN Subject '.
    199            'ON Subject.Id = Member.Subject WHERE Member.Id='.$CustomerUserRel['Customer']);       
     200           'ON Subject.Id = Member.Subject WHERE Member.Id='.$CustomerUserRel['Customer']);
    200201          $DbRow = $DbResult->fetch_array();
    201202          foreach($Form->Definition['Items'] as $Index => $Item)
     
    216217        if($Form->Values['BillingPeriodNext'] < 2)
    217218          $Form->Values['BillingPeriodNext'] = 2;
    218          
    219         $DbResult = $this->Database->update('Member', 'Id='.$this->System->User->User['Member'], 
    220            array('FamilyMemberCount' => $Form->Values['FamilyMemberCount'], 
     219
     220        $DbResult = $this->Database->update('Member', 'Id='.$this->System->User->User['Member'],
     221           array('FamilyMemberCount' => $Form->Values['FamilyMemberCount'],
    221222           'BillingPeriodNext' => $Form->Values['BillingPeriodNext']));
    222223        $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->User->User['Member']);
    223224        $Member = $DbResult->fetch_assoc();
    224         $DbResult = $this->Database->update('Subject', 'Id='.$Member['Subject'], 
    225           array('Name' => $Form->Values['Name'], 'AddressStreet' => $Form->Values['AddressStreet'], 
     225        $DbResult = $this->Database->update('Subject', 'Id='.$Member['Subject'],
     226          array('Name' => $Form->Values['Name'], 'AddressStreet' => $Form->Values['AddressStreet'],
    226227          'AddressTown' => $Form->Values['AddressTown'], 'AddressCountry' => $Form->Values['AddressCountry'],
    227           'AddressPSC' => $Form->Values['AddressPSC'], 'IC' => $Form->Values['IC'], 
     228          'AddressPSC' => $Form->Values['AddressPSC'], 'IC' => $Form->Values['IC'],
    228229          'DIC' => $Form->Values['DIC']));
    229230        $Output .= $this->SystemMessage('Nastavení', 'Nastavení domácnosti uloženo.');
    230         $this->System->ModuleManager->Modules['Log']->NewRecord('Member+Subject', 'Nastavení člena/subjektu změněno', 
     231        $this->System->ModuleManager->Modules['Log']->NewRecord('Member+Subject', 'Nastavení člena/subjektu změněno',
    231232          $Form->Values['Name']);
    232233        $DbResult = $this->Database->query('SELECT Member.Id, Member.FamilyMemberCount, Member.BillingPeriodNext, '.
     
    241242        $Form->OnSubmit = '?Action=MemberOptionsSave';
    242243        $Output .= $Form->ShowEditForm();
    243       } 
     244      }
    244245    } else $Output = $this->ShowMain();
    245246    return($Output);
    246247  }
    247    
     248
    248249  function ShowMain()
    249250  {
     
    260261    while($PanelColumn =  $DbResult->fetch_assoc())
    261262    {
    262       if($PanelColumn != '') $Width = ' width="'.$PanelColumn['Width'].'"'; 
     263      if($PanelColumn != '') $Width = ' width="'.$PanelColumn['Width'].'"';
    263264        else $Width = '';
    264265      $Output .= '<td valign="top"'.$Width.'>';
     
    268269        if($Panel['Module'] == 'ActionGroup') $Output .= $this->ShowActions($ActionGroups[$Panel['Parameters']]);
    269270        else if($Panel['Module'] == 'OnlineHostList') $Output .= $this->Panel('Online počítače', $this->OnlineHostList());
    270         else if($Panel['Module'] == 'UserOptions') 
     271        else if($Panel['Module'] == 'UserOptions')
    271272        {
    272273          //if($this->System->User->User['Id'] != null) $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel());
     
    274275        if($Panel['Module'] == 'Webcam') $Output .= $this->Panel('Kamery', $this->WebcamPanel());
    275276        if($Panel['Module'] == 'Meteo') $Output .= $this->Panel('Meteostanice', $this->MeteoPanel());
    276         else if($Panel['Module'] == 'NewsGroupList') 
     277        else if($Panel['Module'] == 'NewsGroupList')
    277278          $Output .= $this->Panel('Aktuality', $this->System->ModuleManager->Modules['News']->Show(), array('<a href="?Action=CustomizeNews">Upravit</a>'));
    278279      }
    279280      $Output .= '</td>';
    280     } 
     281    }
    281282    $Output .= '</tr></table>';
    282283    return($Output);
    283   } 
     284  }
    284285}
  • trunk/ToDo.txt

    r607 r737  
    44- Map: Aktualizovat na google maps api v3
    55- Meteostation: Čtení dat z meteostanice
    6 - Finance: umožnit uzavření účetního roku
    76- Finance: generovat doklady do podsložek dle roků
    87- Automatické blokování internetu při vyčerpání kreditu
    98- ServiceVPS: Modul pro správu VPS hostingu
    10 - Meals: Osamostatnit web jídelny
    119- Mail: Funkce pro rozesílání hromadných emailů
    1210- Podpora pro inventůru
  • trunk/temp/meteo/load_meteo.php

    r733 r737  
    130130    foreach($Collect as $Index => $Item)
    131131    {
    132       sort($Collect[$Index]);   
     132      sort($Collect[$Index]);
    133133    }
    134134    file_get_contents($URL.'?MeasureId=28&Value='.median($Collect['Temperature']));
Note: See TracChangeset for help on using the changeset viewer.