Inheritance: extends GridHandler
 /**
  * @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);
 }
Ejemplo 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());
 }
 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);
 }
Ejemplo n.º 7
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));
     }
 }
 /**
  * Display the file upload form
  * @param $args array
  * @param $request PKPRequest
  * @return string Serialized JSON object
  */
 function displayFileForm(&$args, &$request)
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('isEditing', true);
     return parent::displayFileForm($args, $request);
 }
Ejemplo n.º 11
0
 /**
  * @see GridHandler::loadData()
  */
 function &loadData($request, $filter)
 {
     // Retrieve all press and series editor user
     // groups from the database.
     $router =& $request->getRouter();
     $press =& $router->getContext($request);
     $userGroupDao =& DAORegistry::getDAO('UserGroupDAO');
     /* @var $userGroupDao UserGroupDAO */
     $editorGroups = array();
     foreach (array(ROLE_ID_PRESS_MANAGER, ROLE_ID_SERIES_EDITOR) as $editorRoleId) {
         $editorGroupFactory =& $userGroupDao->getByRoleId($press->getId(), $editorRoleId);
         while ($editorGroup =& $editorGroupFactory->next()) {
             /* @var $editorGroup UserGroup */
             $editorGroups[$editorGroup->getId()] =& $editorGroup;
             unset($editorGroup);
         }
         unset($editorGroupFactory);
     }
     // Go through the list of workflow stage participants and
     // identify all assigned press and series editors.
     $monograph =& $this->getMonograph();
     $signoffDao =& DAORegistry::getDAO('SignoffDAO');
     /* @var $signoffDao SignoffDAO */
     $signoffFactory =& $signoffDao->getAllBySymbolic('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monograph->getId(), null, $this->getStageId());
     $stageEditors = array();
     while ($signoff =& $signoffFactory->next()) {
         /* @var $signoff Signoff */
         if (isset($editorGroups[$signoff->getUserGroupId()])) {
             if (!isset($stageEditors[$signoff->getUserId()])) {
                 $stageEditors[$signoff->getUserId()] = array();
             }
             $stageEditors[$signoff->getUserId()][$signoff->getUserGroupId()] =& $editorGroups[$signoff->getUserGroupId()];
         }
     }
     // Now go through all files and create a signoff for each of
     // the assigned editors unless that editor is the uploader.
     $submissionFiles =& parent::loadData($request, $filter);
     foreach ($submissionFiles as $fileId => $submissionFileData) {
         assert(isset($submissionFileData['submissionFile']));
         $monographFile =& $submissionFileData['submissionFile'];
         /* @var $monographFile MonographFile */
         // All press and series editors assigned to the stage except
         // for those who uploaded the file have to sign off this file.
         $fileSignoffs = $stageEditors;
         unset($fileSignoffs[$monographFile->getUploaderUserId()]);
         $submissionFiles[$fileId]['signoffs'] = $fileSignoffs;
     }
     return $submissionFiles;
 }