• Main Page
  • Modules
  • Classes
  • Files
  • File List

controllers/grid/users/reviewer/form/EnrollExistingReviewerForm.inc.php

00001 <?php
00002 
00015 import('controllers.grid.users.reviewer.form.ReviewerForm');
00016 
00017 class EnrollExistingReviewerForm extends ReviewerForm {
00021    function EnrollExistingReviewerForm(&$monograph, &$reviewRound) {
00022       parent::ReviewerForm($monograph, $reviewRound);
00023       $this->setTemplate('controllers/grid/users/reviewer/form/enrollExistingReviewerForm.tpl');
00024 
00025       $this->addCheck(new FormValidator($this, 'userGroupId', 'required', 'user.profile.form.usergroupRequired'));
00026       $this->addCheck(new FormValidator($this, 'userId', 'required', 'manager.people.existingUserRequired'));
00027    }
00028 
00033    function fetch(&$request) {
00034 
00035       $searchByNameAction = $this->getSearchByNameAction($request);
00036 
00037       $this->setReviewerFormAction($searchByNameAction);
00038       return parent::fetch($request);
00039    }
00040 
00045    function readInputData() {
00046       parent::readInputData();
00047 
00048       $this->readUserVars(array('userId', 'userGroupId'));
00049    }
00050 
00056    function execute($args, &$request) {
00057       // Assign a reviewer user group to an existing non-reviewer
00058       $userId = (int) $this->getData('userId');
00059 
00060       $userGroupId = (int) $this->getData('userGroupId');
00061       $userGroupDao =& DAORegistry::getDAO('UserGroupDAO'); /* @var $userGroupDao UserGroupDAO */
00062       $userGroupDao->assignUserToGroup($userId, $userGroupId);
00063 
00064       // Set the reviewerId in the Form for the parent class to use
00065       $this->setData('reviewerId', $userId);
00066 
00067       return parent::execute($args, $request);
00068    }
00069 }
00070 
00071 ?>

Generated on Mon Sep 17 2012 13:58:56 for Open Monograph Press by  doxygen 1.7.1