当前位置: 首页>>代码示例>>PHP>>正文


PHP ArticleMailTemplate::promoteCcsIfNoRecipients方法代码示例

本文整理汇总了PHP中ArticleMailTemplate::promoteCcsIfNoRecipients方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleMailTemplate::promoteCcsIfNoRecipients方法的具体用法?PHP ArticleMailTemplate::promoteCcsIfNoRecipients怎么用?PHP ArticleMailTemplate::promoteCcsIfNoRecipients使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ArticleMailTemplate的用法示例。


在下文中一共展示了ArticleMailTemplate::promoteCcsIfNoRecipients方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: confirmReview

 /**
  * Records whether or not the reviewer accepts the review assignment.
  * @param $user object
  * @param $assignment object
  * @param $decline boolean
  * @param $send boolean
  */
 function confirmReview($reviewAssignment, $decline, $send)
 {
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $reviewId = $reviewAssignment->getReviewId();
     $reviewerSubmission =& $reviewerSubmissionDao->getReviewerSubmission($reviewId);
     $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
     if (!isset($reviewer)) {
         return true;
     }
     // Only confirm the review for the reviewer if
     // he has not previously done so.
     if ($reviewAssignment->getDateConfirmed() == null) {
         import('classes.mail.ArticleMailTemplate');
         $email = new ArticleMailTemplate($reviewerSubmission, null, $decline ? 'REVIEW_DECLINE' : 'REVIEW_CONFIRM');
         // Must explicitly set sender because we may be here on an access
         // key, in which case the user is not technically logged in
         $email->setFrom($reviewer->getEmail(), $reviewer->getFullName());
         if (!$email->isEnabled() || $send && !$email->hasErrors()) {
             HookRegistry::call('ReviewerAction::confirmReview', array(&$reviewerSubmission, &$email, $decline));
             if ($email->isEnabled()) {
                 $email->setAssoc($decline ? ARTICLE_EMAIL_REVIEW_DECLINE : ARTICLE_EMAIL_REVIEW_CONFIRM, ARTICLE_EMAIL_TYPE_REVIEW, $reviewId);
                 $email->send();
             }
             $reviewAssignment->setDeclined($decline);
             $reviewAssignment->setDateConfirmed(Core::getCurrentDate());
             $reviewAssignment->stampModified();
             $reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
             //Send a notification to section editors
             import('lib.pkp.classes.notification.NotificationManager');
             $articleDao =& DAORegistry::getDAO('ArticleDAO');
             $article =& $articleDao->getArticle($reviewerSubmission->getArticleId());
             $user =& Request::getUser();
             $notificationManager = new NotificationManager();
             $notificationUsers = $article->getAssociatedUserIds(false, false);
             if ($decline == '1') {
                 $message = $article->getProposalId() . ':<br/>' . $user->getUsername() . ' declined';
             } else {
                 $message = $article->getProposalId() . ':<br/>' . $user->getUsername() . ' accepted';
             }
             foreach ($notificationUsers as $userRole) {
                 $url = Request::url(null, $userRole['role'], 'submission', array($article->getId(), 'submissionReview'), null, 'peerReview');
                 $notificationManager->createNotification($userRole['id'], 'notification.type.reviewAssignmentConfirmed', $message, $url, 1, NOTIFICATION_TYPE_REVIEWER_COMMENT);
             }
             // Add log
             import('classes.article.log.ArticleLog');
             import('classes.article.log.ArticleEventLogEntry');
             $entry = new ArticleEventLogEntry();
             $entry->setArticleId($reviewerSubmission->getArticleId());
             $entry->setUserId($reviewer->getId());
             $entry->setDateLogged(Core::getCurrentDate());
             $entry->setLogLevel('N');
             $entry->setEventType($decline ? ARTICLE_LOG_REVIEW_DECLINE : ARTICLE_LOG_REVIEW_ACCEPT);
             $entry->setLogMessage($decline ? 'log.review.reviewDeclined' : 'log.review.reviewAccepted', array('reviewerName' => $reviewer->getFullName(), 'articleId' => $reviewerSubmission->getProposalId()));
             $entry->setAssocType(ARTICLE_LOG_TYPE_REVIEW);
             $entry->setAssocId($reviewAssignment->getId());
             ArticleLog::logEventEntry($reviewerSubmission->getArticleId(), $entry);
             return true;
         } else {
             if (!Request::getUserVar('continued')) {
                 //$assignedEditors = $email->ccAssignedEditors($reviewerSubmission->getArticleId());
                 $reviewingSectionEditors = $email->toAssignedReviewingSectionEditors($reviewerSubmission->getArticleId());
                 if (empty($reviewingSectionEditors)) {
                     $journal =& Request::getJournal();
                     $email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
                     $editorialContactName = $journal->getSetting('contactName');
                 } else {
                     $editorialContactName = (string) '';
                     foreach ($reviewingSectionEditors as $reviewingSectionEditor) {
                         if ($editorialContactName == '') {
                             $editorialContactName = $reviewingSectionEditor->getFullName();
                         } else {
                             $editorialContactName .= ', ' . $reviewingSectionEditor->getFullName();
                         }
                     }
                 }
                 $email->promoteCcsIfNoRecipients();
                 // Format the review due date
                 $reviewDueDate = strtotime($reviewAssignment->getDateDue());
                 $dateFormatLong = Config::getVar('general', 'date_format_long');
                 if ($reviewDueDate == -1) {
                     $reviewDueDate = $dateFormatShort;
                 } else {
                     $reviewDueDate = strftime($dateFormatLong, $reviewDueDate);
                 }
                 $email->assignParams(array('editorialContactName' => $editorialContactName, 'reviewerName' => $reviewer->getFullName(), 'reviewDueDate' => $reviewDueDate));
             }
             $paramArray = array('reviewId' => $reviewId);
             if ($decline) {
                 $paramArray['declineReview'] = 1;
             }
             $email->displayEditForm(Request::url(null, 'reviewer', 'confirmReview'), $paramArray);
//.........这里部分代码省略.........
开发者ID:elavaud,项目名称:hrp_ct,代码行数:101,代码来源:ReviewerAction.inc.php

示例2: confirmReview

 /**
  * Records whether or not the reviewer accepts the review assignment.
  * @param $user object
  * @param $reviewerSubmission object
  * @param $decline boolean
  * @param $send boolean
  * @param $request object
  */
 function confirmReview($reviewerSubmission, $decline, $send, $request)
 {
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $reviewId = $reviewerSubmission->getReviewId();
     $reviewAssignment =& $reviewAssignmentDao->getById($reviewId);
     $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
     if (!isset($reviewer)) {
         return true;
     }
     // Only confirm the review for the reviewer if
     // he has not previously done so.
     if ($reviewAssignment->getDateConfirmed() == null) {
         import('classes.mail.ArticleMailTemplate');
         $email = new ArticleMailTemplate($reviewerSubmission, $decline ? 'REVIEW_DECLINE' : 'REVIEW_CONFIRM');
         // Must explicitly set sender because we may be here on an access
         // key, in which case the user is not technically logged in
         $email->setFrom($reviewer->getEmail(), $reviewer->getFullName());
         if (!$email->isEnabled() || $send && !$email->hasErrors()) {
             HookRegistry::call('ReviewerAction::confirmReview', array(&$reviewerSubmission, &$email, $decline));
             if ($email->isEnabled()) {
                 $email->send($request);
             }
             $reviewAssignment->setDeclined($decline);
             $reviewAssignment->setDateConfirmed(Core::getCurrentDate());
             $reviewAssignment->stampModified();
             $reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
             // Add log
             import('classes.article.log.ArticleLog');
             ArticleLog::logEvent($request, $reviewerSubmission, $decline ? ARTICLE_LOG_REVIEW_DECLINE : ARTICLE_LOG_REVIEW_ACCEPT, $decline ? 'log.review.reviewDeclined' : 'log.review.reviewAccepted', array('reviewerName' => $reviewer->getFullName(), 'articleId' => $reviewAssignment->getSubmissionId(), 'round' => $reviewAssignment->getRound(), 'reviewId' => $reviewAssignment->getId()));
             return true;
         } else {
             if (!$request->getUserVar('continued')) {
                 $assignedEditors = $email->ccAssignedEditors($reviewerSubmission->getId());
                 $reviewingSectionEditors = $email->toAssignedReviewingSectionEditors($reviewerSubmission->getId());
                 if (empty($assignedEditors) && empty($reviewingSectionEditors)) {
                     $journal =& $request->getJournal();
                     $email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
                     $editorialContactName = $journal->getSetting('contactName');
                 } else {
                     if (!empty($reviewingSectionEditors)) {
                         $editorialContact = array_shift($reviewingSectionEditors);
                     } else {
                         $editorialContact = array_shift($assignedEditors);
                     }
                     $editorialContactName = $editorialContact->getEditorFullName();
                 }
                 $email->promoteCcsIfNoRecipients();
                 // Format the review due date
                 $reviewDueDate = strtotime($reviewAssignment->getDateDue());
                 $dateFormatShort = Config::getVar('general', 'date_format_short');
                 if ($reviewDueDate == -1) {
                     $reviewDueDate = $dateFormatShort;
                 } else {
                     $reviewDueDate = strftime($dateFormatShort, $reviewDueDate);
                 }
                 $email->assignParams(array('editorialContactName' => $editorialContactName, 'reviewerName' => $reviewer->getFullName(), 'reviewDueDate' => $reviewDueDate));
             }
             $paramArray = array('reviewId' => $reviewId);
             if ($decline) {
                 $paramArray['declineReview'] = 1;
             }
             $email->displayEditForm($request->url(null, 'reviewer', 'confirmReview'), $paramArray);
             return false;
         }
     }
     return true;
 }
开发者ID:reconciler,项目名称:ojs,代码行数:76,代码来源:ReviewerAction.inc.php


注:本文中的ArticleMailTemplate::promoteCcsIfNoRecipients方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。