/**
  * Delete comment.
  */
 function deleteComment($args)
 {
     $articleId = $args[0];
     $commentId = $args[1];
     $reviewId = Request::getUserVar('reviewId');
     $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId));
     $this->validate();
     $comment =& $this->comment;
     $this->setupTemplate(true);
     $submissionReviewHandler = new SubmissionReviewHandler();
     $submissionReviewHandler->validate($reviewId);
     $submission =& $submissionReviewHandler->submission;
     $user =& $submissionReviewHandler->user;
     ReviewerAction::deleteComment($commentId, $user);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_PEER_REVIEW) {
         Request::redirect(null, null, 'viewPeerReviewComments', array($articleId, $comment->getAssocId()));
     }
 }
 /**
  * Delete comment.
  */
 function deleteComment($args)
 {
     $articleId = $args[0];
     $commentId = $args[1];
     $reviewId = Request::getUserVar('reviewId');
     list($journal, $submission, $user) = SubmissionReviewHandler::validate($reviewId);
     list($comment) = SubmissionCommentsHandler::validate($user, $commentId);
     ReviewerHandler::setupTemplate(true);
     ReviewerAction::deleteComment($commentId, $user);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_PEER_REVIEW) {
         Request::redirect(null, null, 'viewPeerReviewComments', array($articleId, $comment->getAssocId()));
     }
 }
 /**
  * Validate that the user is an assigned reviewer for
  * the article.
  * Redirects to reviewer index page if validation fails.
  */
 function validate($request, $reviewId)
 {
     $reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
     $journal =& $request->getJournal();
     $user =& $request->getUser();
     $isValid = true;
     $newKey = $request->getUserVar('key');
     $reviewerSubmission =& $reviewerSubmissionDao->getReviewerSubmission($reviewId);
     if (!$reviewerSubmission || $reviewerSubmission->getJournalId() != $journal->getId()) {
         $isValid = false;
     } elseif ($user && empty($newKey)) {
         if ($reviewerSubmission->getReviewerId() != $user->getId()) {
             $isValid = false;
         }
     } else {
         $user =& SubmissionReviewHandler::validateAccessKey($request, $reviewerSubmission->getReviewerId(), $reviewId, $newKey);
         if (!$user) {
             $isValid = false;
         }
     }
     if (!$isValid) {
         $request->redirect(null, $request->getRequestedPage());
     }
     $this->submission =& $reviewerSubmission;
     $this->user =& $user;
     return true;
 }
Beispiel #4
0
 function saveReviewFormResponse($args)
 {
     import('pages.reviewer.SubmissionReviewHandler');
     SubmissionReviewHandler::saveReviewFormResponse($args);
 }
 /**
  * Delete comment.
  */
 function deleteComment($args, $request)
 {
     $paperId = (int) array_shift($args);
     $commentId = (int) array_shift($args);
     $reviewId = $request->getUserVar('reviewId');
     $this->setupTemplate($request, true);
     $submissionReviewHandler = new SubmissionReviewHandler();
     $submissionReviewHandler->validate($request, $reviewId);
     $user =& $submissionReviewHandler->user;
     $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId, $user));
     $this->validate(null, $request);
     $comment =& $this->comment;
     ReviewerAction::deleteComment($commentId, $user);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_PEER_REVIEW) {
         $request->redirect(null, null, null, 'viewPeerReviewComments', array($paperId, $comment->getAssocId()));
     }
 }
Beispiel #6
0
 function downloadFile($args)
 {
     import('pages.reviewer.SubmissionReviewHandler');
     SubmissionReviewHandler::downloadFile($args);
 }
 /**
  * Validate that the user has been assigned at least once for a review in this article.
  * Redirects to reviewer index page if validation fails.
  */
 function validate($articleId)
 {
     $reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
     $user =& Request::getUser();
     $isValid = true;
     $newKey = Request::getUserVar('key');
     $reviewerSubmission =& $reviewerSubmissionDao->getReviewerSubmissionByArticleAndReviewerId($articleId, $user->getId());
     if (!$reviewerSubmission) {
         $isValid = false;
     } elseif ($user && empty($newKey)) {
         if ($reviewerSubmission->getReviewerId() != $user->getId()) {
             $isValid = false;
         }
     } else {
         $decisionsAndAssignments = $reviewerSubmission->getPastDecisionsAndAssignments();
         $undergoingDecisionAndAssignment = $reviewerSubmission->getUndergoingDecisionAndAssignment();
         $user = null;
         foreach ($decisionsAndAssignments as $decisionsAndAssignment) {
             if (!$user) {
                 $assignment = $decisionsAndAssignment['assignment'];
                 $user =& SubmissionReviewHandler::validateAccessKey($reviewerSubmission->getReviewerId(), $assignment->getReviewId(), $newKey);
             }
         }
         if (!$user) {
             $assignment = $undergoingDecisionAndAssignment['assignment'];
             $user =& SubmissionReviewHandler::validateAccessKey($reviewerSubmission->getReviewerId(), $assignment->getReviewId(), $newKey);
         }
         if (!$user) {
             $isValid = false;
         }
     }
     if (!$isValid) {
         Request::redirect(null, Request::getRequestedPage());
     }
     $this->submission =& $reviewerSubmission;
     $this->user =& $user;
     return true;
 }