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

controllers/grid/files/review/ManageReviewFilesGridHandler.inc.php

00001 <?php
00002 
00015 // import grid base classes
00016 import('controllers.grid.files.SelectableSubmissionFileListCategoryGridHandler');
00017 
00018 class ManageReviewFilesGridHandler extends SelectableSubmissionFileListCategoryGridHandler {
00019 
00021    var $_selectionArgs;
00022 
00023 
00027    function ManageReviewFilesGridHandler() {
00028       import('controllers.grid.files.review.ReviewCategoryGridDataProvider');
00029       // Pass in null stageId to be set in initialize from request var.
00030       parent::SelectableSubmissionFileListCategoryGridHandler(
00031          new ReviewCategoryGridDataProvider(MONOGRAPH_FILE_REVIEW_FILE),
00032          null,
00033          FILE_GRID_ADD|FILE_GRID_VIEW_NOTES
00034       );
00035 
00036       $this->addRoleAssignment(
00037          array(ROLE_ID_PRESS_MANAGER, ROLE_ID_SERIES_EDITOR, ROLE_ID_PRESS_ASSISTANT),
00038          array('fetchGrid', 'fetchCategory', 'fetchRow', 'updateReviewFiles')
00039       );
00040 
00041       // Set the grid title.
00042       $this->setTitle('reviewer.monograph.reviewFiles');
00043    }
00044 
00045 
00046    //
00047    // Public handler methods
00048    //
00055    function updateReviewFiles($args, &$request) {
00056       $monograph =& $this->getMonograph();
00057 
00058       import('controllers.grid.files.review.form.ManageReviewFilesForm');
00059       $manageReviewFilesForm = new ManageReviewFilesForm($monograph->getId(), $this->getRequestArg('stageId'), $this->getRequestArg('reviewRoundId'));
00060       $manageReviewFilesForm->readInputData();
00061 
00062       if ($manageReviewFilesForm->validate()) {
00063          $dataProvider =& $this->getDataProvider();
00064          $manageReviewFilesForm->execute($args, $request, $dataProvider->getCategoryData($this->getStageId()));
00065 
00066          $this->setupTemplate();
00067          $user =& $request->getUser();
00068          NotificationManager::createTrivialNotification($user->getId(), NOTIFICATION_TYPE_SUCCESS, array('contents' => __('notification.updatedReviewFiles')));
00069 
00070          // Let the calling grid reload itself
00071          return DAO::getDataChangedEvent();
00072       } else {
00073          $json = new JSONMessage(false);
00074          return $json->getString();
00075       }
00076    }
00077 
00078 
00079    //
00080    // Extended methods from SelectableFileListGridHandler
00081    //
00085    function initialize(&$request) {
00086       $reviewRound =& $this->getAuthorizedContextObject(ASSOC_TYPE_REVIEW_ROUND);
00087       $stageId = $this->getAuthorizedContextObject(ASSOC_TYPE_WORKFLOW_STAGE);
00088 
00089       $this->_selectionArgs = array(
00090                'stageId' => $stageId
00091       );
00092 
00093       parent::initialize($request);
00094    }
00095 
00096 
00097    //
00098    // Overridden protected methods from SelectableFileListGridHandler
00099    //
00103    function getSelectionArgs() {
00104       return $this->_selectionArgs;
00105    }
00106 }
00107 
00108 ?>

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