Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AuthorProofingSignoffFilesGridHandler.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.CategoryGridHandler');
17 import('lib.pkp.classes.controllers.grid.DataObjectGridCellProvider');
18 
24  import('lib.pkp.controllers.grid.files.proof.AuthorProofingSignoffFilesCategoryGridDataProvider');
25  parent::CategoryGridHandler(new AuthorProofingSignoffFilesCategoryGridDataProvider());
26 
27  $this->addRoleAssignment(
28  array(ROLE_ID_AUTHOR),
29  array('fetchGrid', 'fetchCategory', 'fetchRow')
30  );
31  }
32 
36  function initialize($request, $args) {
37  parent::initialize($request);
38 
39  $dataProvider = $this->getDataProvider();
40  $user = $request->getUser();
41  $dataProvider->setUserId($user->getId());
42 
44  LOCALE_COMPONENT_PKP_COMMON,
45  LOCALE_COMPONENT_APP_COMMON,
46  LOCALE_COMPONENT_PKP_SUBMISSION,
47  LOCALE_COMPONENT_APP_SUBMISSION
48  );
49 
50  $addSignoffFileLinkAction = $dataProvider->getAddSignoffFile($request);
51  if ($addSignoffFileLinkAction) {
52  $this->addAction($addSignoffFileLinkAction);
53  }
54 
55  // The file name column is common to all file grid types.
56  import('lib.pkp.controllers.grid.files.FileNameGridColumn');
57  $this->addColumn(new FileNameGridColumn(true, WORKFLOW_STAGE_ID_PRODUCTION));
58 
59  import('lib.pkp.controllers.grid.files.fileSignoff.AuthorSignoffFilesGridCellProvider');
60  $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
61  $cellProvider = new AuthorSignoffFilesGridCellProvider($submission, WORKFLOW_STAGE_ID_PRODUCTION);
62 
63  // Add a column to show whether the author uploaded a signoff.
64  $this->addColumn(
65  new GridColumn(
66  'response',
67  'submission.response',
68  null,
69  'controllers/grid/gridCell.tpl',
70  $cellProvider)
71  );
72 
73  // Set the grid title.
74  $this->setTitle('submission.pageProofs');
75  }
76 
80  function getRowInstance() {
81  import('lib.pkp.controllers.grid.files.fileSignoff.AuthorSignoffFilesGridRow');
82  return new AuthorSignoffFilesGridRow(WORKFLOW_STAGE_ID_PRODUCTION);
83  }
84 
89  import('lib.pkp.controllers.grid.files.proof.AuthorProofingGridCategoryRow');
90  return new AuthorProofingGridCategoryRow();
91  }
92 }
93 
94 ?>
static requireComponents()
addAction($action, $position=GRID_ACTION_POSITION_ABOVE)
addColumn($column)
Display the files the author has been asked to sign off for proofing.
Implements a file name column.
Provide access to author signoff proofing files data for category grids.
Author&#39;s view of files that they have been asked to signoff on.
addRoleAssignment($roleIds, $operations)
Class defining basic operations for handling HTML grids with categories.
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)
Class defining data for an author proofing grid category row.