• Main Page
  • Modules
  • Classes
  • Files
  • File List

controllers/modals/editorDecision/form/SendReviewsForm.inc.php

00001 <?php
00002 
00016 import('controllers.modals.editorDecision.form.EditorDecisionWithEmailForm');
00017 
00018 // Access decision actions constants.
00019 import('classes.workflow.EditorDecisionActionsManager');
00020 
00021 class SendReviewsForm extends EditorDecisionWithEmailForm {
00029    function SendReviewsForm($seriesEditorSubmission, $decision, $stageId, $reviewRound = null) {
00030       if (!in_array($decision, $this->_getDecisions())) {
00031          fatalError('Invalid decision!');
00032       }
00033 
00034       $this->setSaveFormOperation('saveSendReviews');
00035 
00036       parent::EditorDecisionWithEmailForm(
00037          $seriesEditorSubmission, $decision, $stageId,
00038          'controllers/modals/editorDecision/form/sendReviewsForm.tpl', $reviewRound
00039       );
00040    }
00041 
00042 
00043    //
00044    // Implement protected template methods from Form
00045    //
00049    function initData($args, &$request) {
00050       $actionLabels = EditorDecisionActionsManager::getActionLabels($this->_getDecisions());
00051 
00052       return parent::initData($args, $request, $actionLabels);
00053    }
00054 
00058    function execute($args, &$request) {
00059       // Retrieve the submission.
00060       $seriesEditorSubmission =& $this->getSeriesEditorSubmission();
00061 
00062       // Get this form decision actions labels.
00063       $actionLabels = EditorDecisionActionsManager::getActionLabels($this->_getDecisions());
00064 
00065       // Record the decision.
00066       $reviewRound =& $this->getReviewRound();
00067       $decision = $this->getDecision();
00068       $stageId = $this->getStageId();
00069       import('classes.submission.seriesEditor.SeriesEditorAction');
00070       $seriesEditorAction = new SeriesEditorAction();
00071       $seriesEditorAction->recordDecision($request, $seriesEditorSubmission, $decision, $actionLabels, $reviewRound, $stageId);
00072 
00073       // Identify email key and status of round.
00074       switch ($decision) {
00075          case SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS:
00076             $emailKey = 'SUBMISSION_UNSUITABLE';
00077             $status = REVIEW_ROUND_STATUS_REVISIONS_REQUESTED;
00078             break;
00079 
00080          case SUBMISSION_EDITOR_DECISION_RESUBMIT:
00081             $emailKey = 'EDITOR_DECISION_RESUBMIT';
00082             $status = REVIEW_ROUND_STATUS_RESUBMITTED;
00083             break;
00084 
00085          case SUBMISSION_EDITOR_DECISION_DECLINE:
00086             $emailKey = 'SUBMISSION_UNSUITABLE';
00087             $status = REVIEW_ROUND_STATUS_DECLINED;
00088             break;
00089 
00090          default:
00091             fatalError('Unsupported decision!');
00092       }
00093 
00094       $this->_updateReviewRoundStatus($seriesEditorSubmission, $status, $reviewRound);
00095 
00096       // Send email to the author.
00097       $this->_sendReviewMailToAuthor($seriesEditorSubmission, $emailKey, $request);
00098    }
00099 
00100    //
00101    // Private functions
00102    //
00107    function _getDecisions() {
00108       return array(
00109          SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS,
00110          SUBMISSION_EDITOR_DECISION_RESUBMIT,
00111          SUBMISSION_EDITOR_DECISION_DECLINE
00112       );
00113    }
00114 }
00115 
00116 ?>

Generated on Mon Sep 17 2012 13:58:56 for Open Monograph Press by  doxygen 1.7.1