Пример #1
0
 /**
  * Save the email in the article email log.
  * @param $request object
  */
 function log($request = null)
 {
     $articleEmailLogDao =& DAORegistry::getDAO('ArticleEmailLogDAO');
     $entry = $articleEmailLogDao->newDataObject();
     $article =& $this->article;
     // Log data
     $entry->setEventType($this->eventType);
     $entry->setSubject($this->getSubject());
     $entry->setBody($this->getBody());
     $entry->setFrom($this->getFromString(false));
     $entry->setRecipients($this->getRecipientString());
     $entry->setCcs($this->getCcString());
     $entry->setBccs($this->getBccString());
     // Add log entry
     import('classes.article.log.ArticleLog');
     $logEntryId = ArticleLog::logEmail($article->getId(), $entry, $request);
     // Add attachments
     import('classes.file.ArticleFileManager');
     $articleFileManager = new ArticleFileManager($article->getId());
     foreach ($this->getAttachmentFiles() as $attachment) {
         $articleFileManager->temporaryFileToArticleFile($attachment, ARTICLE_FILE_ATTACHMENT, $logEntryId);
     }
 }