00001 <?php
00002
00015
00016 define('SUBMISSION_EDITOR_DECISION_INTERNAL_REVIEW', 1);
00017
00018
00019 define('SUBMISSION_EDITOR_DECISION_ACCEPT', 2);
00020 define('SUBMISSION_EDITOR_DECISION_DECLINE', 6);
00021
00022
00023 define('SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW', 3);
00024 define('SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS', 4);
00025 define('SUBMISSION_EDITOR_DECISION_RESUBMIT', 5);
00026
00027
00028 define('SUBMISSION_EDITOR_DECISION_SEND_TO_PRODUCTION', 7);
00029
00030 class EditorDecisionActionsManager {
00031
00037 function getActionLabels($decisions) {
00038 $allDecisionsData = array();
00039 $allDecisionsData =
00040 EditorDecisionActionsManager::_submissionStageDecisions() +
00041 EditorDecisionActionsManager::_internalReviewStageDecisions() +
00042 EditorDecisionActionsManager::_externalReviewStageDecisions() +
00043 EditorDecisionActionsManager::_editorialStageDecisions();
00044
00045 $actionLabels = array();
00046 foreach($decisions as $decision) {
00047 if ($allDecisionsData[$decision]['title']) {
00048 $actionLabels[$decision] = $allDecisionsData[$decision]['title'];
00049 } else {
00050 assert(false);
00051 }
00052 }
00053
00054 return $actionLabels;
00055 }
00056
00063 function getEditorTakenActionInReviewRound($reviewRound, $decisions = array()) {
00064 $seriesEditorSubmissionDao =& DAORegistry::getDAO('SeriesEditorSubmissionDAO');
00065 $editorDecisions = $seriesEditorSubmissionDao->getEditorDecisions($reviewRound->getSubmissionId(), $reviewRound->getStageId(), $reviewRound->getRound());
00066
00067 if (empty($decisions)) {
00068 $decisions = array_keys(EditorDecisionActionsManager::_internalReviewStageDecisions());
00069 }
00070 $takenDecision = false;
00071 foreach ($editorDecisions as $decision) {
00072 if (in_array($decision['decision'], $decisions)) {
00073 $takenDecision = true;
00074 break;
00075 }
00076 }
00077
00078 return $takenDecision;
00079 }
00080
00085 function getStageDecisions($stageId) {
00086 switch ($stageId) {
00087 case WORKFLOW_STAGE_ID_SUBMISSION:
00088 return EditorDecisionActionsManager::_submissionStageDecisions();
00089 case WORKFLOW_STAGE_ID_INTERNAL_REVIEW:
00090 return EditorDecisionActionsManager::_internalReviewStageDecisions();
00091 case WORKFLOW_STAGE_ID_EXTERNAL_REVIEW:
00092 return EditorDecisionActionsManager::_externalReviewStageDecisions();
00093 case WORKFLOW_STAGE_ID_EDITING:
00094 return EditorDecisionActionsManager::_editorialStageDecisions();
00095 default:
00096 assert(false);
00097 }
00098 }
00099
00100
00101
00102
00107 function _submissionStageDecisions() {
00108 static $decisions = array(
00109 SUBMISSION_EDITOR_DECISION_INTERNAL_REVIEW => array(
00110 'name' => 'internalReview',
00111 'operation' => 'internalReview',
00112 'title' => 'editor.monograph.decision.sendInternalReview',
00113 'image' => 'advance',
00114 'titleIcon' => 'modal_review',
00115 ),
00116 SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW => array(
00117 'operation' => 'externalReview',
00118 'name' => 'externalReview',
00119 'title' => 'editor.monograph.decision.sendExternalReview',
00120 'image' => 'advance',
00121 'titleIcon' => 'modal_review',
00122 ),
00123 SUBMISSION_EDITOR_DECISION_ACCEPT => array(
00124 'name' => 'accept',
00125 'operation' => 'promote',
00126 'title' => 'editor.monograph.decision.accept',
00127 'image' => 'promote',
00128 'help' => 'editor.review.NotifyAuthorAccept',
00129 'titleIcon' => 'accept_submission',
00130 ),
00131 SUBMISSION_EDITOR_DECISION_DECLINE => array(
00132 'name' => 'decline',
00133 'operation' => 'sendReviews',
00134 'title' => 'editor.monograph.decision.decline',
00135 'image' => 'decline',
00136 'help' => 'editor.review.NotifyAuthorDecline',
00137 'titleIcon' => 'decline_submission',
00138 ),
00139 );
00140
00141 return $decisions;
00142 }
00143
00148 function _internalReviewStageDecisions() {
00149 static $decisions = array(
00150 SUBMISSION_EDITOR_DECISION_PENDING_REVISIONS => array(
00151 'operation' => 'sendReviewsInReview',
00152 'name' => 'requestRevisions',
00153 'title' => 'editor.monograph.decision.requestRevisions',
00154 'image' => 'revisions',
00155 'help' => 'editor.review.NotifyAuthorRevisions',
00156 'titleIcon' => 'revisions_required',
00157 ),
00158 SUBMISSION_EDITOR_DECISION_RESUBMIT => array(
00159 'operation' => 'sendReviewsInReview',
00160 'name' => 'resubmit',
00161 'title' => 'editor.monograph.decision.resubmit',
00162 'image' => 'resubmit',
00163 'help' => 'editor.review.NotifyAuthorResubmit',
00164 'titleIcon' => 'please_resubmit',
00165 ),
00166 SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW => array(
00167 'operation' => 'promoteInReview',
00168 'name' => 'externalReview',
00169 'title' => 'editor.monograph.decision.sendExternalReview',
00170 'image' => 'advance',
00171 'help' => 'editor.review.NotifyAuthorExternal',
00172 'titleIcon' => 'modal_review',
00173 ),
00174 SUBMISSION_EDITOR_DECISION_ACCEPT => array(
00175 'operation' => 'promoteInReview',
00176 'name' => 'accept',
00177 'title' => 'editor.monograph.decision.accept',
00178 'image' => 'promote',
00179 'help' => 'editor.review.NotifyAuthorAccept',
00180 'titleIcon' => 'accept_submission',
00181 ),
00182 SUBMISSION_EDITOR_DECISION_DECLINE => array(
00183 'operation' => 'sendReviewsInReview',
00184 'name' => 'decline',
00185 'title' => 'editor.monograph.decision.decline',
00186 'image' => 'decline',
00187 'help' => 'editor.review.NotifyAuthorDecline',
00188 'titleIcon' => 'decline_submission',
00189 ),
00190 );
00191
00192 return $decisions;
00193 }
00194
00199 function _externalReviewStageDecisions() {
00200 $decisions = EditorDecisionActionsManager::_internalReviewStageDecisions();
00201 unset($decisions[SUBMISSION_EDITOR_DECISION_EXTERNAL_REVIEW]);
00202 return $decisions;
00203 }
00204
00205
00210 function _editorialStageDecisions() {
00211 static $decisions = array(
00212 SUBMISSION_EDITOR_DECISION_SEND_TO_PRODUCTION => array(
00213 'operation' => 'promote',
00214 'name' => 'sendToProduction',
00215 'title' => 'editor.monograph.decision.sendToProduction',
00216 'image' => 'send_production',
00217 'titleIcon' => 'modal_send_to_production',
00218 ),
00219 );
00220
00221 return $decisions;
00222 }
00223 }
00224
00225 ?>