Changeset 553


Ignore:
Timestamp:
Jul 7, 2013, 11:38:22 PM (11 years ago)
Author:
chronos
Message:
  • Upraveno: Fronta pošty převedena na aplikační modul.
  • Opraveno: Nastavení dokladové řady při importu z Fio API.
Location:
trunk
Files:
1 added
1 deleted
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Common/Global.php

    r550 r553  
    5151include_once(dirname(__FILE__).'/../Modules/Stock/Stock.php');
    5252include_once(dirname(__FILE__).'/../Modules/Search/Search.php');
     53include_once(dirname(__FILE__).'/../Modules/EmailQueue/EmailQueue.php');
    5354
    5455function GlobalInit()
     
    9798  $System->ModuleManager->RegisterModule(new ModuleFile($System));
    9899  $System->ModuleManager->RegisterModule(new ModuleUser($System));
     100  $System->ModuleManager->RegisterModule(new ModuleEmailQueue($System));
    99101  $System->ModuleManager->RegisterModule(new ModuleMeteostation($System));
    100102  $System->ModuleManager->RegisterModule(new ModulePortal($System));
  • trunk/Common/System.php

    r548 r553  
    11<?php
    2 
    3 include_once(dirname(__FILE__).'/EmailQueue.php');
    42
    53class System
     
    1513  var $PathItems;
    1614  var $RootURLFolder;
    17   var $EmailQueue;
    1815
    1916  function __construct()
     
    2421    $this->Database = new Database();
    2522    $this->FormManager = new FormManager($this->Database);
    26     $this->EmailQueue = new EmailQueue($this);
    2723  } 
    2824 
  • trunk/Common/Version.php

    r552 r553  
    11<?php
    22
    3 $Revision = 552; // Subversion revision
     3$Revision = 553; // Subversion revision
    44$DatabaseRevision = 551; // SQL structure revision
    55$ReleaseTime = '2013-07-07';
  • trunk/FormClasses.php

    r548 r553  
    5858    ),
    5959  ),
    60   'EmailQueue' => array(
    61     'Title' => 'Fronta e-mailů',
    62     'Table' => 'EmailQueue',
    63     'Items' => array(
    64       'Time' => array('Type' => 'DateTime', 'Caption' => 'Vytvořeno'),
    65       'To' => array('Type' => 'String', 'Caption' => 'Příjemce', 'Default' => ''),
    66       'Subject' => array('Type' => 'String', 'Caption' => 'Předmět', 'Default' => ''),
    67       'Content' => array('Type' => 'Text', 'Caption' => 'Obsah', 'Default' => ''),
    68       'Headers' => array('Type' => 'String', 'Caption' => 'Hlavička', 'Default' => ''),
    69       'Archive' => array('Type' => 'Boolean', 'Caption' => 'Odesláno', 'Default' => '0'),
    70       'From' => array('Type' => 'String', 'Caption' => 'Odesílatel', 'Default' => ''),
    71       'AttachmentFile' => array('Type' => 'TFile', 'Caption' => 'Příloha', 'Default' => '', 'Null' => true),
    72     ),
    73     'Actions' => array(
    74       array('Caption' => 'Odeslat nové', 'URL' => ''),
    75     ),
    76   ),
    7760  'UserCustomerRel' => array(
    7861    'Title' => 'Vztahy uživatel - zákazník',
     
    190173    ),
    191174  ),
    192   'Email' => array(
    193     'Title' => 'Nový email',
    194     'Table' => 'EmailQueue',
    195     'SubmitText' => 'Odeslat',
    196     'Items' => array(
    197       'Address' => array('Type' => 'String', 'Caption' => 'Adresa', 'Default' => ''),
    198       'Subject' => array('Type' => 'String', 'Caption' => 'Předmět', 'Default' => ''),
    199       'Content' => array('Type' => 'Text', 'Caption' => 'Obsah', 'Default' => ''),
    200     ),
    201   ),
    202175  'ServiceCategory' => array(
    203176    'Title' => 'Kategorie služeb',
  • trunk/Modules/EmailQueue/EmailQueue.php

    r549 r553  
    11<?php
     2
     3class PageEmailQueueProcess extends Page
     4{
     5  var $FullTitle = 'Odeslání pošty z fronty';
     6  var $ShortTitle = 'Fronta pošty';
     7  var $ParentClass = 'PagePortal';
    28 
    3 class EmailQueue extends Module
    4 {   
     9  function Show()
     10  {
     11    $Output = $this->System->EmailQueue->Process();
     12    $Output = $this->SystemMessage('Zpracování fronty emailů', 'Nové emaily byly odeslány').$Output;
     13    return($Output);
     14  } 
     15}
     16 
     17class ModuleEmailQueue extends AppModule
     18{
     19  function __construct($System)
     20  {
     21    parent::__construct($System);
     22    $this->Name = 'EmailQueue';
     23    $this->Version = '1.0';
     24    $this->Creator = 'Chronos';
     25    $this->License = 'GNU/GPLv3';
     26    $this->Description = 'Queue for delayed email sending and history';
     27    $this->Dependencies = array('Log');
     28  }
     29
     30  function Install()
     31  {
     32    parent::Install();
     33  }
     34
     35  function UnInstall()
     36  {
     37    parent::UnInstall();
     38  }
     39
     40  function Start()
     41  {   
     42    parent::Start();
     43    $this->System->RegisterPage('fronta-posty', 'PageEmailQueueProcess');
     44    $this->System->FormManager->RegisterClass('Email', array(
     45        'Title' => 'Nový email',
     46        'Table' => 'EmailQueue',
     47        'SubmitText' => 'Odeslat',
     48        'Items' => array(
     49            'Address' => array('Type' => 'String', 'Caption' => 'Adresa', 'Default' => ''),
     50            'Subject' => array('Type' => 'String', 'Caption' => 'Předmět', 'Default' => ''),
     51            'Content' => array('Type' => 'Text', 'Caption' => 'Obsah', 'Default' => ''),
     52        ),
     53    ));
     54    $this->System->FormManager->RegisterClass('EmailQueue', array(
     55        'Title' => 'Fronta e-mailů',
     56        'Table' => 'EmailQueue',
     57        'Items' => array(
     58            'Time' => array('Type' => 'DateTime', 'Caption' => 'Vytvořeno'),
     59            'To' => array('Type' => 'String', 'Caption' => 'Příjemce', 'Default' => ''),
     60            'Subject' => array('Type' => 'String', 'Caption' => 'Předmět', 'Default' => ''),
     61            'Content' => array('Type' => 'Text', 'Caption' => 'Obsah', 'Default' => ''),
     62            'Headers' => array('Type' => 'String', 'Caption' => 'Hlavička', 'Default' => ''),
     63            'Archive' => array('Type' => 'Boolean', 'Caption' => 'Odesláno', 'Default' => '0'),
     64            'From' => array('Type' => 'String', 'Caption' => 'Odesílatel', 'Default' => ''),
     65            'AttachmentFile' => array('Type' => 'TFile', 'Caption' => 'Příloha', 'Default' => '', 'Null' => true),
     66        ),
     67        'Actions' => array(
     68            array('Caption' => 'Odeslat nové', 'URL' => '/fronta-posty/'),
     69        ),
     70    ));   
     71  }
     72
     73  function Stop()
     74  {
     75    parent::Stop();
     76  }
     77
    578  function AddItem($To, $Subject, $Content, $From, $AttachmentFileId = '')
    679  {
     
    32105      $Mail->Send();
    33106      $this->Database->update('EmailQueue', 'Id='.$DbRow['Id'], array('Archive' => 1));
    34       $this->ModuleManager->Modules['Log']->NewRecord('System', 'SendEmail', $DbRow['Id']);
     107      $this->System->ModuleManager->Modules['Log']->NewRecord('System', 'SendEmail', $DbRow['Id']);
    35108      $Output .= 'To: '.$DbRow['To'].'  Subject: '.$DbRow['Subject'].'<br />';
    36109    }   
     
    38111  }
    39112}
     113
  • trunk/Modules/Finance/Finance.php

    r551 r553  
    299299    $this->License = 'GNU/GPLv3';
    300300    $this->Description = 'Base module for finance management';
    301     $this->Dependencies = array('File');
     301    $this->Dependencies = array('File', 'EmailQueue');
    302302  } 
    303303
  • trunk/Modules/Finance/Manage.php

    r552 r553  
    359359       
    360360      $Content .= '<br />Tento email je generován automaticky. V případě zjištění nesrovnalostí napište zpět.';
    361       $this->System->EmailQueue->AddItem($User['Name'].' <'.$User['Email'].'>', $Title, $Content,
     361      $this->System->ModuleManager->Modules['EmailQueue']->AddItem($User['Name'].' <'.$User['Email'].'>', $Title, $Content,
    362362         $Config['Web']['Admin'].' <'.$Config['Web']['AdminEmail'].'>');
    363363      $Output = '';
  • trunk/Modules/FinanceBankAPI/FileImport.php

    r551 r553  
    4040          $DbResult3 = $this->Database->insert('FinanceOperation', array('Subject' => $DbRow2['Id'], 'Cash' => 0,
    4141            'Value' => $DbRow['Value'], 'Taxable' => 1, 'BankAccount' => $DbRow['BankAccount'], 'Network' => 1,
    42             'Time' => $DbRow['Time'], 'Text' => $DbRow['Description'], 'BillCode' => $BillCode));
     42            'Time' => $DbRow['Time'], 'Text' => $DbRow['Description'], 'BillCode' => $BillCode, 'DocumentLine' => $DocumentLine));
    4343          $this->Database->update('FinanceBankImport', 'Id='.$DbRow['Id'], array('FinanceOperation' => $this->Database->insert_id));
    4444        }
  • trunk/Modules/Portal/Portal.php

    r548 r553  
    8383    if($this->System->User->CheckPermission('Finance', 'Manage'))
    8484      $Output .= '<a href="'.$this->System->Link('/finance/sprava/').'">Správa financí</a><br />';
    85     if($this->System->User->CheckPermission('Network', 'Administration'))
    86       $Output .= '<a href="'.$this->System->Link('/network/administration/').'">Správa sítě</a><br />';
    8785    if($this->System->User->CheckPermission('IS', 'Manage'))
    8886      $Output .= '<a href="'.$this->System->Link('/is/').'">Správa dat</a><br />';
Note: See TracChangeset for help on using the changeset viewer.