Open Journal Systems  3.0.0
 All Classes Namespaces Functions Variables Groups Pages
CopyeditingFilesGridHandler.inc.php
1 <?php
2 
16 // import grid signoff files grid base classes
17 import('controllers.grid.files.signoff.SignoffFilesGridHandler');
18 
19 // Import submission file class which contains the SUBMISSION_FILE_* constants.
20 import('lib.pkp.classes.submission.SubmissionFile');
21 
22 // Import SUBMISSION_EMAIL_* constants.
23 import('lib.pkp.classes.log.PKPSubmissionEmailLogEntry');
24 
30  parent::SignoffFilesGridHandler(
31  WORKFLOW_STAGE_ID_EDITING,
32  SUBMISSION_FILE_COPYEDIT,
33  'SIGNOFF_COPYEDITING',
34  SUBMISSION_EMAIL_COPYEDIT_NOTIFY_AUTHOR
35  );
36 
37  $this->addRoleAssignment(
38  array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT),
39  array(
40  'approveCopyedit'
41  )
42  );
43  }
44 
48  function authorize($request, &$args, $roleAssignments) {
49  // Approve copyediting file needs submission access policy.
50  $router = $request->getRouter();
51  if ($router->getRequestedOp($request) == 'approveCopyedit') {
52  import('classes.security.authorization.SubmissionFileAccessPolicy');
53  $this->addPolicy(new SubmissionFileAccessPolicy($request, $args, $roleAssignments, SUBMISSION_FILE_ACCESS_MODIFY));
54  }
55 
56  return parent::authorize($request, $args, $roleAssignments);
57  }
58 
59 
64  function initialize($request) {
65  parent::initialize($request);
66 
67  $this->setTitle('submission.copyediting');
68  $this->setInstructions('editor.submission.editorial.copyeditingDescription');
69 
70  // Basic grid configuration
71  $this->setId('copyeditingFiles');
72  }
73 
74 
75  //
76  // Public methods
77  //
84  function approveCopyedit($args, $request) {
85  $submissionFile = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION_FILE);
86  $submission = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
87 
88  if ($submissionFile->getViewable()) {
89  // No longer expose the file to be sent to next stage.
90  $submissionFile->setViewable(false);
91  } else {
92  // Expose the file.
93  $submissionFile->setViewable(true);
94  }
95 
96  $submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO');
97  $submissionFileDao->updateObject($submissionFile);
98 
99  return DAO::getDataChangedEvent($submissionFile->getId());
100  }
101 }
102 
103 ?>
static & getDAO($name, $dbconn=null)
Class to control (write) access to submissions and (read) access to submission details in OJS...
Subclass of file editor/auditor grid for copyediting files.
static getDataChangedEvent($elementId=null, $parentElementId=null)
Definition: DAO.inc.php:606
authorize($request, &$args, $roleAssignments)
Base grid for providing a list of files as categories and the requested signoffs on that file as rows...