Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
SubmissionCopyeditHandler.inc.php
1 <?php
2 
17 import('pages.copyeditor.CopyeditorHandler');
18 
24  parent::CopyeditorHandler();
25  }
26 
32  function submission($args, &$request) {
33  $articleId = (int) array_shift($args);
34  $this->validate($request, $articleId);
35 
36  $router =& $request->getRouter();
37 
39  $this->setupTemplate(true, $articleId);
40 
42 
43  $journal =& $router->getContext($request);
44  $useLayoutEditors = $journal->getSetting('useLayoutEditors');
45  $metaCitations = $journal->getSetting('metaCitations');
46 
47  $templateMgr =& TemplateManager::getManager();
48 
49  $templateMgr->assign_by_ref('submission', $submission);
50  $templateMgr->assign_by_ref('copyeditor', $submission->getUserBySignoffType('SIGNOFF_COPYEDITING_INITIAL'));
51  $templateMgr->assign_by_ref('initialCopyeditFile', $submission->getFileBySignoffType('SIGNOFF_COPYEDITING_INITIAL'));
52  $templateMgr->assign_by_ref('editorAuthorCopyeditFile', $submission->getFileBySignoffType('SIGNOFF_COPYEDITING_AUTHOR'));
53  $templateMgr->assign_by_ref('finalCopyeditFile', $submission->getFileBySignoffType('SIGNOFF_COPYEDITING_FINAL'));
54  $templateMgr->assign('useLayoutEditors', $useLayoutEditors);
55  $templateMgr->assign('metaCitations', $metaCitations);
56  $templateMgr->assign('helpTopicId', 'editorial.copyeditorsRole.copyediting');
57  $templateMgr->display('copyeditor/submission.tpl');
58  }
59 
65  function completeCopyedit($args, $request) {
66  $articleId = (int) $request->getUserVar('articleId');
67  $this->validate($request, $articleId);
68  $this->setupTemplate(true, $articleId);
69 
70  if (CopyeditorAction::completeCopyedit($this->submission, $request->getUserVar('send'), $request)) {
71  $request->redirect(null, null, 'submission', $articleId);
72  }
73  }
74 
80  function completeFinalCopyedit($args, $request) {
81  $articleId = $request->getUserVar('articleId');
82  $this->validate($request, $articleId);
83  $this->setupTemplate(true, $articleId);;
84  if (CopyeditorAction::completeFinalCopyedit($this->submission, $request->getUserVar('send'), $request)) {
85  $request->redirect(null, null, 'submission', $articleId);
86  }
87  }
88 
94  function uploadCopyeditVersion($args, $request) {
95  $articleId = (int) $request->getUserVar('articleId');
96  $this->validate($request, $articleId);
97  $copyeditStage = $request->getUserVar('copyeditStage');
98  CopyeditorAction::uploadCopyeditVersion($this->submission, $copyeditStage, $request);
99 
100  $request->redirect(null, null, 'submission', $articleId);
101  }
102 
103  //
104  // Misc
105  //
106 
111  function downloadFile($args, &$request) {
112  $articleId = (int) array_shift($args);
113  $fileId = (int) array_shift($args);
114  $revision = array_shift($args); // Can be null
115 
116  $this->validate($request, $articleId);
117  if (!CopyeditorAction::downloadCopyeditorFile($this->submission, $fileId, $revision)) {
118  $request->redirect(null, null, 'submission', $articleId);
119  }
120  }
121 
126  function viewFile($args, &$request) {
127  $articleId = (int) array_shift($args);
128  $fileId = (int) array_shift($args);
129  $revision = array_shift($args); // May be null
130 
131  $this->validate($request, $articleId);
132  if (!CopyeditorAction::viewFile($articleId, $fileId, $revision)) {
133  $request->redirect(null, null, 'submission', $articleId);
134  }
135  }
136 
137  //
138  // Proofreading
139  //
140 
146  function authorProofreadingComplete($args, $request) {
147  $articleId = (int) $request->getUserVar('articleId');
148  $this->validate($request, $articleId);
149  $this->setupTemplate(true, $articleId);
150 
151  $send = $request->getUserVar('send') ? true : false;
152 
153  import('classes.submission.proofreader.ProofreaderAction');
154 
155  if (ProofreaderAction::proofreadEmail($articleId, 'PROOFREAD_AUTHOR_COMPLETE', $request, $send?'':$request->url(null, 'copyeditor', 'authorProofreadingComplete', 'send'))) {
156  $request->redirect(null, null, 'submission', $articleId);
157  }
158  }
159 
165  function proofGalley($args, &$request) {
166  $articleId = (int) array_shift($args);
167  $galleyId = (int) array_shift($args);
168  $this->validate($request, $articleId);
169 
170  $templateMgr =& TemplateManager::getManager();
171  $templateMgr->assign('articleId', $articleId);
172  $templateMgr->assign('galleyId', $galleyId);
173  $templateMgr->display('submission/layout/proofGalley.tpl');
174  }
175 
181  function proofGalleyTop($args, &$request) {
182  $articleId = (int) array_shift($args);
183  $galleyId = (int) array_shift($args);
184  $this->validate($request, $articleId);
185 
186  $templateMgr =& TemplateManager::getManager();
187  $templateMgr->assign('articleId', $articleId);
188  $templateMgr->assign('galleyId', $galleyId);
189  $templateMgr->assign('backHandler', 'submission');
190  $templateMgr->display('submission/layout/proofGalleyTop.tpl');
191  }
192 
198  function proofGalleyFile($args, &$request) {
199  $articleId = (int) array_shift($args);
200  $galleyId = (int) array_shift($args);
201  $this->validate($request, $articleId);
202 
203  $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
204  $galley =& $galleyDao->getGalley($galleyId, $articleId);
205 
206  import('classes.file.ArticleFileManager'); // FIXME
207 
208  if (isset($galley)) {
209  if ($galley->isHTMLGalley()) {
210  $templateMgr =& TemplateManager::getManager();
211  $templateMgr->assign_by_ref('galley', $galley);
212  if ($galley->isHTMLGalley() && $styleFile =& $galley->getStyleFile()) {
213  $templateMgr->addStyleSheet($request->url(null, 'article', 'viewFile', array(
214  $articleId, $galleyId, $styleFile->getFileId()
215  )));
216  }
217  $templateMgr->display('submission/layout/proofGalleyHTML.tpl');
218 
219  } else {
220  // View non-HTML file inline
221  $this->viewFile(array($articleId, $galley->getFileId()), $request);
222  }
223  }
224  }
225 
231  function viewMetadata($args, $request) {
232  $articleId = (int) array_shift($args);
233  $journal =& $request->getJournal();
234  $this->validate($request, $articleId);
235  AppLocale::requireComponents(LOCALE_COMPONENT_OJS_AUTHOR);
237  $this->setupTemplate(true, $articleId, 'editing');
239  }
240 
246  function saveMetadata($args, &$request) {
247  $articleId = (int) $request->getUserVar('articleId');
248  $this->validate($request, $articleId);
249  $this->setupTemplate(true, $articleId);
250 
251  if (CopyeditorAction::saveMetadata($this->submission, $request)) {
252  $request->redirect(null, null, 'submission', $articleId);
253  }
254  }
255 
261  function removeArticleCoverPage($args, &$request) {
262  $articleId = (int) array_shift($args);
263  $this->validate($request, $articleId);
264 
265  $formLocale = array_shift($args);
266  if (!AppLocale::isLocaleValid($formLocale)) {
267  $request->redirect(null, null, 'viewMetadata', $articleId);
268  }
269 
270  import('classes.submission.sectionEditor.SectionEditorAction');
271  if (SectionEditorAction::removeArticleCoverPage($this->submission, $formLocale)) {
272  $request->redirect(null, null, 'viewMetadata', $articleId);
273  }
274  }
275 
276 
277  //
278  // Citation Editing
279  //
285  function submissionCitations($args, &$request) {
286  // Authorize the request.
287  $articleId = (int) array_shift($args);
288  $this->validate($request, $articleId);
289 
290  // Prepare the view.
291  $this->setupTemplate(true, $articleId);
292 
293  // Insert the citation editing assistant into the view.
295 
296  // Render the view.
297  $templateMgr =& TemplateManager::getManager();
298  $templateMgr->display('copyeditor/submissionCitations.tpl');
299  }
300 }
301 
302 ?>
isLocaleValid($locale)
copyeditUnderway(&$copyeditorSubmission, $request)
downloadCopyeditorFile($copyeditorSubmission, $fileId, $revision=null)
setupTemplate($subclass=false, $articleId=0, $parentPage=null)
viewMetadata($article, $journal)
Definition: Action.inc.php:59
removeArticleCoverPage($submission, $formLocale)
proofreadEmail($articleId, $mailType, $request, $actionPath= '')
uploadCopyeditVersion($copyeditorSubmission, $copyeditStage, $request)
viewFile($articleId, $fileId, $revision=null)
Definition: Action.inc.php:192
completeCopyedit($copyeditorSubmission, $send, $request)
validate($request, $articleId=null)
editCitations(&$request, &$submission)
completeFinalCopyedit($copyeditorSubmission, $send, $request)
Handle requests for submission tracking.
& getDAO($name, $dbconn=null)
Handle requests for copyeditor functions.
saveMetadata($article, &$request)
Definition: Action.inc.php:77