Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
EditorDecisionActionsManager.inc.php
1 <?php
2 
16 // Submission stage decision actions.
17 define('SUBMISSION_EDITOR_DECISION_INTERNAL_REVIEW', 1);
18 
19 // Submission and review stages decision actions.
20 define('SUBMISSION_EDITOR_DECISION_ACCEPT', 2);
21 define('SUBMISSION_EDITOR_DECISION_DECLINE', 6);
22 
23 // Review stage decisions actions.
24 define('SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW', 3);
25 define('SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS', 4);
26 define('SUBMISSION_EDITOR_DECISION_RESUBMIT', 5);
27 
28 // Editorial stage decision actions.
29 define('SUBMISSION_EDITOR_DECISION_SEND_TO_PRODUCTION', 7);
30 
32 
38  function getActionLabels($decisions) {
39  $allDecisionsData = array();
40  $allDecisionsData =
41  self::_submissionStageDecisions() +
42  self::_internalReviewStageDecisions() +
43  self::_externalReviewStageDecisions() +
44  self::_editorialStageDecisions();
45 
46  $actionLabels = array();
47  foreach($decisions as $decision) {
48  if ($allDecisionsData[$decision]['title']) {
49  $actionLabels[$decision] = $allDecisionsData[$decision]['title'];
50  } else {
51  assert(false);
52  }
53  }
54 
55  return $actionLabels;
56  }
57 
64  function getEditorTakenActionInReviewRound($reviewRound, $decisions = array()) {
65  $editDecisionDao = DAORegistry::getDAO('EditDecisionDAO');
66  $editorDecisions = $editDecisionDao->getEditorDecisions($reviewRound->getSubmissionId(), $reviewRound->getStageId(), $reviewRound->getRound());
67 
68  if (empty($decisions)) {
69  $decisions = array_keys(self::_internalReviewStageDecisions());
70  }
71  $takenDecision = false;
72  foreach ($editorDecisions as $decision) {
73  if (in_array($decision['decision'], $decisions)) {
74  $takenDecision = true;
75  break;
76  }
77  }
78 
79  return $takenDecision;
80  }
81 
86  function getStageDecisions($stageId) {
87  switch ($stageId) {
88  case WORKFLOW_STAGE_ID_SUBMISSION:
89  return self::_submissionStageDecisions();
90  case WORKFLOW_STAGE_ID_INTERNAL_REVIEW:
91  return self::_internalReviewStageDecisions();
92  case WORKFLOW_STAGE_ID_EXTERNAL_REVIEW:
93  return self::_externalReviewStageDecisions();
94  case WORKFLOW_STAGE_ID_EDITING:
95  return self::_editorialStageDecisions();
96  default:
97  assert(false);
98  }
99  }
100 
101  //
102  // Private helper methods.
103  //
109  static $decisions = array(
110  SUBMISSION_EDITOR_DECISION_INTERNAL_REVIEW => array(
111  'name' => 'internalReview',
112  'operation' => 'internalReview',
113  'title' => 'editor.submission.decision.sendInternalReview',
114  'image' => 'advance',
115  'titleIcon' => 'modal_review',
116  ),
117  SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW => array(
118  'operation' => 'externalReview',
119  'name' => 'externalReview',
120  'title' => 'editor.submission.decision.sendExternalReview',
121  'image' => 'advance',
122  'titleIcon' => 'modal_review',
123  ),
124  SUBMISSION_EDITOR_DECISION_ACCEPT => array(
125  'name' => 'accept',
126  'operation' => 'promote',
127  'title' => 'editor.submission.decision.accept',
128  'image' => 'promote',
129  'help' => 'editor.review.NotifyAuthorAccept',
130  'titleIcon' => 'accept_submission',
131  ),
132  SUBMISSION_EDITOR_DECISION_DECLINE => array(
133  'name' => 'decline',
134  'operation' => 'sendReviews',
135  'title' => 'editor.submission.decision.decline',
136  'image' => 'decline',
137  'help' => 'editor.review.NotifyAuthorDecline',
138  'titleIcon' => 'decline_submission',
139  ),
140  );
141 
142  return $decisions;
143  }
144 
150  static $decisions = array(
151  SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS => array(
152  'operation' => 'sendReviewsInReview',
153  'name' => 'requestRevisions',
154  'title' => 'editor.submission.decision.requestRevisions',
155  'image' => 'revisions',
156  'help' => 'editor.review.NotifyAuthorRevisions',
157  'titleIcon' => 'revisions_required',
158  ),
159  SUBMISSION_EDITOR_DECISION_RESUBMIT => array(
160  'operation' => 'sendReviewsInReview',
161  'name' => 'resubmit',
162  'title' => 'editor.submission.decision.resubmit',
163  'image' => 'resubmit',
164  'help' => 'editor.review.NotifyAuthorResubmit',
165  'titleIcon' => 'please_resubmit',
166  ),
167  SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW => array(
168  'operation' => 'promoteInReview',
169  'name' => 'externalReview',
170  'title' => 'editor.submission.decision.sendExternalReview',
171  'image' => 'advance',
172  'help' => 'editor.review.NotifyAuthorExternal',
173  'titleIcon' => 'modal_review',
174  ),
175  SUBMISSION_EDITOR_DECISION_ACCEPT => array(
176  'operation' => 'promoteInReview',
177  'name' => 'accept',
178  'title' => 'editor.submission.decision.accept',
179  'image' => 'promote',
180  'help' => 'editor.review.NotifyAuthorAccept',
181  'titleIcon' => 'accept_submission',
182  ),
183  SUBMISSION_EDITOR_DECISION_DECLINE => array(
184  'operation' => 'sendReviewsInReview',
185  'name' => 'decline',
186  'title' => 'editor.submission.decision.decline',
187  'image' => 'decline',
188  'help' => 'editor.review.NotifyAuthorDecline',
189  'titleIcon' => 'decline_submission',
190  ),
191  );
192 
193  return $decisions;
194  }
195 
201  $decisions = self::_internalReviewStageDecisions();
202  unset($decisions[SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW]);
203  return $decisions;
204  }
205 
206 
212  static $decisions = array(
213  SUBMISSION_EDITOR_DECISION_SEND_TO_PRODUCTION => array(
214  'operation' => 'promote',
215  'name' => 'sendToProduction',
216  'title' => 'editor.submission.decision.sendToProduction',
217  'image' => 'send_production',
218  'titleIcon' => 'modal_send_to_production',
219  ),
220  );
221 
222  return $decisions;
223  }
224 
229  static function getStageNotifications() {
230  static $notifications = array(
231  NOTIFICATION_TYPE_EDITOR_ASSIGNMENT_SUBMISSION,
232  NOTIFICATION_TYPE_EDITOR_ASSIGNMENT_INTERNAL_REVIEW,
233  NOTIFICATION_TYPE_EDITOR_ASSIGNMENT_EXTERNAL_REVIEW,
234  NOTIFICATION_TYPE_EDITOR_ASSIGNMENT_EDITING,
235  NOTIFICATION_TYPE_EDITOR_ASSIGNMENT_PRODUCTION
236  );
237  return $notifications;
238  }
239 }
240 
241 ?>
static & getDAO($name, $dbconn=null)
Wrapper class for create and assign editor decisions actions to template manager. ...
getEditorTakenActionInReviewRound($reviewRound, $decisions=array())