Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AuthorDashboardHandler.inc.php
1 <?php
2 
16 // Import base class
17 import('lib.pkp.pages.authorDashboard.PKPAuthorDashboardHandler');
18 
20 
25  parent::PKPAuthorDashboardHandler();
26  }
27 
28 
29  //
30  // Implement template methods from PKPHandler
31  //
35  function authorize($request, &$args, $roleAssignments) {
36  import('classes.security.authorization.OmpAuthorDashboardAccessPolicy');
37  $this->addPolicy(new OmpAuthorDashboardAccessPolicy($request, $args, $roleAssignments), true);
38 
39  return parent::authorize($request, $args, $roleAssignments);
40  }
41 
42 
43  //
44  // Public handler operations
45  //
51  function submission($args, $request) {
52  $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
53  $templateMgr = TemplateManager::getManager($request);
54  $reviewRoundDao = DAORegistry::getDAO('ReviewRoundDAO');
55  $internalReviewRounds = $reviewRoundDao->getBySubmissionId($submission->getId(), WORKFLOW_STAGE_ID_INTERNAL_REVIEW);
56  $templateMgr->assign('internalReviewRounds', $internalReviewRounds);
57  return parent::submission($args, $request);
58  }
59 
60 
61  //
62  // Protected helper methods
63  //
70  protected function _fileStageFromWorkflowStage($currentStage) {
71  switch ($currentStage) {
72  case WORKFLOW_STAGE_ID_INTERNAL_REVIEW:
73  return SUBMISSION_FILE_REVIEW_REVISION;
74  default:
75  return parent::_fileStageFromWorkflowStage($currentStage);
76  }
77  }
78 
84  protected function _getLastReviewRoundNumbers($submission) {
85  $reviewRoundDao = DAORegistry::getDAO('ReviewRoundDAO');
86  $lastInternalReviewRound = $reviewRoundDao->getLastReviewRoundBySubmissionId($submission->getId(), WORKFLOW_STAGE_ID_INTERNAL_REVIEW);
87  if ($lastInternalReviewRound) {
88  $lastInternalReviewRoundNumber = $lastInternalReviewRound->getRound();
89  } else {
90  $lastInternalReviewRoundNumber = 0;
91  }
92  $lastReviewRoundNumbers = parent::_getLastReviewRoundNumbers($submission);
93  $lastReviewRoundNumbers['internalReview'] = $lastInternalReviewRoundNumber;
94  return $lastReviewRoundNumbers;
95  }
96 
102  protected function _getNotificationRequestOptions($submission) {
103  $submissionAssocTypeAndIdArray = array(ASSOC_TYPE_SUBMISSION, $submission->getId());
104  $notificationRequestOptions = parent::_getNotificationRequestOptions($submission);
105  $notificationRequestOptions[NOTIFICATION_LEVEL_TASK][NOTIFICATION_TYPE_PENDING_INTERNAL_REVISIONS] = $submissionAssocTypeAndIdArray;
106  $notificationRequestOptions[NOTIFICATION_LEVEL_NORMAL][NOTIFICATION_TYPE_EDITOR_DECISION_INTERNAL_REVIEW] = $submissionAssocTypeAndIdArray;
107  return $notificationRequestOptions;
108  }
109 }
110 
111 ?>
static & getDAO($name, $dbconn=null)
addPolicy($authorizationPolicy, $addToTop=false)
Handle requests for the author dashboard.
Handle requests for the author dashboard.
Class to control access to OMP author dashboard.
authorize($request, &$args, $roleAssignments)
& getAuthorizedContextObject($assocType)