Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AuthorSignoffFilesGridCellProvider.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.GridCellProvider');
17 
19  /* @var Submission */
20  var $_submission;
21 
22  /* @var int */
23  var $_stageId;
24 
30  function AuthorSignoffFilesGridCellProvider($submission, $stageId) {
31  $this->_submission = $submission;
32  $this->_stageId = $stageId;
33  parent::GridCellProvider();
34  }
35 
40  function getSubmission() {
41  return $this->_submission;
42  }
43 
48  function getStageId() {
49  return $this->_stageId;
50  }
51 
57  function getSignoff($row) {
58  $rowData = $row->getData();
59  assert(is_a($rowData['signoff'], 'Signoff'));
60  return $rowData['signoff'];
61  }
62 
68  function getSubmissionFile($row) {
69  $rowData = $row->getData();
70  assert(is_a($rowData['submissionFile'], 'SubmissionFile'));
71  return $rowData['submissionFile'];
72  }
73 
81  function getCellActions($request, $row, $column, $position = GRID_ACTION_POSITION_DEFAULT) {
82  if ($column->getId() == 'response') {
83  $signoff = $this->getSignoff($row);
84  $submission = $this->getSubmission();
85  if (!$signoff->getDateCompleted()) {
86  import('lib.pkp.controllers.api.signoff.linkAction.AddSignoffFileLinkAction');
87  $addFileAction = new AddSignoffFileLinkAction(
88  $request, $submission->getId(),
89  $this->getStageId(), $signoff->getSymbolic(), $signoff->getId(),
90  __('submission.upload.signoff'), __('submission.upload.signoff')
91  );
92 
93  // FIXME: This is not ideal.
94  $addFileAction->_title = null;
95  return array($addFileAction);
96  }
97 
98  import('lib.pkp.controllers.informationCenter.linkAction.SignoffNotesLinkAction');
99  return array(new SignoffNotesLinkAction($request, $signoff, $submission->getId(), $this->getStageId()));
100  }
101 
102  return parent::getCellActions($request, $row, $column, $position);
103  }
104 }
105 
106 ?>
Base class for a grid column&#39;s cell provider.
Class for signoff file upload actions.
Cell provider for the response column of a file/signoff grid.
An action to open the signoff history modal.
getCellActions($request, $row, $column, $position=GRID_ACTION_POSITION_DEFAULT)