本文整理汇总了PHP中ArticleMailTemplate::toAssignedReviewingSectionEditors方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleMailTemplate::toAssignedReviewingSectionEditors方法的具体用法?PHP ArticleMailTemplate::toAssignedReviewingSectionEditors怎么用?PHP ArticleMailTemplate::toAssignedReviewingSectionEditors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticleMailTemplate
的用法示例。
在下文中一共展示了ArticleMailTemplate::toAssignedReviewingSectionEditors方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recordRecommendation
/**
* Records the reviewer's submission recommendation.
* @param $reviewId int
* @param $recommendation int
* @param $send boolean
*/
function recordRecommendation(&$reviewAssignment, $recommendation, $send)
{
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$reviewId = $reviewAssignment->getReviewId();
$reviewerSubmission =& $reviewerSubmissionDao->getReviewerSubmission($reviewId);
// Check validity of selected recommendation
$reviewerRecommendationOptions =& ReviewAssignment::getReviewerRecommendationOptions();
if (!isset($reviewerRecommendationOptions[$recommendation])) {
return true;
}
$reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
if (!isset($reviewer)) {
return true;
}
// Only record the reviewers recommendation if
// no recommendation has previously been submitted.
if ($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation === '') {
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($reviewerSubmission, null, 'REVIEW_COMPLETE');
// 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::recordRecommendation', array(&$reviewerSubmission, &$email, $recommendation));
if ($email->isEnabled()) {
$email->setAssoc(ARTICLE_EMAIL_REVIEW_COMPLETE, ARTICLE_EMAIL_TYPE_REVIEW, $reviewId);
$email->send();
}
$reviewAssignment->setRecommendation($recommendation);
$reviewAssignment->setDateCompleted(Core::getCurrentDate());
$reviewAssignment->stampModified();
$reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
// 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->setEventType(ARTICLE_LOG_REVIEW_RECOMMENDATION);
$entry->setLogLevel('N');
$entry->setLogMessage('log.review.reviewRecommendationSet', array('reviewerName' => $reviewer->getFullName(), 'articleId' => $reviewerSubmission->getProposalId()));
$entry->setAssocType(ARTICLE_LOG_TYPE_REVIEW);
$entry->setAssocId($reviewAssignment->getId());
ArticleLog::logEventEntry($reviewerSubmission->getArticleId(), $entry);
} else {
if (!Request::getUserVar('continued')) {
$assignedEditors = $email->ccAssignedEditors($reviewerSubmission->getArticleId());
$reviewingSectionEditors = $email->toAssignedReviewingSectionEditors($reviewerSubmission->getArticleId());
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);
}
// Modified by EL on February 17th 2013
// No edit assigment anymore
$editorialContactName = $editorialContact->getFullName();
}
$reviewerRecommendationOptions =& ReviewAssignment::getReviewerRecommendationOptions();
$email->assignParams(array('editorialContactName' => $editorialContactName, 'reviewerName' => $reviewer->getFullName(), 'articleTitle' => strip_tags($reviewerSubmission->getScientificTitle()), 'recommendation' => Locale::translate($reviewerRecommendationOptions[$recommendation])));
}
$email->displayEditForm(Request::url(null, 'reviewer', 'recordRecommendation'), array('reviewId' => $reviewId, 'recommendation' => $recommendation));
return false;
}
}
return true;
}
示例2: recordRecommendation
/**
* Records the reviewer's submission recommendation.
* @param $reviewId int
* @param $recommendation int
* @param $send boolean
* @param $request object
*/
function recordRecommendation(&$reviewerSubmission, $recommendation, $send, $request)
{
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
// Check validity of selected recommendation
$reviewerRecommendationOptions =& ReviewAssignment::getReviewerRecommendationOptions();
if (!isset($reviewerRecommendationOptions[$recommendation])) {
return true;
}
$reviewAssignment =& $reviewAssignmentDao->getById($reviewerSubmission->getReviewId());
$reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
if (!isset($reviewer)) {
return true;
}
// Only record the reviewers recommendation if
// no recommendation has previously been submitted.
if ($reviewAssignment->getRecommendation() === null || $reviewAssignment->getRecommendation === '') {
import('classes.mail.ArticleMailTemplate');
$email = new ArticleMailTemplate($reviewerSubmission, 'REVIEW_COMPLETE');
// Must explicitly set sender because we may be here on an access
// key, in which case the user is not technically logged in
$email->setReplyTo($reviewer->getEmail(), $reviewer->getFullName());
if (!$email->isEnabled() || $send && !$email->hasErrors()) {
HookRegistry::call('ReviewerAction::recordRecommendation', array(&$reviewerSubmission, &$email, $recommendation));
if ($email->isEnabled()) {
$email->send($request);
}
$reviewAssignment->setRecommendation($recommendation);
$reviewAssignment->setDateCompleted(Core::getCurrentDate());
$reviewAssignment->stampModified();
$reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
// Add log
import('classes.article.log.ArticleLog');
ArticleLog::logEvent($request, $reviewerSubmission, ARTICLE_LOG_REVIEW_RECOMMENDATION, 'log.review.reviewRecommendationSet', array('reviewerName' => $reviewer->getFullName(), 'articleId' => $reviewAssignment->getSubmissionId(), 'round' => $reviewAssignment->getRound(), 'reviewId' => $reviewAssignment->getId()));
} 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();
}
$reviewerRecommendationOptions =& ReviewAssignment::getReviewerRecommendationOptions();
$email->assignParams(array('editorialContactName' => $editorialContactName, 'reviewerName' => $reviewer->getFullName(), 'articleTitle' => strip_tags($reviewerSubmission->getLocalizedTitle()), 'recommendation' => __($reviewerRecommendationOptions[$recommendation])));
}
$email->displayEditForm($request->url(null, 'reviewer', 'recordRecommendation'), array('reviewId' => $reviewerSubmission->getReviewId(), 'recommendation' => $recommendation));
return false;
}
}
return true;
}