pages/reviewer/SubmissionReviewHandler.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 import('pages.reviewer.ReviewerHandler');
00018 
00019 class SubmissionReviewHandler extends ReviewerHandler {
00021    var $submission;
00022    
00024    var $user;
00025       
00029    function SubmissionReviewHandler() {
00030       parent::ReviewerHandler();
00031    }
00032 
00033    function submission($args) {
00034       $reviewId = $args[0];
00035 
00036       $this->validate($reviewId);
00037       $reviewerSubmission =& $this->submission;
00038       $user =& $this->user;
00039       $schedConf =& Request::getSchedConf();
00040       
00041       $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
00042       $reviewAssignment = $reviewAssignmentDao->getReviewAssignmentById($reviewId);
00043       
00044       $reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO');
00045 
00046       if ($reviewAssignment->getDateConfirmed() == null) {
00047          $confirmedStatus = 0;
00048       } else {
00049          $confirmedStatus = 1;
00050       }
00051 
00052       $this->setupTemplate(true, $reviewerSubmission->getPaperId(), $reviewId);
00053 
00054       $templateMgr =& TemplateManager::getManager();
00055 
00056       $templateMgr->assign_by_ref('user', $user);
00057       $templateMgr->assign_by_ref('submission', $reviewerSubmission);
00058       $templateMgr->assign_by_ref('reviewAssignment', $reviewAssignment);
00059       $templateMgr->assign('confirmedStatus', $confirmedStatus);
00060       $templateMgr->assign('declined', $reviewerSubmission->getDeclined());
00061       $templateMgr->assign('reviewFormResponseExists', $reviewFormResponseDao->reviewFormResponseExists($reviewId));
00062       $templateMgr->assign_by_ref('reviewFile', $reviewAssignment->getReviewFile());
00063       $templateMgr->assign_by_ref('reviewerFile', $reviewerSubmission->getReviewerFile());
00064       $templateMgr->assign_by_ref('suppFiles', $reviewerSubmission->getSuppFiles());
00065       $templateMgr->assign_by_ref('schedConf', $schedConf);
00066       $templateMgr->assign_by_ref('reviewGuidelines', $schedConf->getLocalizedSetting('reviewGuidelines'));
00067 
00068       // The reviewer instructions differ depending on what is reviewed, and when.
00069       if($reviewAssignment->getStage()==REVIEW_STAGE_ABSTRACT && $reviewerSubmission->getReviewMode() != REVIEW_MODE_BOTH_SIMULTANEOUS)
00070          $templateMgr->assign('reviewerInstruction3', 'reviewer.paper.downloadSubmissionAbstractOnly');
00071       else
00072          $templateMgr->assign('reviewerInstruction3', 'reviewer.paper.downloadSubmissionSubmission');
00073 
00074       import('submission.reviewAssignment.ReviewAssignment');
00075       $templateMgr->assign_by_ref('reviewerRecommendationOptions', ReviewAssignment::getReviewerRecommendationOptions());
00076 
00077       $controlledVocabDao =& DAORegistry::getDAO('ControlledVocabDAO');
00078       $templateMgr->assign('sessionTypes', $controlledVocabDao->enumerateBySymbolic('sessionTypes', ASSOC_TYPE_SCHED_CONF, $schedConf->getId()));
00079 
00080       $templateMgr->assign('helpTopicId', 'editorial.reviewersRole.review');     
00081       $templateMgr->display('reviewer/submission.tpl');
00082    }
00083 
00084    function confirmReview($args = null) {
00085       $reviewId = Request::getUserVar('reviewId');
00086       $declineReview = Request::getUserVar('declineReview');
00087 
00088       $reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
00089 
00090       $this->validate($reviewId);
00091       $reviewerSubmission =& $this->submission;
00092       $this->setupTemplate();
00093       
00094       $decline = isset($declineReview) ? 1 : 0;
00095 
00096       if (!$reviewerSubmission->getCancelled()) {
00097          if (ReviewerAction::confirmReview($reviewerSubmission, $decline, Request::getUserVar('send'))) {
00098             Request::redirect(null, null, null, 'submission', $reviewId);
00099          }
00100       } else {
00101          Request::redirect(null, null, null, 'submission', $reviewId);
00102       }
00103    }
00104 
00105    function recordRecommendation() {
00106       $reviewId = Request::getUserVar('reviewId');
00107       $recommendation = Request::getUserVar('recommendation');
00108 
00109       $this->validate($reviewId);
00110       $reviewerSubmission =& $this->submission;
00111       $this->setupTemplate(true);
00112 
00113       if (!$reviewerSubmission->getCancelled()) {
00114          if (ReviewerAction::recordRecommendation($reviewerSubmission, $recommendation, Request::getUserVar('send'))) {
00115             Request::redirect(null, null, null, 'submission', $reviewId);
00116          }
00117       } else {
00118          Request::redirect(null, null, null, 'submission', $reviewId);
00119       }
00120    }
00121 
00122    function viewMetadata($args) {
00123       $reviewId = $args[0];
00124       $paperId = $args[1];
00125 
00126       $this->validate($reviewId);
00127       $reviewerSubmission =& $this->submission;
00128 
00129       $this->setupTemplate(true, $paperId, $reviewId);
00130       AppLocale::requireComponents(array(LOCALE_COMPONENT_OCS_AUTHOR)); // author.submit.agencies
00131 
00132       ReviewerAction::viewMetadata($reviewerSubmission, ROLE_ID_REVIEWER);
00133    }
00134 
00138    function uploadReviewerVersion() {
00139       $reviewId = Request::getUserVar('reviewId');
00140 
00141       $this->validate($reviewId);
00142       $this->setupTemplate(true);
00143       
00144       if (!ReviewerAction::uploadReviewerVersion($reviewId)) {
00145          $templateMgr =& TemplateManager::getManager();
00146          $templateMgr->assign('pageTitle', 'submission.uploadFile');
00147          $templateMgr->assign('message', 'common.uploadFailed');
00148          $templateMgr->assign('backLink', Request::url(null, null, null, 'submission', array($reviewId)));
00149          $templateMgr->assign('backLinkLabel', 'common.back');
00150          return $templateMgr->display('common/message.tpl');
00151       }
00152       Request::redirect(null, null, null, 'submission', $reviewId);
00153    }
00154 
00155    /*
00156     * Delete one of the reviewer's annotated versions of a paper.
00157     */
00158    function deleteReviewerVersion($args) {      
00159       $reviewId = isset($args[0]) ? (int) $args[0] : 0;
00160       $fileId = isset($args[1]) ? (int) $args[1] : 0;
00161       $revision = isset($args[2]) ? (int) $args[2] : null;
00162 
00163       $this->validate($reviewId);
00164       $reviewerSubmission =& $this->submission;
00165 
00166       if (!$reviewerSubmission->getCancelled()) ReviewerAction::deleteReviewerVersion($reviewId, $fileId, $revision);
00167       Request::redirect(null, null, null, 'submission', $reviewId);
00168    }
00169 
00170    //
00171    // Misc
00172    //
00173 
00178    function downloadFile($args) {
00179       $reviewId = isset($args[0]) ? $args[0] : 0;
00180       $paperId = isset($args[1]) ? $args[1] : 0;
00181       $fileId = isset($args[2]) ? $args[2] : 0;
00182       $revision = isset($args[3]) ? $args[3] : null;
00183 
00184       $this->validate($reviewId);
00185       $reviewerSubmission =& $this->submission;
00186       if (!ReviewerAction::downloadReviewerFile($reviewId, $reviewerSubmission, $fileId, $revision)) {
00187          Request::redirect(null, null, null, 'submission', $reviewId);
00188       }
00189    }
00190    
00191    //
00192    // Review Form
00193    //
00194 
00199    function editReviewFormResponse($args) {
00200       $reviewId = isset($args[0]) ? $args[0] : 0;
00201       
00202       $this->validate($reviewId);
00203 
00204       $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
00205       $reviewAssignment =& $reviewAssignmentDao->getReviewAssignmentById($reviewId);
00206       $reviewFormId = $reviewAssignment->getReviewFormId();
00207       if ($reviewFormId != null) {
00208          ReviewerAction::editReviewFormResponse($reviewId, $reviewFormId);    
00209       }
00210    }
00211 
00216    function saveReviewFormResponse($args) {
00217       $reviewId = isset($args[0]) ? $args[0] : 0;
00218       $reviewFormId = isset($args[1]) ? $args[1] : 0;
00219 
00220       $this->validate($reviewId);
00221       $this->setupTemplate(true);
00222 
00223       if (ReviewerAction::saveReviewFormResponse($reviewId, $reviewFormId)) {
00224                Request::redirect(null, null, null, 'submission', $reviewId);
00225       }
00226    }
00227 
00228    //
00229    // Validation
00230    //
00231 
00237    function validate($reviewId) {
00238       $reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
00239       $schedConf =& Request::getSchedConf();
00240       $user =& Request::getUser();
00241 
00242       $isValid = true;
00243       $newKey = Request::getUserVar('key');
00244 
00245       $reviewerSubmission =& $reviewerSubmissionDao->getReviewerSubmission($reviewId);
00246 
00247       if (!$reviewerSubmission || $reviewerSubmission->getSchedConfId() != $schedConf->getId()) {
00248          $isValid = false;
00249       } elseif ($user && empty($newKey)) {
00250          if ($reviewerSubmission->getReviewerId() != $user->getId()) {
00251             $isValid = false;
00252          }
00253       } else {
00254          $user =& SubmissionReviewHandler::validateAccessKey($reviewerSubmission->getReviewerId(), $reviewId, $newKey);
00255          if (!$user) $isValid = false;
00256       }
00257 
00258       if (!$isValid) {
00259          Request::redirect(null, null, Request::getRequestedPage());
00260       }
00261 
00262       $this->submission =& $reviewerSubmission;
00263       $this->user =& $user;
00264       return true;
00265    }
00266 }
00267 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7