/** * Create a new user as a reviewer. */ function createReviewer($args, &$request) { $articleId = isset($args[0]) ? (int) $args[0] : 0; $this->validate($articleId, SECTION_EDITOR_ACCESS_REVIEW); $submission =& $this->submission; import('classes.sectionEditor.form.CreateReviewerForm'); $createReviewerForm = new CreateReviewerForm($articleId); $this->setupTemplate(true, $articleId); if (isset($args[1]) && $args[1] === 'create') { $createReviewerForm->readInputData(); if ($createReviewerForm->validate()) { // Create a user and enroll them as a reviewer. $newUserId = $createReviewerForm->execute(); Request::redirect(null, null, 'selectReviewer', array($articleId, $newUserId)); } else { $createReviewerForm->display($args, $request); } } else { // Display the "create user" form. if ($createReviewerForm->isLocaleResubmit()) { $createReviewerForm->readInputData(); } else { $createReviewerForm->initData(); } $createReviewerForm->display($args, $request); } }
/** * Create a new user as a reviewer. */ function createReviewer($args, &$request) { $paperId = (int) array_shift($args); $this->validate($request, $paperId, TRACK_DIRECTOR_ACCESS_REVIEW); $conference =& $request->getConference(); $schedConf =& $request->getSchedConf(); $submission =& $this->submission; import('classes.trackDirector.form.CreateReviewerForm'); $createReviewerForm = new CreateReviewerForm($paperId); Locale::requireComponents(array(LOCALE_COMPONENT_PKP_MANAGER)); $this->setupTemplate($request, true, $paperId); if (isset($args[1]) && $args[1] === 'create') { $createReviewerForm->readInputData(); if ($createReviewerForm->validate()) { // Create a user and enroll them as a reviewer. $newUserId = $createReviewerForm->execute(); $request->redirect(null, null, null, 'selectReviewer', array($paperId, $newUserId)); } else { $createReviewerForm->display($args, $request); } } else { // Display the "create user" form. if ($createReviewerForm->isLocaleResubmit()) { $createReviewerForm->readInputData(); } else { $createReviewerForm->initData(); } $createReviewerForm->display($args, $request); } }
/** * Create a new user as a reviewer. * Come from SubmissionEditHandler * Moved here by EL on February 21th 2013 */ function createReviewer($args, &$request) { $sectionId = isset($args[0]) ? (int) $args[0] : 0; // For security purposes $thisUser =& Request::getUser(); if ($thisUser->getSecretaryCommitteeId() == $sectionId) { import('classes.sectionEditor.form.CreateReviewerForm'); $createReviewerForm = new CreateReviewerForm($sectionId); $this->setupTemplate(2); if (isset($args[1]) && $args[1] === 'create') { $createReviewerForm->readInputData(); if ($createReviewerForm->validate()) { // Create a user and enroll them as a reviewer. $createReviewerForm->execute(); Request::redirect(null, null, 'section', $sectionId); } else { $createReviewerForm->display($args, $request); } } else { // Display the "create user" form. if ($createReviewerForm->isLocaleResubmit()) { $createReviewerForm->readInputData(); } else { $createReviewerForm->initData(); } $createReviewerForm->display($args, $request); } } else { Request::redirect(null, 'user'); } }