initialize() public method

public initialize ( $request )
 /**
  * @see PKPHandler::initialize()
  */
 function initialize(&$request)
 {
     // Basic grid configuration
     $this->setId('fairCopyFiles');
     $this->setTitle('editor.monograph.fairCopy');
     // Load grid data.
     $this->loadMonographFiles();
     // Test whether the tar binary is available for the export to work, if so, add grid action
     $tarBinary = Config::getVar('cli', 'tar');
     if ($this->hasData() && !empty($tarBinary) && file_exists($tarBinary)) {
         $monograph =& $this->getMonograph();
         $router =& $request->getRouter();
         $this->addAction(new LinkAction('downloadAll', new RedirectAction($router->url($request, null, null, 'downloadAllFiles', null, array('monographId' => $monograph->getId()))), 'submission.files.downloadAll', 'getPackage'));
     }
     // Load additional translation components.
     Locale::requireComponents(array(LOCALE_COMPONENT_OMP_EDITOR));
     // Columns
     import('controllers.grid.files.fairCopyFiles.FairCopyFilesGridCellProvider');
     $cellProvider =& new FairCopyFilesGridCellProvider();
     parent::initialize($request, $cellProvider);
     // Add a column for the uploader.
     // FIXME: We're just adding some placeholder text here until this
     // is correctly implemented, see #6233.
     $this->addColumn(new GridColumn('select', null, 'FIXME', 'controllers/grid/common/cell/roleCell.tpl', $cellProvider));
     // Add another column for the uploader's role
     // FIXME: We're just adding some placeholder text here until this
     // is correctly implemented, see #6233.
     $this->addColumn(new GridColumn('uploader-name', null, 'FIXME', 'controllers/grid/common/cell/roleCell.tpl', $cellProvider));
 }
 /**
  * @see PKPHandler::initialize()
  */
 function initialize(&$request)
 {
     // Basic grid configuration
     $this->setTitle('submission.submit.submissionFiles');
     // Load monograph files.
     $this->loadMonographFiles();
     $cellProvider = new SubmissionFilesGridCellProvider();
     parent::initialize($request, $cellProvider);
     $this->addColumn(new GridColumn('fileType', 'common.fileType', null, 'controllers/grid/gridCell.tpl', $cellProvider));
     $this->addColumn(new GridColumn('type', 'common.type', null, 'controllers/grid/gridCell.tpl', $cellProvider));
 }
 function initialize(&$request, $additionalActionArgs = array())
 {
     $this->setTitle('grid.reviewAttachments.title');
     // Set the select checkbox name to avoid namespace collisions
     $this->setSelectName('selectedAttachments');
     // Load monograph files.
     $this->loadMonographFiles();
     import('controllers.grid.files.SubmissionFilesGridCellProvider');
     $cellProvider = new SubmissionFilesGridCellProvider();
     parent::initialize($request, $cellProvider, $additionalActionArgs);
 }
Exemplo n.º 4
0
 /**
  * @see PKPHandler::initialize()
  */
 function initialize(&$request)
 {
     parent::initialize($request);
     // Add the "manage files" action if required.
     if ($this->canManage()) {
         $dataProvider =& $this->getDataProvider();
         $this->addAction($dataProvider->getSelectAction($request));
     }
     // The file list grid layout has an additional file genre column.
     import('controllers.grid.files.fileList.FileGenreGridColumn');
     $this->addColumn(new FileGenreGridColumn());
 }
Exemplo n.º 5
0
 /**
  * @see PKPHandler::initialize()
  */
 function initialize(&$request)
 {
     parent::initialize($request);
     // Retrieve the submission files in this grid.
     $submissionFiles =& $this->getGridDataElements($request);
     // Go through the list of files and identify all uploader user groups.
     $uploaderUserGroups = array();
     $signoffUserGroups = array();
     $userGroupDao =& DAORegistry::getDAO('UserGroupDAO');
     /* @var $userGroupDao UserGroupDAO */
     foreach ($submissionFiles as $submissionFileData) {
         assert(isset($submissionFileData['submissionFile']));
         $monographFile =& $submissionFileData['submissionFile'];
         /* @var $submissionFile MonographFile */
         // Add the signoff user groups to the signoff
         // user group list if it had not been added before.
         assert(isset($submissionFileData['signoffs']));
         $fileSignoffs = $submissionFileData['signoffs'];
         foreach ($fileSignoffs as $userId => $signoffUserGroups) {
             foreach ($signoffUserGroups as $signoffUserGroup) {
                 /* @var $signoffUserGroup UserGroup */
                 if (!isset($signoffUserGroups[$signoffUserGroup->getId()])) {
                     $signoffUserGroups[$signoffUserGroup->getId()] =& $signoffUserGroup;
                 }
             }
         }
         // Add the uploader user group to the uploader
         // user group list if it has not been added before.
         $uploaderUserGroupId = $monographFile->getUserGroupId();
         if (!isset($uploaderUserGroups[$uploaderUserGroupId])) {
             // Retrieve the user group object. For the sake of
             // simpler code we may retrieve groups again that we
             // already retrieved as signoff groups. This will hardly
             // be a performance problem, though.
             $userGroup =& $userGroupDao->getById($uploaderUserGroupId);
             assert(is_a($userGroup, 'UserGroup'));
             $uploaderUserGroups[$uploaderUserGroupId] =& $userGroup;
         }
     }
     // Add uploader user group columns.
     import('controllers.grid.files.UploaderGridColumn');
     foreach ($uploaderUserGroups as $uploaderUserGroup) {
         /* @var $uploaderUserGroup UserGroup */
         $this->addColumn(new UploaderGridColumn($uploaderUserGroup));
     }
     // Add signoff user group columns.
     import('controllers.grid.files.SignoffStatusGridColumn');
     foreach ($signoffUserGroups as $signoffUserGroup) {
         /* @var $uploaderUserGroup UserGroup */
         $this->addColumn(new SignoffStatusGridColumn($signoffUserGroup, $this->getStageId(), $this->getRequestArgs()));
     }
 }
 function initialize(&$request)
 {
     // Basic grid configuration
     $this->setId('reviewFiles');
     $this->setTitle('submission.submit.submissionFiles');
     // Load monograph files.
     $this->loadMonographFiles();
     $cellProvider = new SubmissionFilesGridCellProvider();
     parent::initialize($request, $cellProvider);
     $this->addColumn(new GridColumn('fileType', 'common.fileType', null, 'controllers/grid/gridCell.tpl', $cellProvider));
     $this->addColumn(new GridColumn('type', 'common.type', null, 'controllers/grid/gridCell.tpl', $cellProvider));
     import('controllers.grid.files.reviewFiles.ReviewFilesGridCellProvider');
     $reviewCellProvider =& new ReviewFilesGridCellProvider();
     $this->addColumn(new GridColumn('select', 'common.select', null, 'controllers/grid/gridRowSelectInput.tpl', $reviewCellProvider));
 }
 /**
  * @see PKPHandler::initialize()
  */
 function initialize(&$request)
 {
     // Basic grid configuration.
     $this->setTitle('submission.finalDraft');
     // Add required locale files.
     Locale::requireComponents(array(LOCALE_COMPONENT_PKP_COMMON, LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_OMP_EDITOR, LOCALE_COMPONENT_OMP_SUBMISSION));
     // Load the monograph files to be displayed in the grid
     $this->loadMonographFiles();
     if ($this->canManage()) {
         $monograph =& $this->getMonograph();
         $router =& $request->getRouter();
         $this->addAction(new SelectSubmissionFilesLinkAction(&$request, $monograph->getId(), __('editor.monograph.manageFinalDraftFiles')));
     }
     import('controllers.grid.files.SubmissionFilesGridCellProvider');
     $cellProvider = new SubmissionFilesGridCellProvider();
     parent::initialize($request, $cellProvider);
 }
Exemplo n.º 8
0
 /**
  * @copydoc PKPHandler::initialize()
  */
 function initialize($request)
 {
     parent::initialize($request);
     $currentUser = $request->getUser();
     $submission = $this->getSubmission();
     $stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO');
     /* @var $stageAssignmentDao StageAssignmentDAO */
     $userGroupDao = DAORegistry::getDAO('UserGroupDAO');
     /* @var $userGroupDao UserGroupDAO */
     // Set up the roles we may include as columns
     $roles = array(ROLE_ID_MANAGER => 'user.role.manager', ROLE_ID_SUB_EDITOR => 'user.role.subEditor', ROLE_ID_ASSISTANT => 'user.role.assistant');
     // Get all the uploader user group id's
     $uploaderUserGroupIds = array();
     $dataElements = $this->getGridDataElements($request);
     foreach ($dataElements as $id => $rowElement) {
         $submissionFile = $rowElement['submissionFile'];
         $uploaderUserGroupIds[] = $submissionFile->getUserGroupId();
     }
     $uploaderUserGroupIds = array_unique($uploaderUserGroupIds);
     $userGroupIds = array();
     foreach ($roles as $roleId => $roleName) {
         $userIds = array();
         $assignments = $stageAssignmentDao->getBySubmissionAndRoleId($submission->getId(), $roleId, $this->getStageId());
         // Only include a role column if there is at least one user assigned from that role to this stage.
         if (!$assignments->wasEmpty()) {
             while ($assignment = $assignments->next()) {
                 $userIds[] = $assignment->getUserId();
                 $userGroupIds[] = $assignment->getUserGroupId();
             }
             $userIds = array_unique($userIds);
             $this->addColumn(new SignoffStatusFromFileGridColumn('role-' . $roleId, $roleName, null, $this->getSymbolic(), $userIds, $this->getRequestArgs(), in_array($currentUser->getId(), $userIds), array('hoverTitle', true)));
         }
         unset($assignments);
     }
     // Add a column for uploader User Groups not present in the previous groups
     $uploaderUserGroupIds = array_diff($uploaderUserGroupIds, array_unique($userGroupIds));
     $userGroupDao = DAORegistry::getDAO('UserGroupDAO');
     foreach ($uploaderUserGroupIds as $userGroupId) {
         $userGroup = $userGroupDao->getById($userGroupId);
         assert(is_a($userGroup, 'UserGroup'));
         $this->addColumn(new UploaderUserGroupGridColumn($userGroup));
     }
 }
 /**
  * @see PKPHandler::initialize()
  */
 function initialize(&$request)
 {
     // Basic grid configuration
     $this->setId('fairCopyFiles');
     $this->setTitle('editor.monograph.fairCopy');
     // Load grid data.
     $this->loadMonographFiles();
     // Load additional translation components.
     Locale::requireComponents(array(LOCALE_COMPONENT_OMP_EDITOR));
     // Columns
     import('controllers.grid.files.fairCopy.FairCopyFilesGridCellProvider');
     $cellProvider = new FairCopyFilesGridCellProvider();
     parent::initialize($request, $cellProvider);
     // Add a column for the uploader.
     // FIXME: We're just adding some placeholder text here until this
     // is correctly implemented, see #6233.
     $this->addColumn(new GridColumn('select', null, 'FIXME', 'controllers/grid/common/cell/statusCell.tpl', $cellProvider));
     // Add another column for the uploader's role
     // FIXME: We're just adding some placeholder text here until this
     // is correctly implemented, see #6233.
     $this->addColumn(new GridColumn('uploader-name', null, 'FIXME', 'controllers/grid/common/cell/statusCell.tpl', $cellProvider));
 }
 /**
  * @copydoc PKPHandler::initialize()
  */
 function initialize($request)
 {
     parent::initialize($request);
     $this->setTitle('editor.submission.production.productionReadyFiles');
     $this->setInstructions('editor.submission.production.productionReadyFilesDescription');
     $currentUser = $request->getUser();
     // Get all the uploader user group id's
     $uploaderUserGroupIds = array();
     $dataElements = $this->getGridDataElements($request);
     foreach ($dataElements as $id => $rowElement) {
         $submissionFile = $rowElement['submissionFile'];
         $uploaderUserGroupIds[] = $submissionFile->getUserGroupId();
     }
     // Make sure each is only present once
     $uploaderUserGroupIds = array_unique($uploaderUserGroupIds);
     // Add a Uploader UserGroup column for each group
     $userGroupDao = DAORegistry::getDAO('UserGroupDAO');
     foreach ($uploaderUserGroupIds as $userGroupId) {
         $userGroup = $userGroupDao->getById($userGroupId);
         assert(is_a($userGroup, 'UserGroup'));
         $this->addColumn(new UploaderUserGroupGridColumn($userGroup));
     }
 }