Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
AuthorGridRow.inc.php
1 <?php
2 
16 import('lib.pkp.controllers.grid.users.author.PKPAuthorGridRow');
17 
18 
23  function AuthorGridRow($monograph, $readOnly = false) {
24  parent::PKPAuthorGridRow($monograph, $readOnly);
25  }
26 
33  function canAdminister($request) {
34  $submission = $this->getSubmission();
35 
36  $user = $request->getUser();
37  $stageAssignmentDao = DAORegistry::getDAO('StageAssignmentDAO');
38  $userGroupDao = DAORegistry::getDAO('UserGroupDAO');
39 
40  // If the submission hasn't been finalized, allow.
41  if (!$submission->getDateSubmitted()) return true;
42 
43  $stageAssignments = $stageAssignmentDao->getBySubmissionAndStageId($submission->getId(), $submission->getStageId(), null, $user->getId());
44  while ($stageAssignment = $stageAssignments->next()) {
45  $userGroup = $userGroupDao->getById($stageAssignment->getUserGroupId());
46  if (in_array($userGroup->getRoleId(), array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT))) {
47  return true;
48  break;
49  }
50  }
51  return false;
52  }
53 }
54 
55 ?>
static & getDAO($name, $dbconn=null)
Author grid row definition.
canAdminister($request)
AuthorGridRow($monograph, $readOnly=false)
Base class for author grid row definition.