コード例 #1
0
ファイル: PromoteForm.inc.php プロジェクト: jerico-dev/omp
 /**
  * @see Form::execute()
  */
 function execute($args, &$request)
 {
     // Retrieve the submission.
     $seriesEditorSubmission =& $this->getSeriesEditorSubmission();
     // Record the decision.
     $decision = $this->getDecision();
     import('classes.submission.seriesEditor.SeriesEditorAction');
     $seriesEditorAction = new SeriesEditorAction();
     $seriesEditorAction->recordDecision($seriesEditorSubmission, $decision);
     // Identify email key and status of round.
     switch ($decision) {
         case SUBMISSION_EDITOR_DECISION_ACCEPT:
             $emailKey = 'EDITOR_DECISION_ACCEPT';
             $status = REVIEW_ROUND_STATUS_ACCEPTED;
             // Move to the editing stage.
             $seriesEditorAction->incrementWorkflowStage($seriesEditorSubmission, WORKFLOW_STAGE_ID_EDITING);
             break;
         case SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW:
             $emailKey = 'EDITOR_DECISION_SEND_TO_EXTERNAL';
             $status = REVIEW_ROUND_STATUS_SENT_TO_EXTERNAL;
             // Move to the external review stage.
             $seriesEditorAction->incrementWorkflowStage($seriesEditorSubmission, WORKFLOW_STAGE_ID_EXTERNAL_REVIEW);
             // Create an initial external review round.
             $this->_initiateReviewRound($seriesEditorSubmission, REVIEW_TYPE_EXTERNAL, 1);
             break;
         default:
             // Unsupported decision.
             assert(false);
     }
     // Send email to the author.
     $this->_sendReviewMailToAuthor($seriesEditorSubmission, $status, $emailKey, $request);
 }
コード例 #2
0
 /**
  * @see Form::execute()
  */
 function execute($args, &$request)
 {
     // Retrieve the submission.
     $seriesEditorSubmission =& $this->getSeriesEditorSubmission();
     // Record the decision.
     $decision = $this->getDecision();
     import('classes.submission.seriesEditor.SeriesEditorAction');
     $seriesEditorAction = new SeriesEditorAction();
     $seriesEditorAction->recordDecision($seriesEditorSubmission, $decision);
     // Identify email key and status of round.
     switch ($decision) {
         case SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS:
             $emailKey = 'SUBMISSION_UNSUITABLE';
             $status = REVIEW_ROUND_STATUS_REVISIONS_REQUESTED;
             break;
         case SUBMISSION_EDITOR_DECISION_RESUBMIT:
             $emailKey = 'EDITOR_DECISION_RESUBMIT';
             $status = REVIEW_ROUND_STATUS_RESUBMITTED;
             break;
         case SUBMISSION_EDITOR_DECISION_DECLINE:
             $emailKey = 'SUBMISSION_UNSUITABLE';
             $status = REVIEW_ROUND_STATUS_DECLINED;
             break;
         default:
             // Unsupported decision.
             assert(false);
     }
     // Send email to the author.
     $this->_sendReviewMailToAuthor($seriesEditorSubmission, $status, $emailKey, $request);
 }
コード例 #3
0
 /**
  * Start new review round
  * @param $args array
  * @param $request PKPRequest
  * @return int The new review round number
  * @see Form::execute()
  */
 function execute($args, &$request)
 {
     import('classes.submission.seriesEditor.SeriesEditorAction');
     $monograph =& $this->getMonograph();
     $seriesEditorSubmissionDao =& DAORegistry::getDAO('SeriesEditorSubmissionDAO');
     $seriesEditorSubmission =& $seriesEditorSubmissionDao->getSeriesEditorSubmission($monograph->getId());
     // 1. Record the decision
     SeriesEditorAction::recordDecision($seriesEditorSubmission, SUBMISSION_EDITOR_DECISION_RESUBMIT);
     // 2. Create a new internal review round
     // FIXME #6102: What to do with reviewType?
     $newRound = $seriesEditorSubmission->getCurrentRound() ? $seriesEditorSubmission->getCurrentRound() + 1 : 1;
     $reviewRoundDao =& DAORegistry::getDAO('ReviewRoundDAO');
     $reviewRoundDao->build($monograph->getId(), REVIEW_TYPE_INTERNAL, $newRound, 1, REVIEW_ROUND_STATUS_PENDING_REVIEWERS);
     $seriesEditorSubmission->setCurrentRound($newRound);
     $seriesEditorSubmissionDao->updateSeriesEditorSubmission($seriesEditorSubmission);
     // 3. Add the selected files to the new round
     $selectedFiles = $this->getData('selectedFiles');
     $filesWithRevisions = array();
     if (is_array($selectedFiles)) {
         foreach ($selectedFiles as $selectedFile) {
             $filesWithRevisions[] = explode("-", $selectedFile);
         }
         $reviewRoundDAO =& DAORegistry::getDAO('ReviewRoundDAO');
         $reviewRoundDAO->setFilesForReview($monograph->getId(), REVIEW_TYPE_INTERNAL, $newRound, $filesWithRevisions);
     }
     return $newRound;
 }
コード例 #4
0
 /**
  * @see Form::execute()
  * @return integer The new review round number
  */
 function execute($args, &$request)
 {
     // Retrieve the submission.
     $seriesEditorSubmission =& $this->getSeriesEditorSubmission();
     // Record the decision.
     import('classes.submission.seriesEditor.SeriesEditorAction');
     $seriesEditorAction = new SeriesEditorAction();
     $seriesEditorAction->recordDecision($seriesEditorSubmission, SUBMISSION_EDITOR_DECISION_RESUBMIT);
     // Create a new review round.
     $newRound = $seriesEditorSubmission->getCurrentRound() + 1;
     $this->_initiateReviewRound($seriesEditorSubmission, $seriesEditorSubmission->getCurrentReviewType(), $newRound, REVIEW_ROUND_STATUS_PENDING_REVIEWERS);
     return $newRound;
 }
コード例 #5
0
ファイル: PromoteForm.inc.php プロジェクト: ramonsodoma/omp
 /**
  * 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();
 }