clearReview() public method

Clears a review assignment from a submission.
public clearReview ( $request, $submissionId, $reviewId )
$request PKPRequest
$reviewId int
Ejemplo n.º 1
0
 /**
  * Deletes the review assignment and notifies the reviewer via email
  *
  * @param mixed $args
  * @param $request PKPRequest
  * @return bool whether or not the review assignment was deleted successfully
  */
 function execute($args, $request)
 {
     $submission = $this->getSubmission();
     $reviewAssignment = $this->getReviewAssignment();
     // Notify the reviewer via email.
     import('lib.pkp.classes.mail.SubmissionMailTemplate');
     $mail = new SubmissionMailTemplate($submission, 'REVIEW_CANCEL', null, null, false);
     if ($mail->isEnabled() && !$this->getData('skipEmail')) {
         $userDao = DAORegistry::getDAO('UserDAO');
         $reviewerId = (int) $this->getData('reviewerId');
         $reviewer = $userDao->getById($reviewerId);
         $mail->addRecipient($reviewer->getEmail(), $reviewer->getFullName());
         $mail->setBody($this->getData('personalMessage'));
         $mail->assignParams();
         $mail->send($request);
     }
     // Delete the review assignment.
     // NB: EditorAction::clearReview() will check that this review
     // id is actually attached to the submission so no need for further
     // validation here.
     import('lib.pkp.classes.submission.action.EditorAction');
     $editorAction = new EditorAction();
     return $editorAction->clearReview($request, $submission->getId(), $reviewAssignment->getId());
 }