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


PHP Action::assignDefaultStageParticipants方法代码示例

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


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

示例1: execute

 /**
  * Start review stage
  * @param $args array
  * @param $request PKPRequest
  * @see Form::execute()
  */
 function execute($args, &$request)
 {
     // 1. Increment the monograph's workflow stage
     $monograph =& $this->getMonograph();
     $monograph->setCurrentStageId(WORKFLOW_STAGE_ID_INTERNAL_REVIEW);
     $monographDao =& DAORegistry::getDAO('MonographDAO');
     $monographDao->updateMonograph($monograph);
     // 2. Create a new internal review round
     // FIXME #6102: What to do with reviewType?
     $reviewRoundDao =& DAORegistry::getDAO('ReviewRoundDAO');
     $reviewRoundDao->build($monograph->getId(), REVIEW_TYPE_INTERNAL, 1, 1, REVIEW_ROUND_STATUS_PENDING_REVIEWERS);
     // 3. Assign the default users
     import('classes.submission.common.Action');
     Action::assignDefaultStageParticipants($monograph->getId(), WORKFLOW_STAGE_ID_INTERNAL_REVIEW);
     // 4. Add the selected files to the new round
     $selectedFiles = $this->getData('selectedFiles');
     if (is_array($selectedFiles)) {
         $filesForReview = array();
         foreach ($selectedFiles as $selectedFile) {
             $filesForReview[] = explode("-", $selectedFile);
         }
         $reviewRoundDAO =& DAORegistry::getDAO('ReviewRoundDAO');
         $reviewRoundDAO->setFilesForReview($monograph->getId(), REVIEW_TYPE_INTERNAL, 1, $filesForReview);
     }
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:31,代码来源:InitiateReviewForm.inc.php

示例2: execute

 /**
  * Save editor decision
  * @param $args array
  * @param $request PKPRequest
  * @see Form::execute()
  */
 function execute($args, &$request)
 {
     import('classes.submission.seriesEditor.SeriesEditorAction');
     $monographDao =& DAORegistry::getDAO('MonographDAO');
     $reviewRoundDao =& DAORegistry::getDAO('ReviewRoundDAO');
     $monograph =& $this->getMonograph();
     $decision = $this->getDecision();
     switch ($decision) {
         case SUBMISSION_EDITOR_DECISION_ACCEPT:
             // 1. Record the decision
             SeriesEditorAction::recordDecision($monograph, SUBMISSION_EDITOR_DECISION_ACCEPT);
             // 2. select email key
             $emailKey = 'EDITOR_DECISION_ACCEPT';
             // 3. Set status of round
             $status = REVIEW_ROUND_STATUS_ACCEPTED;
             // 4. Assign the default users to the next workflow stage
             Action::assignDefaultStageParticipants($monograph->getId(), WORKFLOW_STAGE_ID_EDITING);
             $monograph->setCurrentStageId(WORKFLOW_STAGE_ID_EDITING);
             $monographDao->updateMonograph($monograph);
             break;
         case SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW:
             // 1. Record the decision
             SeriesEditorAction::recordDecision($monograph, SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW);
             // 2. Create a new external review round
             $reviewRoundDao->build($monograph->getId(), REVIEW_TYPE_EXTERNAL, 1, 1);
             // 3. Get selected files and put in review_round_files table
             $selectedFiles = $this->getData('selectedFiles');
             $filesForReview = array();
             foreach ($selectedFiles as $selectedFile) {
                 $filesForReview[] = explode("-", $selectedFile);
             }
             $reviewRoundDao->setFilesForReview($monograph->getId(), REVIEW_TYPE_EXTERNAL, 1, $filesForReview);
             // 4. select email key
             // FIXME #6123: will we have an email key for this decision?
             $emailKey = 'EDITOR_DECISION_ACCEPT';
             // 5. Set status of round
             $status = REVIEW_ROUND_STATUS_SENT_TO_EXTERNAL;
             // 6. Assign the default users to the next workflow stage
             Action::assignDefaultStageParticipants($monograph->getId(), WORKFLOW_STAGE_ID_EXTERNAL_REVIEW);
             $monograph->setCurrentStageId(WORKFLOW_STAGE_ID_EXTERNAL_REVIEW);
             $monograph->setCurrentRound(1);
             $monographDao->updateMonograph($monograph);
             break;
         default:
             // only support the three decisions above
             assert(false);
     }
     $currentReviewRound =& $reviewRoundDao->build($monograph->getId(), $monograph->getCurrentReviewType(), $monograph->getCurrentRound());
     $currentReviewRound->setStatus($status);
     $reviewRoundDao->updateObject($currentReviewRound);
     // n. Send Personal message to author
     $submitter =& $monograph->getUser();
     import('classes.mail.MonographMailTemplate');
     $email =& new MonographMailTemplate($monograph, $emailKey, null, true);
     $email->setBody($this->getData('personalMessage'));
     $email->addRecipient($submitter->getEmail(), $submitter->getFullName());
     $email->setAssoc(MONOGRAPH_EMAIL_EDITOR_NOTIFY_AUTHOR, MONOGRAPH_EMAIL_TYPE_EDITOR, $currentReviewRound->getRound());
     // Attach the selected reviewer attachments
     $submissionFileDao =& DAORegistry::getDAO('SubmissionFileDAO');
     /* @var $submissionFileDao SubmissionFileDAO */
     $selectedAttachments = $this->getData('selectedAttachments') ? $this->getData('selectedAttachments') : array();
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $reviewIndexes =& $reviewAssignmentDao->getReviewIndexesForRound($monograph->getId(), $monograph->getCurrentRound());
     assert(is_array($reviewIndexes));
     if (is_array($selectedAttachments)) {
         foreach ($selectedAttachments as $attachmentId) {
             $monographFile =& $submissionFileDao->getLatestRevision($attachmentId);
             $fileName = $monographFile->getOriginalFileName();
             $reviewAssignmentId = $monographFile->getAssocId();
             assert($monographFile->getAssocType == ASSOC_TYPE_REVIEW_ASSIGNMENT);
             assert(is_numeric($reviewAssignmentId));
             $email->addAttachment($monographFile->getFilePath(), String::enumerateAlphabetically($reviewIndexes[$reviewAssignmentId]) . '-' . $monographFile->getOriginalFileName());
             // Update monograph to set viewable as true, so author can view the file on their submission summary page
             $monographFile->setViewable(true);
             $submissionFileDao->updateObject($monographFile);
         }
     }
     $email->send();
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:85,代码来源:PromoteForm.inc.php

示例3: execute

 /**
  * Save changes to monograph.
  * @return int the monograph ID
  */
 function execute()
 {
     $monographDao =& DAORegistry::getDAO('MonographDAO');
     $authorDao =& DAORegistry::getDAO('AuthorDAO');
     // Update monograph
     $monograph =& $this->monograph;
     $monograph->setTitle($this->getData('title'), null);
     // Localized
     $monograph->setAbstract($this->getData('abstract'), null);
     // Localized
     if (is_array($this->getData('agenciesKeywords'))) {
         $monograph->setSupportingAgencies(implode(", ", $this->getData('agenciesKeywords')), null);
     }
     // Localized
     if (is_array($this->getData('disciplinesKeywords'))) {
         $monograph->setDiscipline(implode(", ", $this->getData('disciplinesKeywords')), null);
     }
     // Localized
     if (is_array($this->getData('keywordKeywords'))) {
         $monograph->setSubject(implode(", ", $this->getData('keywordKeywords')), null);
     }
     // Localized
     if ($monograph->getSubmissionProgress() <= $this->step) {
         $monograph->setDateSubmitted(Core::getCurrentDate());
         $monograph->stampStatusModified();
         $monograph->setSubmissionProgress(0);
     }
     // Assign the default users to the submission workflow stage
     import('classes.submission.common.Action');
     Action::assignDefaultStageParticipants($monograph->getId(), WORKFLOW_STAGE_ID_SUBMISSION);
     // Save the monograph
     $monographDao->updateMonograph($monograph);
     return $this->monographId;
 }
开发者ID:ramonsodoma,项目名称:omp,代码行数:38,代码来源:SubmissionSubmitStep3Form.inc.php


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