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


PHP ArticleMailTemplate::setFrom方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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];
     // 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_SECTION_DECISION_APPROVED) {
         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('lib.pkp.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);
         $notificationManager->createTrivialNotification(Locale::translate('notification.notification'), Locale::translate('plugins.generic.sword.automaticDepositComplete', array('itemTitle' => $sectionEditorSubmission->getLocalizedTitle(), 'repositoryName' => $depositPoint['name'])), NOTIFICATION_TYPE_SUCCESS, null, false);
     }
     if ($sendDepositNotification) {
         $submittingUser =& $sectionEditorSubmission->getUser();
         import('classes.mail.ArticleMailTemplate');
         $contactName = $journal->getSetting('contactName');
         $contactEmail = $journal->getSetting('contactEmail');
         $mail = new ArticleMailTemplate($sectionEditorSubmission, null, 'SWORD_DEPOSIT_NOTIFICATION', null, null, $journal, true, true);
         $mail->setFrom($contactEmail, $contactName);
         $mail->addRecipient($submittingUser->getEmail(), $submittingUser->getFullName());
         $mail->assignParams(array('journalName' => $journal->getLocalizedTitle(), 'articleTitle' => $sectionEditorSubmission->getLocalizedTitle(), 'swordDepositUrl' => Request::url(null, 'sword', 'index', $sectionEditorSubmission->getId())));
         $mail->send();
     }
     return false;
 }
开发者ID:JovanyJeff,项目名称:hrp,代码行数:56,代码来源:SwordPlugin.inc.php

示例6: 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

示例7: 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

示例8: execute

 /**
  * Save changes to article.
  */
 function execute()
 {
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     $ercReviewersDao =& DAORegistry::getDAO('ErcReviewersDAO');
     $institutionDao =& DAORegistry::getDAO('InstitutionDAO');
     $journal = Request::getJournal();
     $user = Request::getUser();
     // Update article
     $article =& $this->article;
     if ($article->getDateSubmitted() == null) {
         $year = substr(Core::getCurrentDate(), 0, 4);
         $countyear = $articleDao->getSubmissionsForYearCount($year) + 1;
         $pSponsor = $article->getArticlePrimarySponsor();
         $institution = $institutionDao->getInstitutionById($pSponsor->getInstitutionId());
         $article->setProposalId($year . '-' . $countyear . '-' . $institution->getInstitutionAcronym());
     }
     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);
     $sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
     $sectionEditors =& $sectionEditorsDao->getEditorsBySectionId($journal->getId(), $article->getSectionId());
     $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, null, 'SUBMISSION_ACK', null, null, null, false);
     foreach ($sectionEditors as $sectionEditor) {
         // If one of the secretary is the chair of the committee, send from the chair, if not, take the last secretary in the array
         $from = $mail->getFrom();
         if ($ercReviewersDao->isErcReviewer($journal->getId(), $sectionEditor->getId(), REVIEWER_CHAIR)) {
             $mail->setFrom($sectionEditor->getEmail(), $sectionEditor->getFullName());
         } elseif ($from['email'] == $user->getEmail()) {
             $mail->setFrom($sectionEditor->getEmail(), $sectionEditor->getFullName());
         }
         $mail->addBcc($sectionEditor->getEmail(), $sectionEditor->getFullName());
         unset($sectionEditor);
     }
     if ($mail->isEnabled()) {
         $mail->addRecipient($user->getEmail(), $user->getFullName());
         if ($journal->getSetting('copySubmissionAckSpecified')) {
             $copyAddress = $journal->getSetting('copySubmissionAckAddress');
             if (!empty($copyAddress)) {
                 $mail->addBcc($copyAddress);
             }
         }
         $section = $sectionDao->getSection($article->getSectionId());
         $mail->assignParams(array('authorName' => $user->getFullName(), 'authorUsername' => $user->getUsername(), 'address' => $sectionDao->getSettingValue($article->getSectionId(), 'address'), 'bankAccount' => $sectionDao->getSettingValue($article->getSectionId(), 'bankAccount'), 'proposalId' => $article->getProposalId(), 'submissionUrl' => Request::url(null, 'author', 'submission', $article->getId())));
         $mail->send();
     }
     // Send a regular notification to section editors
     $lastDecision = $article->getLastSectionDecision();
     switch ($lastDecision->getReviewType()) {
         case REVIEW_TYPE_INITIAL:
             if ($lastDecision->getRound() == 1) {
                 $message = 'notification.type.articleSubmitted.initialReview';
             } else {
                 $message = 'notification.type.articleReSubmitted.initialReview';
             }
             break;
         case REVIEW_TYPE_PR:
             if ($lastDecision->getRound() == 1) {
                 $message = 'notification.type.articleSubmitted.continuingReview';
//.........这里部分代码省略.........
开发者ID:elavaud,项目名称:hrp_ct,代码行数:101,代码来源:AuthorSubmitStep9Form.inc.php


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