Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AuthorProofingSignoffFilesCategoryGridDataProvider.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.CategoryGridDataProvider');
17 
19 
24  import('lib.pkp.controllers.grid.files.fileSignoff.AuthorSignoffFilesGridDataProvider');
25  $gridDataProvider = new AuthorSignoffFilesGridDataProvider('SIGNOFF_PROOFING', WORKFLOW_STAGE_ID_PRODUCTION);
26  $this->setDataProvider($gridDataProvider);
27  }
28 
33  function setUserId($userId) {
34  $dataProvider = $this->getDataProvider();
35  $dataProvider->setUserId($userId);
36  }
37 
41  function getAuthorizationPolicy($request, $args, $roleAssignments) {
42  $dataProvider = $this->getDataProvider();
43  return $dataProvider->getAuthorizationPolicy($request, $args, $roleAssignments);
44  }
45 
49  function getRequestArgs() {
50  $dataProvider = $this->getDataProvider();
51  return $dataProvider->getRequestArgs();
52  }
53 
57  function loadData() {
58  $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
59  $representationDao = Application::getRepresentationDAO();
60  $representationFactory = $representationDao->getBySubmissionId($submission->getId());
61 
62  return $representationFactory->toAssociativeArray();
63  }
64 
68  function &getCategoryData($representation, $filter = null) {
69  $dataProvider = $this->getDataProvider();
70  $signoffFiles = $dataProvider->loadData();
71 
72  $categoryData = array();
73  foreach ($signoffFiles as $signoffId => $objects) {
74  if ($objects['submissionFile']->getAssocType() == ASSOC_TYPE_REPRESENTATION &&
75  $objects['submissionFile']->getAssocId() == $representation->getId()) {
76  $categoryData[$signoffId] = $objects;
77  }
78  }
79 
80  return $categoryData;
81  }
82 
83 
84  //
85  // Public methods
86  //
90  function getAddSignoffFile($request) {
91  $dataProvider = $this->getDataProvider();
92  return $dataProvider->getAddSignoffFile($request);
93  }
94 }
95 
96 ?>
static getRepresentationDAO()
Provide access to author signoff proofing files data for category grids.
Provide data for author signoff file grids.
Provide access to category grid data. Can optionally use a grid data provider object that already pro...
& getAuthorizedContextObject($assocType)