addCheck(new \PKP\form\validation\FormValidatorPost($this)); $this->addCheck(new \PKP\form\validation\FormValidatorCSRF($this)); $this->request = $request; $this->_step = (int) $step; $this->_reviewSubmission = $reviewSubmission; $this->_reviewAssignment = $reviewAssignment; } // // Setters and Getters // /** * Get the reviewer submission. */ public function getReviewSubmission(): Submission { return $this->_reviewSubmission; } /** * Get the review assignment. */ public function getReviewAssignment(): ReviewAssignment { return $this->_reviewAssignment; } /** * Get the review step. */ public function getStep(): int { return $this->_step; } // // Implement protected template methods from Form // /** * @copydoc Form::fetch() * * @param null|mixed $template */ public function fetch($request, $template = null, $display = false) { $templateMgr = TemplateManager::getManager($request); $templateMgr->assign([ 'submission' => $this->getReviewSubmission(), 'reviewAssignment' => $this->getReviewAssignment(), 'reviewIsClosed' => $this->getReviewAssignment()->getDateCompleted() || $this->getReviewAssignment()->getCancelled(), 'step' => $this->getStep(), ]); return parent::fetch($request, $template, $display); } // // Protected helper methods // /** * Set the review step of the submission to the given * value if it is not already set to a higher value. Then * update the given reviewer submission. */ public function updateReviewStepAndSaveSubmission(ReviewAssignment $reviewAssignment) { // Update the review step. $nextStep = $this->getStep() + 1; if ($reviewAssignment->getStep() < $nextStep) { $reviewAssignment->setStep($nextStep); } // Save the reviewer submission. /** @var ReviewAssignmentDAO */ $reviewAssignmentDAO = DAORegistry::getDAO('ReviewAssignmentDAO'); $reviewAssignmentDAO->updateObject($reviewAssignment); } } if (!PKP_STRICT_MODE) { class_alias('\PKP\submission\reviewer\form\ReviewerReviewForm', '\ReviewerReviewForm'); }