Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
PublicationEntryHandler.inc.php
1 <?php
2 
16 // Import the base Handler.
17 import('classes.handler.Handler');
18 
20 
23 
25  var $_stageId;
26 
29 
34  parent::Handler();
35  $this->addRoleAssignment(
36  array(ROLE_ID_SUB_EDITOR, ROLE_ID_MANAGER),
37  array('fetch', 'fetchFormatInfo'));
38  }
39 
40 
41  //
42  // Overridden methods from Handler
43  //
47  function initialize($request, $args = null) {
48  parent::initialize($request, $args);
49 
50  $this->_submission =& $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
51  $this->_stageId =& $this->getAuthorizedContextObject(ASSOC_TYPE_WORKFLOW_STAGE);
52  $this->_tabPosition = (int) $request->getUserVar('tabPos');
53 
54  // Load grid-specific translations
55  AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_APP_SUBMISSION);
56  $this->setupTemplate($request);
57  }
58 
62  function authorize($request, &$args, $roleAssignments) {
63  $stageId = (int) $request->getUserVar('stageId');
64  import('classes.security.authorization.WorkflowStageAccessPolicy');
65  $this->addPolicy(new WorkflowStageAccessPolicy($request, $args, $roleAssignments, 'submissionId', $stageId));
66  return parent::authorize($request, $args, $roleAssignments);
67  }
68 
69 
70  //
71  // Getters and Setters
72  //
77  function &getSubmission() {
78  return $this->_submission;
79  }
80 
85  function getStageId() {
86  return $this->_stageId;
87  }
88 
93  function getTabPosition() {
94  return $this->_tabPosition;
95  }
96 
97  //
98  // Public handler methods
99  //
105  function fetch($args, $request) {
106  $templateMgr = TemplateManager::getManager($request);
107 
108  $submission = $this->getSubmission();
109 
110  $templateMgr->assign('submissionId', $submission->getId());
111  $templateMgr->assign('stageId', $this->getStageId());
112  $tabPosition = (int) $this->getTabPosition();
113  $templateMgr->assign('selectedTab', $tabPosition);
114 
115  if ($request->getUserVar('hideHelp')) {
116  $templateMgr->assign('hideHelp', true);
117  }
118 
119  $this->setupTemplate($request);
120  }
121 
128  function fetchFormatInfo($args, $request) {
129  assert(false); // provided in sub classes, submission-specific.
130  }
131 }
132 
133 ?>
addPolicy($authorizationPolicy, $addToTop=false)
static requireComponents()
setupTemplate($request)
Class to control access to OMP&#39;s submission workflow stage components.
addRoleAssignment($roleIds, $operations)
authorize($request, &$args, $roleAssignments)
Base request handler application class.
Definition: Handler.inc.php:20
Base handler to generate the tab structure for a submission&#39;s publication metadata.
& getAuthorizedContextObject($assocType)