Open Journal Systems  3.0.0
 All Classes Namespaces Functions Variables Groups Pages
ManageReviewFilesGridHandler.inc.php
1 <?php
15 // import grid base classes
16 import('lib.pkp.controllers.grid.files.SelectableSubmissionFileListCategoryGridHandler');
17 
19 
21  var $_selectionArgs;
22 
23 
27  function ManageReviewFilesGridHandler() {
28  import('lib.pkp.controllers.grid.files.review.ReviewCategoryGridDataProvider');
29  // Pass in null stageId to be set in initialize from request var.
30  parent::SelectableSubmissionFileListCategoryGridHandler(
31  new ReviewCategoryGridDataProvider(SUBMISSION_FILE_REVIEW_FILE),
32  null,
33  FILE_GRID_ADD|FILE_GRID_VIEW_NOTES
34  );
35 
36  $this->addRoleAssignment(
37  array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT),
38  array('fetchGrid', 'fetchCategory', 'fetchRow', 'updateReviewFiles')
39  );
40 
41  // Set the grid title.
42  $this->setTitle('reviewer.submission.reviewFiles');
43  }
44 
45 
46  //
47  // Public handler methods
48  //
55  function updateReviewFiles($args, $request) {
56  $submission = $this->getSubmission();
57 
58  import('lib.pkp.controllers.grid.files.review.form.ManageReviewFilesForm');
59  $manageReviewFilesForm = new ManageReviewFilesForm($submission->getId(), $this->getRequestArg('stageId'), $this->getRequestArg('reviewRoundId'));
60  $manageReviewFilesForm->readInputData();
61 
62  if ($manageReviewFilesForm->validate()) {
63  $dataProvider = $this->getDataProvider();
64  $manageReviewFilesForm->execute($args, $request, $dataProvider->getCategoryData($this->getStageId()));
65 
66  $this->setupTemplate($request);
67  $user = $request->getUser();
68  NotificationManager::createTrivialNotification($user->getId(), NOTIFICATION_TYPE_SUCCESS, array('contents' => __('notification.updatedReviewFiles')));
69 
70  // Let the calling grid reload itself
71  return DAO::getDataChangedEvent();
72  } else {
73  $json = new JSONMessage(false);
74  return $json->getString();
75  }
76  }
77 
78 
79  //
80  // Extended methods from CategoryGridHandler.
81  //
85  function getRequestArgs() {
86  $stageId = $this->getAuthorizedContextObject(ASSOC_TYPE_WORKFLOW_STAGE);
87  return array_merge(array('stageId' => $stageId), parent::getRequestArgs());
88  }
89 }
90 
91 ?>
Handle selectable submission file list category grid requests.
setupTemplate($request)
addRoleAssignment($roleIds, $operations)
Class to represent a JSON (Javascript Object Notation) message.
Handle the editor review file selection grid (selects which files to send to review or to next review...
static getDataChangedEvent($elementId=null, $parentElementId=null, $content= '')
Definition: DAO.inc.php:632
& getAuthorizedContextObject($assocType)
Form for add or removing files from a review.