Inheritance: extends PKPSubmissionEmailLogEntry
コード例 #1
0
 /**
  * Save the email in the submission email log.
  */
 function log($request = null)
 {
     import('classes.log.SubmissionEmailLogEntry');
     $entry = new SubmissionEmailLogEntry();
     $submission = $this->submission;
     // Event data
     $entry->setEventType($this->logEventType);
     $entry->setAssocType(ASSOC_TYPE_SUBMISSION);
     $entry->setAssocId($submission->getId());
     $entry->setDateSent(Core::getCurrentDate());
     // User data
     if ($request) {
         $user = $request->getUser();
         $entry->setSenderId($user == null ? 0 : $user->getId());
         $entry->setIPAddress($request->getRemoteAddr());
     } else {
         // No user supplied -- this is e.g. a cron-automated email
         $entry->setSenderId(0);
     }
     // Email data
     $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
     $logDao = DAORegistry::getDAO('SubmissionEmailLogDAO');
     $logEntryId = $logDao->insertObject($entry);
 }
コード例 #2
0
 /**
  * Instantiate and return a SubmissionEmailLogEntry
  * @return SubmissionEmailLogEntry
  */
 function newDataObject()
 {
     $returner = new SubmissionEmailLogEntry();
     $returner->setAssocType(ASSOC_TYPE_SUBMISSION);
     return $returner;
 }
コード例 #3
0
 /**
  * Save the email in the submission email log.
  */
 function log($request = null)
 {
     import('classes.log.SubmissionEmailLogEntry');
     $entry = new SubmissionEmailLogEntry();
     $submission = $this->submission;
     // Event data
     $entry->setEventType($this->logEventType);
     $entry->setAssocType(ASSOC_TYPE_SUBMISSION);
     $entry->setAssocId($submission->getId());
     $entry->setDateSent(Core::getCurrentDate());
     // User data
     if ($request) {
         $user = $request->getUser();
         $entry->setSenderId($user == null ? 0 : $user->getId());
         $entry->setIPAddress($request->getRemoteAddr());
     } else {
         // No user supplied -- this is e.g. a cron-automated email
         $entry->setSenderId(0);
     }
     // Email data
     $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
     $logDao = DAORegistry::getDAO('SubmissionEmailLogDAO');
     $logEntryId = $logDao->insertObject($entry);
     // Add attachments
     import('lib.pkp.classes.file.SubmissionFileManager');
     $submissionFileManager = new SubmissionFileManager($submission->getContextId(), $submission->getId());
     foreach ($this->getAttachmentFiles() as $attachment) {
         $submissionFileManager->temporaryFileToSubmissionFile($attachment, SUBMISSION_FILE_ATTACHMENT, ASSOC_TYPE_SUBMISSION_EMAIL_LOG_ENTRY, $logEntryId);
     }
 }