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


PHP ArticleMailTemplate::addRecipient方法代码示例

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


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

示例1: execute

 /**
  * Save changes to submission.
  * @param $args array
  * @param $request PKPRequest
  * @return int the submission ID
  */
 function execute($args, $request)
 {
     parent::execute($args, $request);
     $submission = $this->submission;
     // Send author notification email
     import('classes.mail.ArticleMailTemplate');
     $mail = new ArticleMailTemplate($submission, 'SUBMISSION_ACK');
     $authorMail = new ArticleMailTemplate($submission, 'SUBMISSION_ACK_NOT_USER');
     $context = $request->getContext();
     $router = $request->getRouter();
     if ($mail->isEnabled()) {
         // submission ack emails should be from the contact.
         $mail->setFrom($this->context->getSetting('contactEmail'), $this->context->getSetting('contactName'));
         $authorMail->setFrom($this->context->getSetting('contactEmail'), $this->context->getSetting('contactName'));
         $user = $request->getUser();
         $primaryAuthor = $submission->getPrimaryAuthor();
         if (!isset($primaryAuthor)) {
             $authors = $submission->getAuthors();
             $primaryAuthor = $authors[0];
         }
         $mail->addRecipient($user->getEmail(), $user->getFullName());
         // Add primary contact and e-mail address as specified in the journal submission settings
         if ($context->getSetting('copySubmissionAckPrimaryContact')) {
             $mail->addBcc($context->getSetting('contactEmail'), $context->getSetting('contactName'));
         }
         if ($copyAddress = $context->getSetting('copySubmissionAckAddress')) {
             $mail->addBcc($copyAddress);
         }
         if ($user->getEmail() != $primaryAuthor->getEmail()) {
             $authorMail->addRecipient($primaryAuthor->getEmail(), $primaryAuthor->getFullName());
         }
         $assignedAuthors = $submission->getAuthors();
         foreach ($assignedAuthors as $author) {
             $authorEmail = $author->getEmail();
             // only add the author email if they have not already been added as the primary author
             // or user creating the submission.
             if ($authorEmail != $primaryAuthor->getEmail() && $authorEmail != $user->getEmail()) {
                 $authorMail->addRecipient($author->getEmail(), $author->getFullName());
             }
         }
         $mail->bccAssignedSubEditors($submission->getId(), WORKFLOW_STAGE_ID_SUBMISSION);
         $mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'editorialContactSignature' => $context->getSetting('contactName'), 'submissionUrl' => $router->url($request, null, 'authorDashboard', 'submission', $submission->getId())));
         $authorMail->assignParams(array('submitterName' => $user->getFullName(), 'editorialContactSignature' => $context->getSetting('contactName')));
         $mail->send($request);
         $recipients = $authorMail->getRecipients();
         if (!empty($recipients)) {
             $authorMail->send($request);
         }
     }
     // Log submission.
     import('classes.log.SubmissionEventLogEntry');
     // Constants
     import('lib.pkp.classes.log.SubmissionLog');
     SubmissionLog::logEvent($request, $submission, SUBMISSION_LOG_SUBMISSION_SUBMIT, 'submission.event.submissionSubmitted');
     return $this->submissionId;
 }
开发者ID:pkp,项目名称:ojs,代码行数:62,代码来源:SubmissionSubmitStep4Form.inc.php

示例2: sendReminder

 function sendReminder($reviewAssignment, $article, $journal)
 {
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $reviewId = $reviewAssignment->getId();
     $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId());
     if (!isset($reviewer)) {
         return false;
     }
     import('mail.ArticleMailTemplate');
     $reviewerAccessKeysEnabled = $journal->getSetting('reviewerAccessKeysEnabled');
     $email = new ArticleMailTemplate($article, $reviewerAccessKeysEnabled ? 'REVIEW_REMIND_AUTO_ONECLICK' : 'REVIEW_REMIND_AUTO', null, false, $journal);
     $email->setJournal($journal);
     $email->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
     $email->addRecipient($reviewer->getEmail(), $reviewer->getFullName());
     $email->setAssoc(ARTICLE_EMAIL_REVIEW_REMIND, ARTICLE_EMAIL_TYPE_REVIEW, $reviewId);
     $email->setSubject($email->getSubject($journal->getPrimaryLocale()));
     $email->setBody($email->getBody($journal->getPrimaryLocale()));
     $urlParams = array();
     if ($reviewerAccessKeysEnabled) {
         import('security.AccessKeyManager');
         $accessKeyManager = new AccessKeyManager();
         // Key lifetime is the typical review period plus four weeks
         $keyLifetime = ($journal->getSetting('numWeeksPerReview') + 4) * 7;
         $urlParams['key'] = $accessKeyManager->createKey('ReviewerContext', $reviewer->getId(), $reviewId, $keyLifetime);
     }
     $submissionReviewUrl = Request::url($journal->getPath(), 'reviewer', 'submission', $reviewId, $urlParams);
     $paramArray = array('reviewerName' => $reviewer->getFullName(), 'reviewerUsername' => $reviewer->getUsername(), 'journalUrl' => $journal->getUrl(), 'reviewerPassword' => $reviewer->getPassword(), 'reviewDueDate' => strftime(Config::getVar('general', 'date_format_short'), strtotime($reviewAssignment->getDateDue())), 'weekLaterDate' => strftime(Config::getVar('general', 'date_format_short'), strtotime('+1 week')), 'editorialContactSignature' => $journal->getSetting('contactName') . "\n" . $journal->getLocalizedTitle(), 'passwordResetUrl' => Request::url($journal->getPath(), 'login', 'resetPassword', $reviewer->getUsername(), array('confirm' => Validation::generatePasswordResetHash($reviewer->getId()))), 'submissionReviewUrl' => $submissionReviewUrl);
     $email->assignParams($paramArray);
     $email->send();
     $reviewAssignment->setDateReminded(Core::getCurrentDate());
     $reviewAssignment->setReminderWasAutomatic(1);
     $reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
 }
开发者ID:philschatz,项目名称:ojs,代码行数:34,代码来源:ReviewReminder.inc.php

示例3: assignEditor

 /**
  * Assigns a section editor to a submission.
  * @param $articleId int
  * @param $sectionEditorId int
  * @param $isEditor boolean
  * @param $send boolean
  * @param $request object
  * @return boolean true iff ready for redirect
  */
 function assignEditor($articleId, $sectionEditorId, $isEditor, $send, $request)
 {
     $editorSubmissionDao =& DAORegistry::getDAO('EditorSubmissionDAO');
     $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');
     /* @var $editAssignmentDao EditAssignmentDAO */
     $userDao =& DAORegistry::getDAO('UserDAO');
     $user =& $request->getUser();
     $journal =& $request->getJournal();
     $editorSubmission =& $editorSubmissionDao->getEditorSubmission($articleId);
     $sectionEditor =& $userDao->getById($sectionEditorId);
     if (!isset($sectionEditor)) {
         return true;
     }
     foreach ($editorSubmission->getEditAssignments() as $assignment) {
         if ($assignment->getEditorId() == $sectionEditorId) {
             return true;
         }
     }
     import('classes.mail.ArticleMailTemplate');
     $email = new ArticleMailTemplate($editorSubmission, 'EDITOR_ASSIGN');
     if ($user->getId() === $sectionEditorId || !$email->isEnabled() || $send && !$email->hasErrors()) {
         HookRegistry::call('EditorAction::assignEditor', array(&$editorSubmission, &$sectionEditor, &$isEditor, &$email));
         if ($email->isEnabled() && $user->getId() !== $sectionEditorId) {
             $email->send($request);
         }
         $editAssignment = $editAssignmentDao->newDataObject();
         $editAssignment->setArticleId($articleId);
         $editAssignment->setCanEdit(1);
         $editAssignment->setCanReview(1);
         // Make the selected editor the new editor
         $editAssignment->setEditorId($sectionEditorId);
         $editAssignment->setDateAssigned(Core::getCurrentDate());
         $editAssignment->setDateNotified(is_array($send) && isset($send['skip']) ? null : Core::getCurrentDate());
         $editAssignment->setDateUnderway(null);
         $editAssignments =& $editorSubmission->getEditAssignments();
         array_push($editAssignments, $editAssignment);
         $editorSubmission->setEditAssignments($editAssignments);
         $editorSubmissionDao->updateEditorSubmission($editorSubmission);
         // Add log
         import('classes.article.log.ArticleLog');
         ArticleLog::logEvent($request, $editorSubmission, ARTICLE_LOG_EDITOR_ASSIGN, 'log.editor.editorAssigned', array('editorName' => $sectionEditor->getFullName(), 'editorId' => $sectionEditorId));
         return true;
     } else {
         if (!$request->getUserVar('continued')) {
             $email->addRecipient($sectionEditor->getEmail(), $sectionEditor->getFullName());
             $paramArray = array('editorialContactName' => $sectionEditor->getFullName(), 'editorUsername' => $sectionEditor->getUsername(), 'editorPassword' => $sectionEditor->getPassword(), 'editorialContactSignature' => $user->getContactSignature(), 'submissionUrl' => $request->url(null, $isEditor ? 'editor' : 'sectionEditor', 'submissionReview', $articleId), 'submissionEditingUrl' => $request->url(null, $isEditor ? 'editor' : 'sectionEditor', 'submissionReview', $articleId));
             $email->assignParams($paramArray);
         }
         $email->displayEditForm($request->url(null, null, 'assignEditor', 'send'), array('articleId' => $articleId, 'editorId' => $sectionEditorId));
         return false;
     }
 }
开发者ID:farhanabbas1983,项目名称:ojs-1,代码行数:61,代码来源:EditorAction.inc.php

示例4: sendReminder

 function sendReminder($reviewAssignment, $submission, $context)
 {
     $reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
     $userDao = DAORegistry::getDAO('UserDAO');
     $reviewId = $reviewAssignment->getId();
     $reviewer = $userDao->getById($reviewAssignment->getReviewerId());
     if (!isset($reviewer)) {
         return false;
     }
     import('classes.mail.ArticleMailTemplate');
     $reviewerAccessKeysEnabled = $context->getSetting('reviewerAccessKeysEnabled');
     $email = new ArticleMailTemplate($submission, $reviewerAccessKeysEnabled ? 'REVIEW_REMIND_AUTO_ONECLICK' : 'REVIEW_REMIND_AUTO', $context->getPrimaryLocale(), $context, false);
     $email->setContext($context);
     $email->setReplyTo(null);
     $email->addRecipient($reviewer->getEmail(), $reviewer->getFullName());
     $email->setSubject($email->getSubject($context->getPrimaryLocale()));
     $email->setBody($email->getBody($context->getPrimaryLocale()));
     $urlParams = array();
     if ($reviewerAccessKeysEnabled) {
         import('lib.pkp.classes.security.AccessKeyManager');
         $accessKeyManager = new AccessKeyManager();
         // Key lifetime is the typical review period plus four weeks
         $keyLifetime = ($context->getSetting('numWeeksPerReview') + 4) * 7;
         $urlParams['key'] = $accessKeyManager->createKey('ReviewerContext', $reviewer->getId(), $reviewId, $keyLifetime);
     }
     $submissionReviewUrl = Request::url($context->getPath(), 'reviewer', 'submission', $reviewId, $urlParams);
     // Format the review due date
     $reviewDueDate = strtotime($reviewAssignment->getDateDue());
     $dateFormatShort = Config::getVar('general', 'date_format_short');
     if ($reviewDueDate === -1 || $reviewDueDate === false) {
         // Default to something human-readable if no date specified
         $reviewDueDate = '_____';
     } else {
         $reviewDueDate = strftime($dateFormatShort, $reviewDueDate);
     }
     $paramArray = array('reviewerName' => $reviewer->getFullName(), 'reviewerUsername' => $reviewer->getUsername(), 'contextUrl' => Request::url($context->getPath()), 'reviewerPassword' => $reviewer->getPassword(), 'reviewDueDate' => $reviewDueDate, 'weekLaterDate' => strftime(Config::getVar('general', 'date_format_short'), strtotime('+1 week')), 'editorialContactSignature' => $context->getSetting('contactName') . "\n" . $context->getLocalizedName(), 'passwordResetUrl' => Request::url($context->getPath(), 'login', 'resetPassword', $reviewer->getUsername(), array('confirm' => Validation::generatePasswordResetHash($reviewer->getId()))), 'submissionReviewUrl' => $submissionReviewUrl);
     $email->assignParams($paramArray);
     $email->send();
     $reviewAssignment->setDateReminded(Core::getCurrentDate());
     $reviewAssignment->setReminderWasAutomatic(1);
     $reviewAssignmentDao->updateObject($reviewAssignment);
 }
开发者ID:mosvits,项目名称:ojs,代码行数:42,代码来源:ReviewReminder.inc.php

示例5: execute

 /**
  * Save changes to article.
  */
 function execute()
 {
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $journal = Request::getJournal();
     $user = Request::getUser();
     // Update article
     $article =& $this->article;
     if ($this->getData('commentsToEditor') != '') {
         $article->setCommentsToEditor($this->getData('commentsToEditor'));
     }
     $article->setDateSubmitted(Core::getCurrentDate());
     $article->setSubmissionProgress(0);
     $article->stampStatusModified();
     $articleDao->updateArticle($article);
     // Designate this as the review version by default.
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($article->getId());
     AuthorAction::designateReviewVersion($authorSubmission, true);
     unset($authorSubmission);
     $copyeditInitialSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_INITIAL', ASSOC_TYPE_ARTICLE, $article->getId());
     $copyeditAuthorSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getId());
     $copyeditFinalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $article->getId());
     $copyeditInitialSignoff->setUserId(0);
     $copyeditAuthorSignoff->setUserId($user->getId());
     $copyeditFinalSignoff->setUserId(0);
     $signoffDao->updateObject($copyeditInitialSignoff);
     $signoffDao->updateObject($copyeditAuthorSignoff);
     $signoffDao->updateObject($copyeditFinalSignoff);
     $layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getId());
     $layoutSignoff->setUserId(0);
     $signoffDao->updateObject($layoutSignoff);
     $proofAuthorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_AUTHOR', ASSOC_TYPE_ARTICLE, $article->getId());
     $proofProofreaderSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $article->getId());
     $proofLayoutEditorSignoff = $signoffDao->build('SIGNOFF_PROOFREADING_LAYOUT', ASSOC_TYPE_ARTICLE, $article->getId());
     $proofAuthorSignoff->setUserId($user->getId());
     $proofProofreaderSignoff->setUserId(0);
     $proofLayoutEditorSignoff->setUserId(0);
     $signoffDao->updateObject($proofAuthorSignoff);
     $signoffDao->updateObject($proofProofreaderSignoff);
     $signoffDao->updateObject($proofLayoutEditorSignoff);
     $sectionEditors = $this->assignEditors($article);
     $user =& Request::getUser();
     // Update search index
     import('classes.search.ArticleSearchIndex');
     ArticleSearchIndex::indexArticleMetadata($article);
     ArticleSearchIndex::indexArticleFiles($article);
     // Send author notification email
     import('classes.mail.ArticleMailTemplate');
     $mail = new ArticleMailTemplate($article, 'SUBMISSION_ACK', null, null, null, false);
     $mail->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
     if ($mail->isEnabled()) {
         $mail->addRecipient($user->getEmail(), $user->getFullName());
         // If necessary, BCC the acknowledgement to someone.
         if ($journal->getSetting('copySubmissionAckPrimaryContact')) {
             $mail->addBcc($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
         }
         if ($journal->getSetting('copySubmissionAckSpecified')) {
             $copyAddress = $journal->getSetting('copySubmissionAckAddress');
             if (!empty($copyAddress)) {
                 $mail->addBcc($copyAddress);
             }
         }
         // Also BCC automatically assigned section editors
         foreach ($sectionEditors as $sectionEditorEntry) {
             $sectionEditor =& $sectionEditorEntry['user'];
             $mail->addBcc($sectionEditor->getEmail(), $sectionEditor->getFullName());
             unset($sectionEditor);
         }
         $mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'editorialContactSignature' => $journal->getSetting('contactName') . "\n" . $journal->getLocalizedTitle(), 'submissionUrl' => Request::url(null, 'author', 'submission', $article->getId())));
         $mail->send();
     }
     import('classes.article.log.ArticleLog');
     import('classes.article.log.ArticleEventLogEntry');
     ArticleLog::logEvent($this->articleId, ARTICLE_LOG_ARTICLE_SUBMIT, ARTICLE_LOG_TYPE_AUTHOR, $user->getId(), 'log.author.submitted', array('submissionId' => $article->getId(), 'authorName' => $user->getFullName()));
     return $this->articleId;
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:80,代码来源:AuthorSubmitStep5Form.inc.php

示例6: callbackAuthorDeposits

 /**
  * Hook registry function that is called when it's time to perform all automatic
  * deposits and notify the author of optional deposits.
  * @param $hookName string
  * @param $args array
  */
 function callbackAuthorDeposits($hookName, $args)
 {
     $sectionEditorSubmission =& $args[0];
     $request =& $this->getRequest();
     // Determine if the most recent decision was an "Accept"
     $decisions = $sectionEditorSubmission->getDecisions();
     $decisions = array_pop($decisions);
     // Rounds
     $decision = array_pop($decisions);
     $decisionConst = $decision ? $decision['decision'] : null;
     if ($decisionConst != SUBMISSION_EDITOR_DECISION_ACCEPT) {
         return false;
     }
     // The most recent decision was an "Accept"; perform auto deposits.
     $journal = $request->getJournal();
     $depositPoints = $this->getSetting($journal->getId(), 'depositPoints');
     import('classes.sword.OJSSwordDeposit');
     import('classes.notification.NotificationManager');
     $notificationManager = new NotificationManager();
     $sendDepositNotification = $this->getSetting($journal->getId(), 'allowAuthorSpecify') ? true : false;
     foreach ($depositPoints as $depositPoint) {
         $depositType = $depositPoint['type'];
         if ($depositType == SWORD_DEPOSIT_TYPE_OPTIONAL_SELECTION || $depositType == SWORD_DEPOSIT_TYPE_OPTIONAL_FIXED) {
             $sendDepositNotification = true;
         }
         if ($depositType != SWORD_DEPOSIT_TYPE_AUTOMATIC) {
             continue;
         }
         // For each automatic deposit point, perform a deposit.
         $deposit = new OJSSwordDeposit($sectionEditorSubmission);
         $deposit->setMetadata();
         $deposit->addEditorial();
         $deposit->createPackage();
         $deposit->deposit($depositPoint['url'], $depositPoint['username'], $depositPoint['password']);
         $deposit->cleanup();
         unset($deposit);
         $user = $request->getUser();
         $params = array('itemTitle' => $sectionEditorSubmission->getLocalizedTitle(), 'repositoryName' => $depositPoint['name']);
         $notificationManager->createTrivialNotification($user->getId(), NOTIFICATION_TYPE_SWORD_AUTO_DEPOSIT_COMPLETE, $params);
     }
     if ($sendDepositNotification) {
         $submittingUser = $sectionEditorSubmission->getUser();
         import('classes.mail.ArticleMailTemplate');
         $mail = new ArticleMailTemplate($sectionEditorSubmission, 'SWORD_DEPOSIT_NOTIFICATION', null, null, $journal, true, true);
         $mail->setReplyTo(null);
         $mail->addRecipient($submittingUser->getEmail(), $submittingUser->getFullName());
         $mail->assignParams(array('journalName' => $journal->getLocalizedName(), 'articleTitle' => $sectionEditorSubmission->getLocalizedTitle(), 'swordDepositUrl' => $request->url(null, 'sword', 'index', $sectionEditorSubmission->getId())));
         $mail->send($request);
     }
     return false;
 }
开发者ID:jalperin,项目名称:ojs,代码行数:57,代码来源:SwordPlugin.inc.php

示例7: emailEditorDecisionComment

 /**
  * Email editor decision comment.
  * @param $sectionEditorSubmission object
  * @param $send boolean
  * @param $request object
  */
 function emailEditorDecisionComment($sectionEditorSubmission, $send, $request)
 {
     $userDao =& DAORegistry::getDAO('UserDAO');
     $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
     $sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
     $journal =& $request->getJournal();
     $user =& $request->getUser();
     import('classes.mail.ArticleMailTemplate');
     $decisionTemplateMap = array(SUBMISSION_EDITOR_DECISION_ACCEPT => 'EDITOR_DECISION_ACCEPT', SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS => 'EDITOR_DECISION_REVISIONS', SUBMISSION_EDITOR_DECISION_RESUBMIT => 'EDITOR_DECISION_RESUBMIT', SUBMISSION_EDITOR_DECISION_DECLINE => 'EDITOR_DECISION_DECLINE');
     $decisions = $sectionEditorSubmission->getDecisions();
     $decisions = array_pop($decisions);
     // Rounds
     $decision = array_pop($decisions);
     $decisionConst = $decision ? $decision['decision'] : null;
     $email = new ArticleMailTemplate($sectionEditorSubmission, isset($decisionTemplateMap[$decisionConst]) ? $decisionTemplateMap[$decisionConst] : null);
     $copyeditor = $sectionEditorSubmission->getUserBySignoffType('SIGNOFF_COPYEDITING_INITIAL');
     if ($send && !$email->hasErrors()) {
         HookRegistry::call('SectionEditorAction::emailEditorDecisionComment', array(&$sectionEditorSubmission, &$send, &$request));
         $email->send($request);
         if ($decisionConst == SUBMISSION_EDITOR_DECISION_DECLINE) {
             // If the most recent decision was a decline,
             // sending this email archives the submission.
             $sectionEditorSubmission->setStatus(STATUS_ARCHIVED);
             $sectionEditorSubmission->stampStatusModified();
             $sectionEditorSubmissionDao->updateSectionEditorSubmission($sectionEditorSubmission);
         }
         $articleComment = new ArticleComment();
         $articleComment->setCommentType(COMMENT_TYPE_EDITOR_DECISION);
         $articleComment->setRoleId(Validation::isEditor() ? ROLE_ID_EDITOR : ROLE_ID_SECTION_EDITOR);
         $articleComment->setArticleId($sectionEditorSubmission->getId());
         $articleComment->setAuthorId($sectionEditorSubmission->getUserId());
         $articleComment->setCommentTitle($email->getSubject());
         $articleComment->setComments($email->getBody());
         $articleComment->setDatePosted(Core::getCurrentDate());
         $articleComment->setViewable(true);
         $articleComment->setAssocId($sectionEditorSubmission->getId());
         $articleCommentDao->insertArticleComment($articleComment);
         return true;
     } else {
         if (!$request->getUserVar('continued')) {
             $authorUser =& $userDao->getUser($sectionEditorSubmission->getUserId());
             $authorEmail = $authorUser->getEmail();
             $email->assignParams(array('editorialContactSignature' => $user->getContactSignature(), 'authorName' => $authorUser->getFullName(), 'journalTitle' => $journal->getLocalizedTitle()));
             $email->addRecipient($authorEmail, $authorUser->getFullName());
             if ($journal->getSetting('notifyAllAuthorsOnDecision')) {
                 foreach ($sectionEditorSubmission->getAuthors() as $author) {
                     if ($author->getEmail() != $authorEmail) {
                         $email->addCc($author->getEmail(), $author->getFullName());
                     }
                 }
             }
         } elseif ($request->getUserVar('importPeerReviews')) {
             $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
             $reviewAssignments =& $reviewAssignmentDao->getBySubmissionId($sectionEditorSubmission->getId(), $sectionEditorSubmission->getCurrentRound());
             $reviewIndexes =& $reviewAssignmentDao->getReviewIndexesForRound($sectionEditorSubmission->getId(), $sectionEditorSubmission->getCurrentRound());
             $body = '';
             foreach ($reviewAssignments as $reviewAssignment) {
                 // If the reviewer has completed the assignment, then import the review.
                 if ($reviewAssignment->getDateCompleted() != null && !$reviewAssignment->getCancelled()) {
                     // Get the comments associated with this review assignment
                     $articleComments =& $articleCommentDao->getArticleComments($sectionEditorSubmission->getId(), COMMENT_TYPE_PEER_REVIEW, $reviewAssignment->getId());
                     if ($articleComments) {
                         $body .= "------------------------------------------------------\n";
                         $body .= __('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => String::enumerateAlphabetically($reviewIndexes[$reviewAssignment->getReviewId()]))) . "\n";
                         if (is_array($articleComments)) {
                             foreach ($articleComments as $comment) {
                                 // If the comment is viewable by the author, then add the comment.
                                 if ($comment->getViewable()) {
                                     $body .= String::html2text($comment->getComments()) . "\n\n";
                                 }
                             }
                         }
                         $body .= "------------------------------------------------------\n\n";
                     }
                     if ($reviewFormId = $reviewAssignment->getReviewFormId()) {
                         $reviewId = $reviewAssignment->getId();
                         $reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO');
                         $reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO');
                         $reviewFormElements =& $reviewFormElementDao->getReviewFormElements($reviewFormId);
                         if (!$articleComments) {
                             $body .= "------------------------------------------------------\n";
                             $body .= __('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => String::enumerateAlphabetically($reviewIndexes[$reviewAssignment->getReviewId()]))) . "\n\n";
                         }
                         foreach ($reviewFormElements as $reviewFormElement) {
                             if ($reviewFormElement->getIncluded()) {
                                 $body .= String::html2text($reviewFormElement->getLocalizedQuestion()) . ": \n";
                                 $reviewFormResponse = $reviewFormResponseDao->getReviewFormResponse($reviewId, $reviewFormElement->getId());
                                 if ($reviewFormResponse) {
                                     $possibleResponses = $reviewFormElement->getLocalizedPossibleResponses();
                                     if (in_array($reviewFormElement->getElementType(), $reviewFormElement->getMultipleResponsesElementTypes())) {
                                         if ($reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_CHECKBOXES) {
                                             foreach ($reviewFormResponse->getValue() as $value) {
                                                 $body .= "\t" . String::html2text($possibleResponses[$value - 1]['content']) . "\n";
                                             }
//.........这里部分代码省略.........
开发者ID:yuricampos,项目名称:ojs,代码行数:101,代码来源:SectionEditorAction.inc.php

示例8: email

 /**
  * Email the comment.
  * @param $recipients array of recipients (email address => name)
  */
 function email($recipients)
 {
     $article = $this->article;
     $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
     $journal =& Request::getJournal();
     import('mail.ArticleMailTemplate');
     $email = new ArticleMailTemplate($article, '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();
     }
 }
开发者ID:philschatz,项目名称:ojs,代码行数:21,代码来源:CommentForm.inc.php

示例9: email

 /**
  * Email the comment.
  * @param $recipients array of recipients (email address => name)
  */
 function email($recipients)
 {
     import('classes.mail.ArticleMailTemplate');
     $email = new ArticleMailTemplate($this->article, 'SUBMISSION_COMMENT');
     $journal =& Request::getJournal();
     if ($journal) {
         $email->setFrom($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
     }
     foreach ($recipients as $emailAddress => $name) {
         $email->addRecipient($emailAddress, $name);
         $email->setSubject(strip_tags($this->article->getLocalizedTitle()));
         $paramArray = array('name' => $name, 'commentName' => $this->user->getFullName(), 'comments' => String::html2text($this->getData('comments')));
         $email->assignParams($paramArray);
         $email->send();
         $email->clearRecipients();
     }
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:21,代码来源:EditCommentForm.inc.php

示例10: completeFinalCopyedit

 /**
  * Copyeditor completes final copyedit.
  * @param $copyeditorSubmission object
  * @param $send boolean
  * @param $request object
  */
 function completeFinalCopyedit($copyeditorSubmission, $send, $request)
 {
     $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $journal =& $request->getJournal();
     $finalSignoff = $signoffDao->build('SIGNOFF_COPYEDITING_FINAL', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
     if ($finalSignoff->getDateCompleted() != null) {
         return true;
     }
     $user =& $request->getUser();
     import('classes.mail.ArticleMailTemplate');
     $email = new ArticleMailTemplate($copyeditorSubmission, 'COPYEDIT_FINAL_COMPLETE');
     $editAssignments = $copyeditorSubmission->getEditAssignments();
     if (!$email->isEnabled() || $send && !$email->hasErrors()) {
         HookRegistry::call('CopyeditorAction::completeFinalCopyedit', array(&$copyeditorSubmission, &$editAssignments, &$email));
         if ($email->isEnabled()) {
             $email->send($request);
         }
         $finalSignoff->setDateCompleted(Core::getCurrentDate());
         $signoffDao->updateObject($finalSignoff);
         if ($copyEdFile = $copyeditorSubmission->getFileBySignoffType('SIGNOFF_COPYEDITING_FINAL')) {
             // Set initial layout version to final copyedit version
             $layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $copyeditorSubmission->getId());
             if (!$layoutSignoff->getFileId()) {
                 import('classes.file.ArticleFileManager');
                 $articleFileManager = new ArticleFileManager($copyeditorSubmission->getId());
                 if ($layoutFileId = $articleFileManager->copyToLayoutFile($copyEdFile->getFileId(), $copyEdFile->getRevision())) {
                     $layoutSignoff->setFileId($layoutFileId);
                     $signoffDao->updateObject($layoutSignoff);
                 }
             }
         }
         // Add log entry
         import('classes.article.log.ArticleLog');
         import('classes.article.log.ArticleEventLogEntry');
         ArticleLog::logEvent($request, $copyeditorSubmission, ARTICLE_LOG_COPYEDIT_FINAL, 'log.copyedit.finalEditComplete', array('copyeditorName' => $user->getFullName()));
         return true;
     } else {
         if (!$request->getUserVar('continued')) {
             $assignedSectionEditors = $email->toAssignedEditingSectionEditors($copyeditorSubmission->getId());
             $assignedEditors = $email->ccAssignedEditors($copyeditorSubmission->getId());
             if (empty($assignedSectionEditors) && empty($assignedEditors)) {
                 $email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
                 $paramArray = array('editorialContactName' => $journal->getSetting('contactName'), 'copyeditorName' => $user->getFullName());
             } else {
                 $editorialContact = array_shift($assignedSectionEditors);
                 if (!$editorialContact) {
                     $editorialContact = array_shift($assignedEditors);
                 }
                 $paramArray = array('editorialContactName' => $editorialContact->getEditorFullName(), 'copyeditorName' => $user->getFullName());
             }
             $email->assignParams($paramArray);
         }
         $email->displayEditForm($request->url(null, 'copyeditor', 'completeFinalCopyedit', 'send'), array('articleId' => $copyeditorSubmission->getId()));
         return false;
     }
 }
开发者ID:ramonsodoma,项目名称:ojs,代码行数:64,代码来源:CopyeditorAction.inc.php

示例11: 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;
 }
开发者ID:elavaud,项目名称:hrp_ct,代码行数:80,代码来源:ReviewerAction.inc.php

示例12: emailEditorDecisionComment

 /**
  * Email editor decision comment.
  * @param $authorSubmission object
  * @param $send boolean
  * @param $request object
  */
 function emailEditorDecisionComment($authorSubmission, $send, $request)
 {
     $userDao =& DAORegistry::getDAO('UserDAO');
     $journal =& $request->getJournal();
     $user =& $request->getUser();
     import('classes.mail.ArticleMailTemplate');
     $email = new ArticleMailTemplate($authorSubmission);
     $editAssignments = $authorSubmission->getEditAssignments();
     $editors = array();
     foreach ($editAssignments as $editAssignment) {
         array_push($editors, $userDao->getUser($editAssignment->getEditorId()));
     }
     if ($send && !$email->hasErrors()) {
         HookRegistry::call('AuthorAction::emailEditorDecisionComment', array(&$authorSubmission, &$email));
         $email->send($request);
         $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
         $articleComment = new ArticleComment();
         $articleComment->setCommentType(COMMENT_TYPE_EDITOR_DECISION);
         $articleComment->setRoleId(ROLE_ID_AUTHOR);
         $articleComment->setArticleId($authorSubmission->getId());
         $articleComment->setAuthorId($authorSubmission->getUserId());
         $articleComment->setCommentTitle($email->getSubject());
         $articleComment->setComments($email->getBody());
         $articleComment->setDatePosted(Core::getCurrentDate());
         $articleComment->setViewable(true);
         $articleComment->setAssocId($authorSubmission->getId());
         $articleCommentDao->insertArticleComment($articleComment);
         return true;
     } else {
         if (!$request->getUserVar('continued')) {
             $email->setSubject($authorSubmission->getLocalizedTitle());
             if (!empty($editors)) {
                 foreach ($editors as $editor) {
                     $email->addRecipient($editor->getEmail(), $editor->getFullName());
                 }
             } else {
                 $email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
             }
         }
         $email->displayEditForm(Request::url(null, null, 'emailEditorDecisionComment', 'send'), array('articleId' => $authorSubmission->getId()), 'submission/comment/editorDecisionEmail.tpl');
         return false;
     }
 }
开发者ID:jasonzou,项目名称:OJS-2.4.6,代码行数:49,代码来源:AuthorAction.inc.php

示例13: completeLayoutEditing

 /**
  * Marks layout assignment as completed.
  * @param $submission object
  * @param $send boolean
  */
 function completeLayoutEditing($submission, $send = false)
 {
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $journal =& Request::getJournal();
     $layoutSignoff = $signoffDao->build('SIGNOFF_LAYOUT', ASSOC_TYPE_ARTICLE, $submission->getArticleId());
     if ($layoutSignoff->getDateCompleted() != null) {
         return true;
     }
     import('classes.mail.ArticleMailTemplate');
     $email = new ArticleMailTemplate($submission, 'LAYOUT_COMPLETE');
     $editAssignments =& $submission->getEditAssignments();
     if (empty($editAssignments)) {
         return;
     }
     if (!$email->isEnabled() || $send && !$email->hasErrors()) {
         HookRegistry::call('LayoutEditorAction::completeLayoutEditing', array(&$submission, &$editAssignments, &$email));
         if ($email->isEnabled()) {
             $email->setAssoc(ARTICLE_EMAIL_LAYOUT_NOTIFY_COMPLETE, ARTICLE_EMAIL_TYPE_LAYOUT, $layoutSignoff->getId());
             $email->send();
         }
         $layoutSignoff->setDateCompleted(Core::getCurrentDate());
         $signoffDao->updateObject($layoutSignoff);
         // Add log entry
         $user =& Request::getUser();
         import('classes.article.log.ArticleLog');
         import('classes.article.log.ArticleEventLogEntry');
         ArticleLog::logEvent($submission->getArticleId(), ARTICLE_LOG_LAYOUT_COMPLETE, ARTICLE_LOG_TYPE_LAYOUT, $user->getId(), 'log.layout.layoutEditComplete', array('editorName' => $user->getFullName(), 'articleId' => $submission->getArticleId()));
         return true;
     } else {
         $user =& Request::getUser();
         if (!Request::getUserVar('continued')) {
             $assignedSectionEditors = $email->toAssignedEditingSectionEditors($submission->getArticleId());
             $assignedEditors = $email->ccAssignedEditors($submission->getArticleId());
             if (empty($assignedSectionEditors) && empty($assignedEditors)) {
                 $email->addRecipient($journal->getSetting('contactEmail'), $journal->getSetting('contactName'));
                 $editorialContactName = $journal->getSetting('contactName');
             } else {
                 $editorialContact = array_shift($assignedSectionEditors);
                 if (!$editorialContact) {
                     $editorialContact = array_shift($assignedEditors);
                 }
                 $editorialContactName = $editorialContact->getEditorFullName();
             }
             $paramArray = array('editorialContactName' => $editorialContactName, 'layoutEditorName' => $user->getFullName());
             $email->assignParams($paramArray);
         }
         $email->displayEditForm(Request::url(null, 'layoutEditor', 'completeAssignment', 'send'), array('articleId' => $submission->getArticleId()));
         return false;
     }
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:56,代码来源:LayoutEditorAction.inc.php

示例14: emailEditorDecisionComment

 /**
  * Email editor decision comment
  * @param $sectionEditorSubmission object
  * @param $send boolean
  */
 function emailEditorDecisionComment($sectionEditorSubmission, $send)
 {
     $userDao =& DAORegistry::getDAO('UserDAO');
     $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
     $sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
     $journal =& Request::getJournal();
     $user =& Request::getUser();
     import('classes.mail.ArticleMailTemplate');
     $decisionTemplateMap = array(SUBMISSION_SECTION_DECISION_APPROVED => 'SECTION_DECISION_APPROVED', SUBMISSION_SECTION_DECISION_RESUBMIT => 'SECTION_DECISION_RESUBMIT', SUBMISSION_SECTION_DECISION_INCOMPLETE => 'SECTION_DECISION_INCOMPLETE', SUBMISSION_SECTION_DECISION_DECLINED => 'SECTION_DECISION_DECLINE', SUBMISSION_SECTION_DECISION_EXEMPTED => 'SECTION_DECISION_EXEMPT');
     $decision = $sectionEditorSubmission->getLastSectionDecision();
     if ($decision->getDecision() == SUBMISSION_SECTION_DECISION_APPROVED && $decision->getReviewType() == REVIEW_TYPE_FR) {
         $email = new ArticleMailTemplate($sectionEditorSubmission, null, 'SECTION_DECISION_FR_APPROVED');
     } elseif ($decision->getDecision() == SUBMISSION_SECTION_DECISION_EXEMPTED && $decision->getComments() == null) {
         return true;
     } else {
         $email = new ArticleMailTemplate($sectionEditorSubmission, null, isset($decisionTemplateMap[$decision->getDecision()]) ? $decisionTemplateMap[$decision->getDecision()] : null);
     }
     $copyeditor = $sectionEditorSubmission->getUserBySignoffType('SIGNOFF_COPYEDITING_INITIAL');
     if ($send && !$email->hasErrors()) {
         HookRegistry::call('SectionEditorAction::emailEditorDecisionComment', array(&$sectionEditorSubmission, &$send));
         $email->send();
         $articleComment = new ArticleComment();
         $articleComment->setCommentType(COMMENT_TYPE_SECTION_DECISION);
         $articleComment->setRoleId(Validation::isEditor() ? ROLE_ID_EDITOR : ROLE_ID_SECTION_EDITOR);
         $articleComment->setArticleId($sectionEditorSubmission->getArticleId());
         $articleComment->setAuthorId($user->getUserId());
         $articleComment->setCommentTitle($email->getSubject());
         $articleComment->setComments($email->getBody());
         $articleComment->setDatePosted(Core::getCurrentDate());
         $articleComment->setViewable(true);
         $articleComment->setAssocId($sectionEditorSubmission->getArticleId());
         $articleCommentDao->insertArticleComment($articleComment);
         return true;
     } else {
         if (!Request::getUserVar('continued')) {
             $authorUser =& $userDao->getUser($sectionEditorSubmission->getUserId());
             $authorEmail = $authorUser->getEmail();
             $email->assignParams(array('editorialContactSignature' => $user->getContactSignature(), 'authorName' => $authorUser->getFullName(), 'urlOngoing' => Request::url(null, 'author', 'index', 'ongoingResearches'), 'urlDrafts' => Request::url(null, 'author', 'index', 'proposalsToSubmit'), 'url' => Request::url(null, 'author', 'submissionReview', $sectionEditorSubmission->getArticleId()), 'reviewType' => Locale::translate($decision->getReviewTypeKey()), 'journalTitle' => $journal->getLocalizedTitle()));
             $email->addRecipient($authorEmail, $authorUser->getFullName());
             if ($journal->getSetting('notifyAllAuthorsOnDecision')) {
                 foreach ($sectionEditorSubmission->getAuthors() as $author) {
                     if ($author->getEmail() != $authorEmail) {
                         $email->addCc($author->getEmail(), $author->getFullName());
                     }
                 }
             }
             import('classes.file.TemporaryFileManager');
             $temporaryFileManager = new TemporaryFileManager();
             $decisionFiles =& $decision->getDecisionFiles();
             foreach ($decisionFiles as $file) {
                 if ($file) {
                     $temporaryFile = $temporaryFileManager->articleToTemporaryFile($file, $user->getId());
                     $email->addPersistAttachment($temporaryFile);
                 }
             }
         } elseif (Request::getUserVar('importPeerReviews')) {
             $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
             $reviewAssignments =& $reviewAssignmentDao->getByDecisionId($sectionEditorSubmission->getLastSectionDecisionId());
             $reviewIndexes =& $reviewAssignmentDao->getReviewIndexesForDecision($sectionEditorSubmission->getLastSectionDecisionId());
             $body = '';
             foreach ($reviewAssignments as $reviewAssignment) {
                 // If the reviewer has completed the assignment, then import the review.
                 if ($reviewAssignment->getDateCompleted() != null && !$reviewAssignment->getCancelled()) {
                     // Get the comments associated with this review assignment
                     $articleComments =& $articleCommentDao->getArticleComments($sectionEditorSubmission->getArticleId(), COMMENT_TYPE_PEER_REVIEW, $reviewAssignment->getId());
                     if ($articleComments) {
                         $body .= "------------------------------------------------------\n";
                         $body .= Locale::translate('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => chr(ord('A') + $reviewIndexes[$reviewAssignment->getId()]))) . "\n";
                         if (is_array($articleComments)) {
                             foreach ($articleComments as $comment) {
                                 // If the comment is viewable by the author, then add the comment.
                                 if ($comment->getViewable()) {
                                     $body .= String::html2text($comment->getComments()) . "\n\n";
                                 }
                             }
                         }
                         $body .= "------------------------------------------------------\n\n";
                     }
                     if ($reviewFormId = $reviewAssignment->getReviewFormId()) {
                         $reviewId = $reviewAssignment->getId();
                         $reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO');
                         $reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO');
                         $reviewFormElements =& $reviewFormElementDao->getReviewFormElements($reviewFormId);
                         if (!$articleComments) {
                             $body .= "------------------------------------------------------\n";
                             $body .= Locale::translate('submission.comments.importPeerReviews.reviewerLetter', array('reviewerLetter' => chr(ord('A') + $reviewIndexes[$reviewAssignment->getId()]))) . "\n\n";
                         }
                         foreach ($reviewFormElements as $reviewFormElement) {
                             if ($reviewFormElement->getIncluded()) {
                                 $body .= String::html2text($reviewFormElement->getLocalizedQuestion()) . ": \n";
                                 $reviewFormResponse = $reviewFormResponseDao->getReviewFormResponse($reviewId, $reviewFormElement->getId());
                                 if ($reviewFormResponse) {
                                     $possibleResponses = $reviewFormElement->getLocalizedPossibleResponses();
                                     if (in_array($reviewFormElement->getElementType(), $reviewFormElement->getMultipleResponsesElementTypes())) {
                                         if ($reviewFormElement->getElementType() == REVIEW_FORM_ELEMENT_TYPE_CHECKBOXES) {
//.........这里部分代码省略.........
开发者ID:JovanyJeff,项目名称:hrp,代码行数:101,代码来源:SectionEditorAction.inc.php

示例15: proofreadEmail


//.........这里部分代码省略.........
             if (!isset($receiver)) {
                 return true;
             }
             $receiverName = $receiver->getFullName();
             $receiverAddress = $receiver->getEmail();
             $email->ccAssignedEditingSectionEditors($sectionEditorSubmission->getId());
             $addParamArray = array('layoutEditorName' => $receiverName, 'layoutEditorUsername' => $receiver->getUsername(), 'layoutEditorPassword' => $receiver->getPassword(), 'editorialContactSignature' => $user->getContactSignature(), 'submissionUrl' => Request::url(null, 'proofreader', 'submission', $articleId));
             if (!$actionPath) {
                 // Reset underway/complete/thank dates
                 $signoffReset = $signoffDao->build($signoffType, ASSOC_TYPE_ARTICLE, $articleId);
                 $signoffReset->setDateUnderway(null);
                 $signoffReset->setDateCompleted(null);
                 $signoffReset->setDateAcknowledged(null);
             }
             break;
         case 'PROOFREAD_LAYOUT_ACK':
             $eventType = ARTICLE_EMAIL_PROOFREAD_THANK_LAYOUTEDITOR;
             $signoffType = 'SIGNOFF_PROOFREADING_LAYOUT';
             $setDateField = 'setDateAcknowledged';
             $receiver = $sectionEditorSubmission->getUserBySignoffType($signoffType);
             if (!isset($receiver)) {
                 return true;
             }
             $receiverName = $receiver->getFullName();
             $receiverAddress = $receiver->getEmail();
             $email->ccAssignedEditingSectionEditors($sectionEditorSubmission->getId());
             $addParamArray = array('layoutEditorName' => $receiverName, 'editorialContactSignature' => $user->getContactSignature());
             break;
         case 'PROOFREAD_LAYOUT_COMPLETE':
             $eventType = ARTICLE_EMAIL_PROOFREAD_NOTIFY_LAYOUTEDITOR_COMPLETE;
             $signoffType = 'SIGNOFF_PROOFREADING_LAYOUT';
             $setDateField = 'setDateCompleted';
             $getDateField = 'getDateCompleted';
             $editAssignments =& $sectionEditorSubmission->getEditAssignments();
             $assignmentIndex = 0;
             $editorAdded = false;
             foreach ($editAssignments as $editAssignment) {
                 if ($editAssignment->getIsEditor() || $editAssignment->getCanEdit()) {
                     if ($assignmentIndex++ == 0) {
                         $receiverName = $editAssignment->getEditorFullName();
                         $receiverAddress = $editAssignment->getEditorEmail();
                     } else {
                         $ccs[$editAssignment->getEditorEmail()] = $editAssignment->getEditorFullName();
                     }
                     $editorAdded = true;
                 }
             }
             if (!$editorAdded) {
                 $receiverAddress = $journal->getSetting('contactEmail');
                 $receiverName = $journal->getSetting('contactName');
             }
             $addParamArray = array('editorialContactName' => $receiverName, 'layoutEditorName' => $user->getFullName());
             break;
         default:
             return true;
     }
     $signoff = $signoffDao->build($signoffType, ASSOC_TYPE_ARTICLE, $articleId);
     if (isset($getDateField)) {
         $date = $signoff->{$getDateField}();
         if (isset($date)) {
             Request::redirect(null, null, 'submission', $articleId);
         }
     }
     if ($email->isEnabled() && ($actionPath || $email->hasErrors())) {
         if (!Request::getUserVar('continued')) {
             $email->addRecipient($receiverAddress, $receiverName);
             if (isset($ccs)) {
                 foreach ($ccs as $address => $name) {
                     $email->addCc($address, $name);
                 }
             }
             $paramArray = array();
             if (isset($addParamArray)) {
                 $paramArray += $addParamArray;
             }
             $email->assignParams($paramArray);
         }
         $email->displayEditForm($actionPath, array('articleId' => $articleId));
         return false;
     } else {
         HookRegistry::call('ProofreaderAction::proofreadEmail', array(&$email, $mailType));
         if ($email->isEnabled()) {
             $email->send($request);
         }
         $signoff->{$setDateField}(Core::getCurrentDate());
         if (isset($setNextDateField)) {
             $nextSignoff->{$setNextDateField}(Core::getCurrentDate());
         }
         if (isset($nullifyDateFields)) {
             foreach ($nullifyDateFields as $fieldSetter) {
                 $signoff->{$fieldSetter}(null);
             }
         }
         $signoffDao->updateObject($signoff);
         if (isset($nextSignoff)) {
             $signoffDao->updateObject($nextSignoff);
         }
         return true;
     }
 }
开发者ID:ramonsodoma,项目名称:ojs,代码行数:101,代码来源:ProofreaderAction.inc.php


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