Open Journal Systems  3.3.0
ManageCopyeditFilesGridHandler.inc.php
1 <?php
2 
16 import('lib.pkp.controllers.grid.files.SelectableSubmissionFileListCategoryGridHandler');
17 
22  function __construct() {
23  import('lib.pkp.controllers.grid.files.SubmissionFilesCategoryGridDataProvider');
24  parent::__construct(
25  new SubmissionFilesCategoryGridDataProvider(SUBMISSION_FILE_COPYEDIT),
26  WORKFLOW_STAGE_ID_EDITING,
27  FILE_GRID_ADD|FILE_GRID_DELETE|FILE_GRID_VIEW_NOTES|FILE_GRID_EDIT
28  );
29 
30  $this->addRoleAssignment(
31  array(
32  ROLE_ID_SUB_EDITOR,
33  ROLE_ID_MANAGER,
34  ROLE_ID_ASSISTANT
35  ),
36  array(
37  'fetchGrid', 'fetchCategory', 'fetchRow',
38  'addFile',
39  'downloadFile',
40  'deleteFile',
41  'updateCopyeditFiles'
42  )
43  );
44 
45  // Set the grid title.
46  $this->setTitle('submission.copyedited');
47  }
48 
49 
50  //
51  // Public handler methods
52  //
59  function updateCopyeditFiles($args, $request) {
60  $submission = $this->getSubmission();
61 
62  import('lib.pkp.controllers.grid.files.copyedit.form.ManageCopyeditFilesForm');
63  $manageCopyeditFilesForm = new ManageCopyeditFilesForm($submission->getId());
64  $manageCopyeditFilesForm->readInputData();
65 
66  if ($manageCopyeditFilesForm->validate()) {
67  $manageCopyeditFilesForm->execute(
68  $this->getGridCategoryDataElements($request, $this->getStageId())
69  );
70 
71  if ($submission->getStageId() == WORKFLOW_STAGE_ID_EDITING ||
72  $submission->getStageId() == WORKFLOW_STAGE_ID_PRODUCTION) {
73 
74  $notificationMgr = new NotificationManager();
75  $notificationMgr->updateNotification(
76  $request,
77  array(
78  NOTIFICATION_TYPE_ASSIGN_COPYEDITOR,
79  NOTIFICATION_TYPE_AWAITING_COPYEDITS,
80  ),
81  null,
82  ASSOC_TYPE_SUBMISSION,
83  $submission->getId()
84  );
85  }
86 
87  // Let the calling grid reload itself
88  return DAO::getDataChangedEvent();
89  } else {
90  return new JSONMessage(false);
91  }
92  }
93 }
94 
95 
PKPHandler\addRoleAssignment
addRoleAssignment($roleIds, $operations)
Definition: PKPHandler.inc.php:213
SelectableSubmissionFileListCategoryGridHandler\getSubmission
getSubmission()
Definition: SelectableSubmissionFileListCategoryGridHandler.inc.php:86
ManageCopyeditFilesGridHandler\updateCopyeditFiles
updateCopyeditFiles($args, $request)
Definition: ManageCopyeditFilesGridHandler.inc.php:59
SubmissionFilesCategoryGridDataProvider
Definition: SubmissionFilesCategoryGridDataProvider.inc.php:19
DAO\getDataChangedEvent
static getDataChangedEvent($elementId=null, $parentElementId=null, $content='')
Definition: DAO.inc.php:647
JSONMessage
Class to represent a JSON (Javascript Object Notation) message.
Definition: JSONMessage.inc.php:18
ManageCopyeditFilesGridHandler
Handle the copyedited file selection grid.
Definition: ManageCopyeditFilesGridHandler.inc.php:18
GridHandler\setTitle
setTitle($title)
Definition: GridHandler.inc.php:215
SelectableSubmissionFileListCategoryGridHandler\getStageId
getStageId()
Definition: SelectableSubmissionFileListCategoryGridHandler.inc.php:78
SelectableSubmissionFileListCategoryGridHandler
Handle selectable submission file list category grid requests.
Definition: SelectableSubmissionFileListCategoryGridHandler.inc.php:30
NotificationManager
Definition: NotificationManager.inc.php:19
CategoryGridHandler\getGridCategoryDataElements
& getGridCategoryDataElements($request, $categoryElement)
Definition: CategoryGridHandler.inc.php:123
ManageCopyeditFilesForm
Form to add files to the copyedited files grid.
Definition: ManageCopyeditFilesForm.inc.php:18
ManageCopyeditFilesGridHandler\__construct
__construct()
Definition: ManageCopyeditFilesGridHandler.inc.php:22