Ignore:
Timestamp:
Apr 21, 2013, 10:23:56 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Tabulka HyperLink přejmenována na obecnější název Action. Odkazy na názvy ikony přepracovány na samostatnou tabulku.
  • Upraveno: Funkce týkající se fronty mailů odděleny do samostatného souboru.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/System.php

    r525 r526  
    11<?php
     2
     3include_once(dirname(__FILE__).'/EmailQueue.php');
    24
    35class System
     
    1315  var $PathItems;
    1416  var $RootURLFolder;
     17  var $EmailQueue;
    1518
    1619  function __construct()
     
    2124    $this->Database = new Database();
    2225    $this->FormManager = new FormManager($this->Database);
     26    $this->EmailQueue = new EmailQueue($this);
    2327  } 
    2428 
     
    7983  }
    8084 
    81   function AddEmailToQueue($To, $Subject, $Content, $From, $AttachmentFileId = '')
    82   {
    83     $Values = array('To' => $To,
    84       'Subject' => $Subject, 'Content' => $Content, 'Time' => 'NOW()',
    85       'From' => $From);
    86     if($AttachmentFileId != '') $Values['AttachmentFile'] = $AttachmentFileId;
    87     $this->Database->insert('EmailQueue', $Values);
    88   }
    89  
    90   function ProcessEmailQueue()
    91   {
    92     $Output = '';
    93     $DbResult = $this->Database->select('EmailQueue', '*', 'Archive=0');
    94     while($DbRow = $DbResult->fetch_assoc())
    95     {     
    96       $Mail = new Mail();
    97       $Mail->AddToCombined($DbRow['To']);
    98       $Mail->Subject = $DbRow['Subject'];
    99       $Mail->From = $DbRow['From'];
    100       $Mail->AddBody(strip_tags($DbRow['Content']), 'text/plain');
    101       $Mail->AddBody($DbRow['Content'], 'text/html');
    102       if($DbRow['AttachmentFile'] != '')
    103       {
    104         $DbResult2 = $this->Database->select('File', '*', 'Id='.$DbRow['AttachmentFile']);
    105         while($File = $DbResult2->fetch_assoc())
    106           $Mail->AttachFile($this->Config['Web']['FileRootFolder'].$File['DrivePath'], $File['MimeType']);
    107       }
    108       $Mail->Send();
    109       $this->Database->update('EmailQueue', 'Id='.$DbRow['Id'], array('Archive' => 1));
    110       $this->ModuleManager->Modules['Log']->NewRecord('System', 'SendEmail', $DbRow['Id']);
    111       $Output .= 'To: '.$DbRow['To'].'  Subject: '.$DbRow['Subject'].'<br />';
    112     }   
    113     return($Output);
    114   }
    115  
    11685  function HumanDate($Time)
    11786  {
Note: See TracChangeset for help on using the changeset viewer.