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


PHP ArticleMailTemplate::getFrom方法代码示例

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


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

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