Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
SendReviewsForm.inc.php
1 <?php
2 
17 import('lib.pkp.controllers.modals.editorDecision.form.EditorDecisionWithEmailForm');
18 
19 // Access decision actions constants.
20 import('classes.workflow.EditorDecisionActionsManager');
21 
30  function SendReviewsForm($submission, $decision, $stageId, $reviewRound = null) {
31  if (!in_array($decision, $this->_getDecisions())) {
32  fatalError('Invalid decision!');
33  }
34 
35  $this->setSaveFormOperation('saveSendReviews');
36 
37  parent::EditorDecisionWithEmailForm(
38  $submission, $decision, $stageId,
39  'controllers/modals/editorDecision/form/sendReviewsForm.tpl', $reviewRound
40  );
41  }
42 
43 
44  //
45  // Implement protected template methods from Form
46  //
50  function initData($args, $request) {
52 
53  return parent::initData($args, $request, $actionLabels);
54  }
55 
59  function execute($args, $request) {
60  // Retrieve the submission.
61  $submission = $this->getSubmission();
62 
63  // Get this form decision actions labels.
65 
66  // Record the decision.
67  $reviewRound = $this->getReviewRound();
68  $decision = $this->getDecision();
69  $stageId = $this->getStageId();
70  import('lib.pkp.classes.submission.action.EditorAction');
71  $editorAction = new EditorAction();
72  $editorAction->recordDecision($request, $submission, $decision, $actionLabels, $reviewRound, $stageId);
73 
74  // Identify email key and status of round.
75  switch ($decision) {
76  case SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS:
77  $emailKey = 'EDITOR_DECISION_REVISIONS';
78  $status = REVIEW_ROUND_STATUS_REVISIONS_REQUESTED;
79  break;
80 
81  case SUBMISSION_EDITOR_DECISION_RESUBMIT:
82  $emailKey = 'EDITOR_DECISION_RESUBMIT';
83  $status = REVIEW_ROUND_STATUS_RESUBMITTED;
84  break;
85 
86  case SUBMISSION_EDITOR_DECISION_DECLINE:
87  $emailKey = 'SUBMISSION_UNSUITABLE';
88  $status = REVIEW_ROUND_STATUS_DECLINED;
89  break;
90 
91  default:
92  fatalError('Unsupported decision!');
93  }
94 
95  // Update the submission status
96  if ($decision == SUBMISSION_EDITOR_DECISION_DECLINE) {
97  $submission->setStatus(STATUS_DECLINED);
98  $submissionDao = Application::getSubmissionDAO();
99  $submissionDao->updateObject($submission);
100  }
101 
102  $this->_updateReviewRoundStatus($submission, $status, $reviewRound);
103 
104  // Send email to the author.
105  $this->_sendReviewMailToAuthor($submission, $emailKey, $request);
106  }
107 
108  //
109  // Private functions
110  //
115  function _getDecisions() {
116  return array(
117  SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS,
118  SUBMISSION_EDITOR_DECISION_RESUBMIT,
119  SUBMISSION_EDITOR_DECISION_DECLINE
120  );
121  }
122 }
123 
124 ?>
Form to request additional work from the author (Request revisions or resubmit for review)...
initData($args, $request)
Base class for the editor decision forms.
execute($args, $request)
static getSubmissionDAO()
_updateReviewRoundStatus($submission, $status, $reviewRound=null)
_sendReviewMailToAuthor($submission, $emailKey, $request)
SendReviewsForm($submission, $decision, $stageId, $reviewRound=null)
Editor actions.