Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
SubmissionReviewHandler.inc.php
1 <?php
2 
16 import('pages.reviewer.ReviewerHandler');
17 
23  parent::ReviewerHandler();
24  }
25 
31  function submission($args, $request) {
32  $journal =& $request->getJournal();
33  $reviewId = (int) array_shift($args);
34 
35  $this->validate($request, $reviewId);
36  $user =& $this->user;
38 
39  $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
40  $reviewAssignment = $reviewAssignmentDao->getById($reviewId);
41 
42  $reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO');
43 
44  if ($submission->getDateConfirmed() == null) {
45  $confirmedStatus = 0;
46  } else {
47  $confirmedStatus = 1;
48  }
49 
50  $this->setupTemplate(true, $reviewAssignment->getSubmissionId(), $reviewId);
51 
52  $templateMgr =& TemplateManager::getManager();
53 
54  $templateMgr->assign_by_ref('user', $user);
55  $templateMgr->assign_by_ref('submission', $submission);
56  $templateMgr->assign_by_ref('reviewAssignment', $reviewAssignment);
57  $templateMgr->assign('confirmedStatus', $confirmedStatus);
58  $templateMgr->assign('declined', $submission->getDeclined());
59  $templateMgr->assign('reviewFormResponseExists', $reviewFormResponseDao->reviewFormResponseExists($reviewId));
60  $templateMgr->assign_by_ref('reviewFile', $reviewAssignment->getReviewFile());
61  $templateMgr->assign_by_ref('reviewerFile', $submission->getReviewerFile());
62  $templateMgr->assign_by_ref('suppFiles', $submission->getSuppFiles());
63  $templateMgr->assign_by_ref('journal', $journal);
64  $templateMgr->assign_by_ref('reviewGuidelines', $journal->getLocalizedSetting('reviewGuidelines'));
65 
66  import('classes.submission.reviewAssignment.ReviewAssignment');
67  $templateMgr->assign_by_ref('reviewerRecommendationOptions', ReviewAssignment::getReviewerRecommendationOptions());
68 
69  $templateMgr->assign('helpTopicId', 'editorial.reviewersRole.review');
70  $templateMgr->display('reviewer/submission.tpl');
71  }
72 
78  function confirmReview($args, $request) {
79  $reviewId = (int) $request->getUserVar('reviewId');
80  $declineReview = $request->getUserVar('declineReview');
81 
82  $reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
83 
84  $this->validate($request, $reviewId);
85  $reviewerSubmission =& $this->submission;
86 
87  $this->setupTemplate();
88 
89  $decline = isset($declineReview) ? 1 : 0;
90 
91  if (!$reviewerSubmission->getCancelled()) {
92  if (ReviewerAction::confirmReview($reviewerSubmission, $decline, $request->getUserVar('send'), $request)) {
93  $request->redirect(null, null, 'submission', $reviewId);
94  }
95  } else {
96  $request->redirect(null, null, 'submission', $reviewId);
97  }
98  }
99 
105  function saveCompetingInterests($args, &$request) {
106  $reviewId = (int) $request->getUserVar('reviewId');
107  $this->validate($request, $reviewId);
108  $reviewerSubmission =& $this->submission;
109 
110  if ($reviewerSubmission->getDateConfirmed() && !$reviewerSubmission->getDeclined() && !$reviewerSubmission->getCancelled() && !$reviewerSubmission->getRecommendation()) {
111  $reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
112  $reviewerSubmission->setCompetingInterests($request->getUserVar('competingInterests'));
113  $reviewerSubmissionDao->updateReviewerSubmission($reviewerSubmission);
114  }
115 
116  $request->redirect(null, 'reviewer', 'submission', array($reviewId));
117  }
118 
124  function recordRecommendation($args, $request) {
125  $reviewId = (int) $request->getUserVar('reviewId');
126  $recommendation = (int) $request->getUserVar('recommendation');
127 
128  $this->validate($request, $reviewId);
129  $reviewerSubmission =& $this->submission;
130 
131  $this->setupTemplate(true);
132 
133  if (!$reviewerSubmission->getCancelled()) {
134  if (ReviewerAction::recordRecommendation($reviewerSubmission, $recommendation, $request->getUserVar('send'), $request)) {
135  $request->redirect(null, null, 'submission', $reviewId);
136  }
137  } else {
138  $request->redirect(null, null, 'submission', $reviewId);
139  }
140  }
141 
147  function viewMetadata($args, $request) {
148  $reviewId = (int) array_shift($args);
149  $articleId = (int) array_shift($args);
150  $journal =& $request->getJournal();
151 
152  $this->validate($request, $reviewId);
153  $reviewerSubmission =& $this->submission;
154 
155  $this->setupTemplate(true, $articleId, $reviewId);
156 
157  ReviewerAction::viewMetadata($reviewerSubmission, $journal);
158  }
159 
165  function uploadReviewerVersion($args, $request) {
166  $reviewId = (int) $request->getUserVar('reviewId');
167 
168  $this->validate($request, $reviewId);
169  $this->setupTemplate(true);
170 
171  ReviewerAction::uploadReviewerVersion($reviewId, $this->submission, $request);
172  $request->redirect(null, null, 'submission', $reviewId);
173  }
174 
180  function deleteReviewerVersion($args, $request) {
181  $reviewId = (int) array_shift($args);
182  $fileId = (int) array_shift($args);
183  $revision = (int) array_shift($args);
184  if (!$revision) $revision = null;
185 
186  $this->validate($request, $reviewId);
187  $reviewerSubmission =& $this->submission;
188 
189  if (!$reviewerSubmission->getCancelled()) ReviewerAction::deleteReviewerVersion($reviewId, $fileId, $revision);
190  $request->redirect(null, null, 'submission', $reviewId);
191  }
192 
193  //
194  // Misc
195  //
196 
202  function downloadFile($args, $request) {
203  $reviewId = (int) array_shift($args);
204  $articleId = (int) array_shift($args);
205  $fileId = (int) array_shift($args);
206  $revision = (int) array_shift($args);
207  if (!$revision) $revision = null;
208 
209  $this->validate($request, $reviewId);
210  $reviewerSubmission =& $this->submission;
211 
212  if (!ReviewerAction::downloadReviewerFile($reviewId, $reviewerSubmission, $fileId, $revision)) {
213  $request->redirect(null, null, 'submission', $reviewId);
214  }
215  }
216 
217  //
218  // Review Form
219  //
220 
226  function editReviewFormResponse($args, $request) {
227  $reviewId = (int) array_shift($args);
228 
229  $this->validate($request, $reviewId);
230  $reviewerSubmission =& $this->submission;
231  $this->setupTemplate(true, $reviewerSubmission->getId(), $reviewId);
232 
233  $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
234  $reviewAssignment =& $reviewAssignmentDao->getById($reviewId);
235  $reviewFormId = $reviewAssignment->getReviewFormId();
236  if ($reviewFormId != null) {
237  ReviewerAction::editReviewFormResponse($reviewId, $reviewFormId);
238  }
239  }
240 
246  function saveReviewFormResponse($args, $request) {
247  $reviewId = (int) array_shift($args);
248  $reviewFormId = (int) array_shift($args);
249 
250  $this->validate($request, $reviewId);
251  $this->setupTemplate(true);
252 
253  if (ReviewerAction::saveReviewFormResponse($reviewId, $reviewFormId, $request)) {
254  $request->redirect(null, null, 'submission', $reviewId);
255  }
256  }
257 }
258 
259 ?>
recordRecommendation(&$reviewerSubmission, $recommendation, $send, $request)
confirmReview($reviewerSubmission, $decline, $send, $request)
viewMetadata($article, $journal)
Definition: Action.inc.php:59
validate($request, $reviewId=null)
Handle requests for reviewer functions.
saveReviewFormResponse($reviewId, $reviewFormId, $request)
editReviewFormResponse($reviewId, $reviewFormId)
deleteReviewerVersion($reviewId, $fileId, $revision=null)
downloadReviewerFile($reviewId, $article, $fileId, $revision=null)
& getDAO($name, $dbconn=null)
setupTemplate($subclass=false, $articleId=0, $reviewId=0)
uploadReviewerVersion($reviewId, $reviewerSubmission, $request)
Handle requests for submission tracking.