Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AuthorSignoffFilesGridHandler.inc.php
1 <?php
2 
18 import('lib.pkp.classes.controllers.grid.GridHandler');
19 import('lib.pkp.controllers.grid.files.fileSignoff.AuthorSignoffFilesGridRow');
20 
22 
27  function AuthorSignoffFilesGridHandler($stageId, $symbolic) {
28  import('lib.pkp.controllers.grid.files.fileSignoff.AuthorSignoffFilesGridDataProvider');
29  parent::GridHandler(new AuthorSignoffFilesGridDataProvider($symbolic, $stageId));
30 
31  $this->addRoleAssignment(
32  array(ROLE_ID_AUTHOR),
33  array('fetchGrid', 'fetchRow', 'signOffFiles')
34  );
35  }
36  //
37  // Getters
38  //
43  function getStageId() {
44  $dataProvider = $this->getDataProvider();
45  return $dataProvider->getStageId();
46  }
47 
48  //
49  // Implement template methods from PKPHandler
50  //
54  function initialize($request) {
55  parent::initialize($request);
56 
58  LOCALE_COMPONENT_PKP_COMMON,
59  LOCALE_COMPONENT_APP_COMMON,
60  LOCALE_COMPONENT_PKP_SUBMISSION,
61  LOCALE_COMPONENT_APP_SUBMISSION
62  );
63 
64  $user = $request->getUser();
65 
66  $gridDataProvider = $this->getDataProvider(); /* @var $gridDataProvider AuthorSignoffFilesGridDataProvider */
67  $gridDataProvider->setUserId($user->getId());
68 
69  $addSignoffFileLinkAction = $gridDataProvider->getAddSignoffFile($request);
70  if ($addSignoffFileLinkAction) {
71  $this->addAction($addSignoffFileLinkAction);
72  }
73 
74  // The file name column is common to all file grid types.
75  import('lib.pkp.controllers.grid.files.FileNameGridColumn');
76  $this->addColumn(new FileNameGridColumn(true, $this->getStageId()));
77 
78  import('lib.pkp.controllers.grid.files.fileSignoff.AuthorSignoffFilesGridCellProvider');
79  $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
80  $cellProvider = new AuthorSignoffFilesGridCellProvider($submission, $this->getStageId());
81 
82  // Add a column to show whether the author uploaded a copyedited version of the file
83  $this->addColumn(
84  new GridColumn(
85  'response',
86  'submission.response',
87  null,
88  'controllers/grid/gridCell.tpl',
89  $cellProvider,
90  array('alignment' => COLUMN_ALIGNMENT_LEFT))
91  );
92  }
93 
94  //
95  // Overridden methods from GridHandler
96  //
100  function getRowInstance() {
101  return new AuthorSignoffFilesGridRow($this->getStageId());
102  }
103 }
104 
105 ?>
Display the files that the user has been asked to signoff on.
static requireComponents()
addAction($action, $position=GRID_ACTION_POSITION_ABOVE)
addColumn($column)
Class defining basic operations for handling HTML grids.
Implements a file name column.
Author&#39;s view of files that they have been asked to signoff on.
addRoleAssignment($roleIds, $operations)
Provide data for author signoff file grids.
Cell provider for the response column of a file/signoff grid.
Represents a column within a grid. It is used to configure the way cells within a column are displaye...
& getAuthorizedContextObject($assocType)