Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
ReviewerReviewStep1Form.inc.php
1 <?php
2 
16 import('lib.pkp.classes.submission.reviewer.form.ReviewerReviewForm');
17 
24  function ReviewerReviewStep1Form($request, $reviewerSubmission, $reviewAssignment) {
25  parent::ReviewerReviewForm($request, $reviewerSubmission, $reviewAssignment, 1);
26  }
27 
28 
29  //
30  // Implement protected template methods from Form
31  //
35  function fetch($request) {
36  $templateMgr = TemplateManager::getManager($request);
37  $context = $request->getContext();
38 
39  // Add submission parameters.
40  $submission = $this->getReviewerSubmission();
41  $templateMgr->assign('completedSteps', $submission->getStatus());
42  // FIXME: Need context setting that denotes competing interests are required, see #6402.
43  $templateMgr->assign('competingInterestsText', $submission->getCompetingInterests());
44 
45  // Add review assignment.
46  $reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
47  $reviewAssignment = $reviewAssignmentDao->getById($submission->getReviewId());
48  $templateMgr->assign('reviewAssignment', $reviewAssignment);
49 
50  // Add reviewer request text.
51  $reviewerRequestParams = array(
52  'reviewer' => $reviewAssignment->getReviewerFullName(),
53  'personalNote' => 'EDITOR NOTE', // FIXME Bug #6531
54  'editor' => $context->getSetting('contactName')
55  );
56 
57  $templateMgr->assign('reviewerRequest', __('reviewer.step1.requestBoilerplate', $reviewerRequestParams));
58 
59  //
60  // Assign the link actions
61  //
62  import('lib.pkp.classes.linkAction.request.AjaxModal');
63  import('lib.pkp.classes.linkAction.request.ConfirmationModal');
64 
65  // "View metadata" action.
66  import('lib.pkp.controllers.modals.submissionMetadata.linkAction.ReviewerViewMetadataLinkAction');
67  $viewMetadataLinkAction = new ReviewerViewMetadataLinkAction($request, $reviewAssignment->getSubmissionId(), $reviewAssignment->getId());
68  $templateMgr->assign('viewMetadataAction', $viewMetadataLinkAction);
69 
70  // include the confirmation modal for competing interests if the context has them.
71  if ($context->getLocalizedSetting('competingInterests') != '') {
72  import('lib.pkp.controllers.confirmationModal.linkAction.ViewCompetingInterestGuidelinesLinkAction');
73  $competingInterestsAction = new ViewCompetingInterestGuidelinesLinkAction($request);
74  $templateMgr->assign('competingInterestsAction', $competingInterestsAction);
75  }
76  // Instantiate the view review guidelines confirmation modal.
77  $aboutDueDateAction = new LinkAction('viewReviewGuidelines',
79  __('reviewer.aboutDueDates.text'),
80  __('reviewer.aboutDueDates'),
81  'modal_information', null, '',
82  false
83  ),
84  __('reviewer.aboutDueDates')
85  );
86 
87  $templateMgr->assign('aboutDueDatesAction', $aboutDueDateAction);
88 
89  import('lib.pkp.classes.linkAction.request.AjaxModal');
90  $declineReviewLinkAction = new LinkAction('declineReview',
91  new AjaxModal(
92  $request->url(null, null, 'showDeclineReview', $reviewAssignment->getSubmissionId()),
93  __('reviewer.submission.declineReview')
94  )
95  );
96  $templateMgr->assign('declineReviewAction', $declineReviewLinkAction);
97 
98  return parent::fetch($request);
99  }
100 
104  function readInputData() {
105  $this->readUserVars(array('competingInterestOption', 'competingInterestText'));
106  }
107 
111  function execute() {
112  $reviewerSubmission = $this->getReviewerSubmission();
113 
114  // Set competing interests.
115  if ($this->getData('competingInterestOption') == 'hasCompetingInterests') {
116  $reviewerSubmission->setCompetingInterests($this->request->getUserVar('competingInterestsText'));
117  } else {
118  $reviewerSubmission->setCompetingInterests(null);
119  }
120 
121  // Set review to next step.
122  $this->updateReviewStepAndSaveSubmission($reviewerSubmission);
123 
124  $reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
125  $reviewAssignment = $reviewAssignmentDao->getById($reviewerSubmission->getReviewId());
126  // if the reviewer has not previously confirmed the review, then
127  // Set that the reviewer has accepted the review.
128  if (!$reviewAssignment->getDateConfirmed()) {
129  $reviewerAction = new ReviewerAction();
130  $reviewerAction->confirmReview($this->request, $reviewAssignment, $reviewerSubmission, false);
131  }
132  }
133 }
134 
135 ?>
static & getDAO($name, $dbconn=null)
ReviewerAction class.
Class defining a simple confirmation modal either with remote action or not.
readUserVars($vars)
Definition: Form.inc.php:364
getData($key)
Definition: Form.inc.php:210
A modal that retrieves its content from via AJAX.
An action to open the submission meta-data modal.
ReviewerReviewStep1Form($request, $reviewerSubmission, $reviewAssignment)
An action to open the competing interests confirmation modal.
Base class for reviewer forms.
Form for Step 1 of a review.
updateReviewStepAndSaveSubmission(&$reviewerSubmission)
Base class defining an action that can be performed by the user in the user interface.