/**
  * Fetch the form
  * @see Form::fetch
  */
 function fetch($request)
 {
     // Pass along the request vars
     $actionArgs = $request->getUserVars();
     $reviewRound = $this->getReviewRound();
     $actionArgs['reviewRoundId'] = $reviewRound->getId();
     $actionArgs['selectionType'] = REVIEWER_SELECT_ADVANCED_SEARCH;
     // but change the selectionType for each action
     $advancedSearchAction = new LinkAction('advancedSearch', new AjaxAction($request->url(null, null, 'reloadReviewerForm', null, $actionArgs)), __('manager.reviewerSearch.advancedSearch.short'), 'user_search');
     $this->setReviewerFormAction($advancedSearchAction);
     // Only add actions to forms where user can operate.
     if (array_intersect($this->getUserRoles(), array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR))) {
         $actionArgs['selectionType'] = REVIEWER_SELECT_CREATE;
         // but change the selectionType for each action
         $advancedSearchAction = new LinkAction('selectCreate', new AjaxAction($request->url(null, null, 'reloadReviewerForm', null, $actionArgs)), __('editor.review.createReviewer'), 'add_user');
         $this->setReviewerFormAction($advancedSearchAction);
         $actionArgs['selectionType'] = REVIEWER_SELECT_ENROLL_EXISTING;
         // but change the selectionType for each action
         $advancedSearchAction = new LinkAction('enrolExisting', new AjaxAction($request->url(null, null, 'reloadReviewerForm', null, $actionArgs)), __('editor.review.enrollReviewer.short'), 'enroll_user');
         $this->setReviewerFormAction($advancedSearchAction);
     }
     return parent::fetch($request);
 }
 /**
  * Fetch the form.
  * @see Form::fetch()
  */
 function fetch($request)
 {
     $searchByNameAction = $this->getSearchByNameAction($request);
     $this->setReviewerFormAction($searchByNameAction);
     return parent::fetch($request);
 }
Ejemplo n.º 3
0
 /**
  * Edit a reviewer
  * @param $args array
  * @param $request PKPRequest
  * @return string Serialized JSON object
  */
 function updateReviewer($args, &$request)
 {
     // Identify the review assignment being updated.
     $reviewAssignmentId = (int) $request->getUserVar('reviewAssignmentId');
     // Form handling
     import('controllers.grid.users.reviewer.form.ReviewerForm');
     $reviewerForm = new ReviewerForm($this->getMonograph(), $reviewAssignmentId);
     $reviewerForm->readInputData();
     if ($reviewerForm->validate()) {
         $reviewAssignment =& $reviewerForm->execute($args, $request);
         // prepare the grid row data
         $row =& $this->getRowInstance();
         $row->setGridId($this->getId());
         $row->setId($reviewAssignment->getId());
         $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
         $row->setData($reviewAssignment);
         $row->initialize($request);
         $json = new JSON(true, $this->_renderRowInternally($request, $row));
     } else {
         // There was an error, redisplay the form
         $json = new JSON(false, $reviewerForm->fetch($request));
     }
     return $json->getString();
 }
 /**
  * Fetch the form.
  * @see Form::fetch()
  */
 function fetch($request)
 {
     $advancedSearchAction = $this->getAdvancedSearchAction($request);
     $this->setReviewerFormAction($advancedSearchAction);
     return parent::fetch($request);
 }