コード例 #1
0
 /**
  * Blind CC the reviews to reviewers.
  * @param $paper object
  * @param $send boolean
  * @param $inhibitExistingEmail boolean
  * @return boolean true iff ready for redirect
  */
 function blindCcReviewsToReviewers($paper, $send = false, $inhibitExistingEmail = false)
 {
     $commentDao =& DAORegistry::getDAO('PaperCommentDAO');
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $conference =& Request::getConference();
     $comments =& $commentDao->getPaperComments($paper->getId(), COMMENT_TYPE_DIRECTOR_DECISION);
     $reviewAssignments =& $reviewAssignmentDao->getReviewAssignmentsByPaperId($paper->getId(), $paper->getCurrentStage());
     $commentsText = "";
     foreach ($comments as $comment) {
         $commentsText .= String::html2utf(strip_tags($comment->getComments())) . "\n\n";
     }
     $user =& Request::getUser();
     import('mail.PaperMailTemplate');
     $email = new PaperMailTemplate($paper, 'SUBMISSION_DECISION_REVIEWERS');
     if ($send && !$email->hasErrors() && !$inhibitExistingEmail) {
         HookRegistry::call('TrackDirectorAction::blindCcReviewsToReviewers', array(&$paper, &$reviewAssignments, &$email));
         $email->send();
         return true;
     } else {
         if ($inhibitExistingEmail || !Request::getUserVar('continued')) {
             $email->clearRecipients();
             foreach ($reviewAssignments as $reviewAssignment) {
                 if ($reviewAssignment->getDateCompleted() != null && !$reviewAssignment->getCancelled()) {
                     $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
                     if (isset($reviewer)) {
                         $email->addBcc($reviewer->getEmail(), $reviewer->getFullName());
                     }
                 }
             }
             $paramArray = array('comments' => $commentsText, 'editorialContactSignature' => $user->getContactSignature());
             $email->assignParams($paramArray);
         }
         $email->displayEditForm(Request::url(null, null, null, 'blindCcReviewsToReviewers'), array('paperId' => $paper->getId()));
         return false;
     }
 }
コード例 #2
0
ファイル: EditCommentForm.inc.php プロジェクト: sedici/ocs
 /**
  * Email the comment.
  * @param $recipients array of recipients (email address => name)
  */
 function email($recipients)
 {
     import('mail.PaperMailTemplate');
     $email = new PaperMailTemplate($this->paper, 'SUBMISSION_COMMENT');
     foreach ($recipients as $emailAddress => $name) {
         $email->addRecipient($emailAddress, $name);
         $email->setSubject(strip_tags($this->paper->getLocalizedTitle()));
         $paramArray = array('name' => $name, 'commentName' => $this->user->getFullName(), 'comments' => String::html2text($this->getData('comments')));
         $email->assignParams($paramArray);
         $email->send();
         $email->clearRecipients();
     }
 }
コード例 #3
0
ファイル: CommentForm.inc.php プロジェクト: ramonsodoma/ocs
 /**
  * Email the comment.
  * @param $recipients array of recipients (email address => name)
  */
 function email($recipients)
 {
     $paper = $this->paper;
     $paperCommentDao =& DAORegistry::getDAO('PaperCommentDAO');
     $schedConf =& Request::getSchedConf();
     import('classes.mail.PaperMailTemplate');
     $email = new PaperMailTemplate($paper, 'SUBMISSION_COMMENT');
     $email->setFrom($this->user->getEmail(), $this->user->getFullName());
     $commentText = $this->getData('comments');
     // Individually send an email to each of the recipients.
     foreach ($recipients as $emailAddress => $name) {
         $email->addRecipient($emailAddress, $name);
         $paramArray = array('name' => $name, 'commentName' => $this->user->getFullName(), 'comments' => $commentText);
         $email->sendWithParams($paramArray);
         $email->clearRecipients();
     }
 }