Open Preprint Systems  3.3.0
WorkflowTabHandler.inc.php
1 <?php
2 
16 // Import the base Handler.
17 import('lib.pkp.controllers.tab.workflow.PKPWorkflowTabHandler');
18 
20 
24  function fetchTab($args, $request) {
25  $this->setupTemplate($request);
26  $templateMgr = TemplateManager::getManager($request);
27  $stageId = $this->getAuthorizedContextObject(ASSOC_TYPE_WORKFLOW_STAGE);
28  $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
29  switch ($stageId) {
30  case WORKFLOW_STAGE_ID_PRODUCTION:
31  $errors = [];
32  $context = $request->getContext();
33 
34  $stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO'); /* @var $stageAssignmentDao StageAssignmentDAO */
35  $submitterAssignments = $stageAssignmentDao->getBySubmissionAndRoleId($submission->getId(), ROLE_ID_AUTHOR);
36 
37  while ($assignment = $submitterAssignments->next()) {
38  \HookRegistry::call('Publication::testAuthorValidatePublish', array(&$errors, $assignment->getUserId(), $context->getId(), $submission->getId()));
39  }
40 
41  if (!empty($errors)){
42  foreach ($errors as $error) {
43  $authorPublishRequirements .= $error . "<br />\n";
44  }
45  $templateMgr->assign('authorPublishRequirements', $authorPublishRequirements);
46  }
47  break;
48  }
49  return parent::fetchTab($args, $request);
50  }
51 
57  protected function getProductionNotificationOptions($submissionId) {
58  return array(
59  NOTIFICATION_LEVEL_NORMAL => array(
60  NOTIFICATION_TYPE_VISIT_CATALOG => array(ASSOC_TYPE_SUBMISSION, $submissionId),
61  NOTIFICATION_TYPE_ASSIGN_PRODUCTIONUSER => array(ASSOC_TYPE_SUBMISSION, $submissionId),
62  NOTIFICATION_TYPE_AWAITING_REPRESENTATIONS => array(ASSOC_TYPE_SUBMISSION, $submissionId),
63  ),
64  NOTIFICATION_LEVEL_TRIVIAL => array()
65  );
66  }
67 }
68 
69 
DAORegistry\getDAO
static & getDAO($name, $dbconn=null)
Definition: DAORegistry.inc.php:57
PKPWorkflowTabHandler\setupTemplate
setupTemplate($request)
Definition: PKPWorkflowTabHandler.inc.php:149
PKPWorkflowTabHandler
Handle AJAX operations for workflow tabs.
Definition: PKPWorkflowTabHandler.inc.php:23
WorkflowTabHandler
Handle AJAX operations for workflow tabs.
Definition: WorkflowTabHandler.inc.php:19
WorkflowTabHandler\fetchTab
fetchTab($args, $request)
Definition: WorkflowTabHandler.inc.php:24
PKPTemplateManager\getManager
static & getManager($request=null)
Definition: PKPTemplateManager.inc.php:1226
PKPHandler\getAuthorizedContextObject
& getAuthorizedContextObject($assocType)
Definition: PKPHandler.inc.php:174
WorkflowTabHandler\getProductionNotificationOptions
getProductionNotificationOptions($submissionId)
Definition: WorkflowTabHandler.inc.php:57
HookRegistry\call
static call($hookName, $args=null)
Definition: HookRegistry.inc.php:86