00001 <?php
00002
00015
00016 import('classes.handler.Handler');
00017 import('lib.pkp.classes.core.JSONMessage');
00018
00019 class ReviewRoundTabHandler extends Handler {
00020
00024 function ReviewRoundTabHandler() {
00025 parent::Handler();
00026 $this->addRoleAssignment(
00027 array(ROLE_ID_SERIES_EDITOR, ROLE_ID_PRESS_MANAGER, ROLE_ID_PRESS_ASSISTANT),
00028 array('internalReviewRound', 'externalReviewRound')
00029 );
00030 }
00031
00032
00033
00034
00035
00039 function authorize(&$request, $args, $roleAssignments) {
00040 $stageId = (int) $request->getUserVar('stageId');
00041
00042 import('classes.security.authorization.OmpWorkflowStageAccessPolicy');
00043 $this->addPolicy(new OmpWorkflowStageAccessPolicy($request, $args, $roleAssignments, 'monographId', $stageId));
00044
00045
00046 import('classes.security.authorization.internal.ReviewRoundRequiredPolicy');
00047 $this->addPolicy(new ReviewRoundRequiredPolicy($request, $args));
00048
00049 return parent::authorize($request, $args, $roleAssignments);
00050 }
00051
00057 function internalReviewRound($args, &$request) {
00058 return $this->_reviewRound($args, $request);
00059 }
00060
00066 function externalReviewRound($args, &$request) {
00067 return $this->_reviewRound($args, $request);
00068 }
00069
00070
00074 function setupTemplate() {
00075 AppLocale::requireComponents(LOCALE_COMPONENT_OMP_EDITOR);
00076 parent::setupTemplate();
00077 }
00078
00079
00080
00081
00082
00088 function _reviewRound($args, &$request) {
00089 $this->setupTemplate();
00090
00091
00092 $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
00093 $stageId = $this->getAuthorizedContextObject(ASSOC_TYPE_WORKFLOW_STAGE);
00094 $reviewRound =& $this->getAuthorizedContextObject(ASSOC_TYPE_REVIEW_ROUND);
00095
00096
00097 $templateMgr =& TemplateManager::getManager();
00098 $templateMgr->assign('stageId', $stageId);
00099 $templateMgr->assign('reviewRoundId', $reviewRound->getId());
00100 $templateMgr->assign_by_ref('monograph', $monograph);
00101
00102
00103
00104 $reviewRoundDao =& DAORegistry::getDAO('ReviewRoundDAO');
00105
00106 $notificationRequestOptions = array(
00107 NOTIFICATION_LEVEL_NORMAL => array(
00108 NOTIFICATION_TYPE_REVIEW_ROUND_STATUS => array(ASSOC_TYPE_REVIEW_ROUND, $reviewRound->getId())),
00109 NOTIFICATION_LEVEL_TASK => array(
00110 NOTIFICATION_TYPE_ALL_REVIEWS_IN => array(ASSOC_TYPE_REVIEW_ROUND, $reviewRound->getId()),
00111 NOTIFICATION_TYPE_ALL_REVISIONS_IN => array(ASSOC_TYPE_REVIEW_ROUND, $reviewRound->getId())),
00112 NOTIFICATION_LEVEL_TRIVIAL => array()
00113 );
00114 $templateMgr->assign('reviewRoundNotificationRequestOptions', $notificationRequestOptions);
00115
00116 return $templateMgr->fetchJson('workflow/reviewRound.tpl');
00117 }
00118 }
00119
00120 ?>