Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
SubmissionProofreadHandler.inc.php
1 <?php
2 
16 import('pages.proofreader.ProofreaderHandler');
17 
23  parent::ProofreaderHandler();
24  }
25 
31  function submission($args, &$request) {
32  $articleId = (int) array_shift($args);
33  $journal =& $request->getJournal();
34 
35  $this->validate($request, $articleId);
36  $this->setupTemplate(true, $articleId);
37 
38  $useProofreaders = $journal->getSetting('useProofreaders');
39 
40  $authorDao =& DAORegistry::getDAO('AuthorDAO');
41  $authors = $authorDao->getAuthorsBySubmissionId($articleId);
42 
43  ProofreaderAction::proofreadingUnderway($this->submission, 'SIGNOFF_PROOFREADING_PROOFREADER');
44  $useLayoutEditors = $journal->getSetting('useLayoutEditors');
45 
46  $templateMgr =& TemplateManager::getManager();
47 
48  $templateMgr->assign('useProofreaders', $useProofreaders);
49  $templateMgr->assign_by_ref('authors', $authors);
50  $templateMgr->assign_by_ref('submission', $this->submission);
51  $templateMgr->assign('useLayoutEditors', $useLayoutEditors);
52  $templateMgr->assign('helpTopicId', 'editorial.proofreadersRole.proofreading');
53 
54  $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
55  $publishedArticle =& $publishedArticleDao->getPublishedArticleByArticleId($this->submission->getId());
56  if ($publishedArticle) {
57  $issueDao =& DAORegistry::getDAO('IssueDAO');
58  $issue =& $issueDao->getIssueById($publishedArticle->getIssueId());
59  $templateMgr->assign_by_ref('publishedArticle', $publishedArticle);
60  $templateMgr->assign_by_ref('issue', $issue);
61  }
62 
63  $templateMgr->display('proofreader/submission.tpl');
64  }
65 
71  function completeProofreader($args, &$request) {
72  $articleId = (int) $request->getUserVar('articleId');
73 
74  $this->validate($request, $articleId);
75  $this->setupTemplate(true);
76 
77  if (ProofreaderAction::proofreadEmail($articleId, 'PROOFREAD_COMPLETE', $request, $request->getUserVar('send')?'':$request->url(null, 'proofreader', 'completeProofreader'))) {
78  $request->redirect(null, null, 'submission', $articleId);
79  }
80  }
81 
87  function viewMetadata($args, &$request) {
88  $articleId = (int) array_shift($args);
89  $journal =& $request->getJournal();
90  $this->validate($request, $articleId);
91  $this->setupTemplate(true, $articleId, 'summary');
92 
94  }
95 
96  //
97  // Misc
98  //
99 
105  function downloadFile($args, $request) {
106  $articleId = (int) array_shift($args);
107  $fileId = (int) array_shift($args);
108  $revision = array_shift($args); // May be null
109 
110  $this->validate($request, $articleId);
111  if (!ProofreaderAction::downloadProofreaderFile($this->submission, $fileId, $revision)) {
112  $request->redirect(null, null, 'submission', $articleId);
113  }
114  }
115 
121  function proofGalley($args, &$request) {
122  $articleId = (int) array_shift($args);
123  $galleyId = (int) array_shift($args);
124  $this->validate($request, $articleId);
125 
126  $templateMgr =& TemplateManager::getManager();
127  $templateMgr->assign('articleId', $articleId);
128  $templateMgr->assign('galleyId', $galleyId);
129  $templateMgr->display('submission/layout/proofGalley.tpl');
130  }
131 
137  function proofGalleyTop($args, &$request) {
138  $articleId = (int) array_shift($args);
139  $galleyId = (int) array_shift($args);
140  $this->validate($request, $articleId);
141 
142  $templateMgr =& TemplateManager::getManager();
143  $templateMgr->assign('articleId', $articleId);
144  $templateMgr->assign('galleyId', $galleyId);
145  $templateMgr->assign('backHandler', 'submission');
146  $templateMgr->display('submission/layout/proofGalleyTop.tpl');
147  }
148 
154  function proofGalleyFile($args, &$request) {
155  $articleId = (int) array_shift($args);
156  $galleyId = (int) array_shift($args);
157  $this->validate($request, $articleId);
158 
159  $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
160  $galley =& $galleyDao->getGalley($galleyId, $articleId);
161 
162  import('classes.file.ArticleFileManager'); // FIXME
163 
164  if (isset($galley)) {
165  if ($galley->isHTMLGalley()) {
166  $templateMgr =& TemplateManager::getManager();
167  $templateMgr->assign_by_ref('galley', $galley);
168  if ($galley->isHTMLGalley() && $styleFile =& $galley->getStyleFile()) {
169  $templateMgr->addStyleSheet($request->url(null, 'article', 'viewFile', array(
170  $articleId, $galleyId, $styleFile->getFileId()
171  )));
172  }
173  $templateMgr->display('submission/layout/proofGalleyHTML.tpl');
174 
175  } else {
176  // View non-HTML file inline
177  $this->viewFile(array($articleId, $galley->getFileId()));
178  }
179  }
180  }
181 
187  function viewFile($args, &$request) {
188  $articleId = (int) array_shift($args);
189  $fileId = (int) array_shift($args);
190  $revision = array_shift($args); // Can be null
191 
192  $this->validate($request, $articleId);
193  if (!ProofreaderAction::viewFile($articleId, $fileId, $revision)) {
194  $request->redirect(null, null, 'submission', $articleId);
195  }
196  }
197 }
198 
199 ?>
downloadProofreaderFile($submission, $fileId, $revision=null)
viewMetadata($article, $journal)
Definition: Action.inc.php:59
Handle requests for proofreader functions.
proofreadEmail($articleId, $mailType, $request, $actionPath= '')
viewFile($articleId, $fileId, $revision=null)
Definition: Action.inc.php:192
proofreadingUnderway(&$submission, $signoffType)
setupTemplate($subclass=false, $articleId=0, $parentPage=null, $showSidebar=true)
validate(&$request, $articleId=null)
& getDAO($name, $dbconn=null)
Handle requests for proofreader submission functions.