/** * View review form response. * @param $sectionEditorSubmission object * @param $reviewId int */ function viewReviewFormResponse($sectionEditorSubmission, $reviewId) { $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $reviewAssignment =& $reviewAssignmentDao->getById($reviewId); if (HookRegistry::call('SectionEditorAction::viewReviewFormResponse', array(&$sectionEditorSubmission, &$reviewAssignment, &$reviewId))) { return $reviewId; } if (isset($reviewAssignment) && $reviewAssignment->getSubmissionId() == $sectionEditorSubmission->getId()) { $reviewFormId = $reviewAssignment->getReviewFormId(); if ($reviewFormId != null) { import('classes.submission.form.ReviewFormResponseForm'); $reviewForm = new ReviewFormResponseForm($reviewId, $reviewFormId); $reviewForm->initData(); $reviewForm->display(); } } }
/** * Save review form response. * @param $reviewId int * @param $reviewFormId int */ function saveReviewFormResponse($reviewId, $reviewFormId) { if (!HookRegistry::call('ReviewerAction::saveReviewFormResponse', array($reviewId, $reviewFormId))) { import('classes.submission.form.ReviewFormResponseForm'); $reviewForm = new ReviewFormResponseForm($reviewId, $reviewFormId); $reviewForm->readInputData(); if ($reviewForm->validate()) { $reviewForm->execute(); // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $sectionDecisionDao =& DAORegistry::getDAO('SectionDecisionDAO'); $reviewAssignment = $reviewAssignmentDao->getById($reviewId); $sectionDecision =& $sectionDecisionDao->getSectionDecision($reviewAssignment->getDecisionId()); $articleId = $sectionDecision->getArticleId(); $articleDao =& DAORegistry::getDAO('ArticleDAO'); $article =& $articleDao->getArticle($articleId); $notificationUsers = $article->getAssociatedUserIds(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submission', array($article->getId(), 'submissionReview'), null, 'peerReview'); $notificationManager->createNotification($userRole['id'], 'notification.type.reviewerFormComment', $article->getScientificTitle, $url, 1, NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT); } } else { $reviewForm->display(); return false; } return true; } }
/** * Save review form response. * @param $reviewId int * @param $reviewFormId int */ function saveReviewFormResponse($reviewId, $reviewFormId) { if (!HookRegistry::call('ReviewerAction::saveReviewFormResponse', array($reviewId, $reviewFormId))) { import('submission.form.ReviewFormResponseForm'); $reviewForm = new ReviewFormResponseForm($reviewId, $reviewFormId); $reviewForm->readInputData(); if ($reviewForm->validate()) { $reviewForm->execute(); // Send a notification to associated users import('notification.Notification'); $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $reviewAssignment = $reviewAssignmentDao->getReviewAssignmentById($reviewId); $paperId = $reviewAssignment->getPaperId(); $paperDao =& DAORegistry::getDAO('PaperDAO'); $paper =& $paperDao->getPaper($paperId); $notificationUsers = $paper->getAssociatedUserIds(); foreach ($notificationUsers as $userRole) { $url = Request::url(null, null, $userRole['role'], 'submissionReview', $paper->getId(), null, 'peerReview'); Notification::createNotification($userRole['id'], "notification.type.reviewerFormComment", $paper->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT); } } else { $reviewForm->display(); return false; } return true; } }
/** * Save review form response. * @param $reviewId int * @param $reviewFormId int * @param $request Request */ function saveReviewFormResponse($reviewId, $reviewFormId, $request) { if (!HookRegistry::call('ReviewerAction::saveReviewFormResponse', array($reviewId, $reviewFormId))) { import('classes.submission.form.ReviewFormResponseForm'); $reviewForm = new ReviewFormResponseForm($reviewId, $reviewFormId); $reviewForm->readInputData(); if ($reviewForm->validate()) { $reviewForm->execute(); // Send a notification to associated users import('classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $reviewAssignment = $reviewAssignmentDao->getById($reviewId); $articleId = $reviewAssignment->getSubmissionId(); $articleDao =& DAORegistry::getDAO('ArticleDAO'); $article =& $articleDao->getArticle($articleId); $notificationUsers = $article->getAssociatedUserIds(false, false); foreach ($notificationUsers as $userRole) { $notificationManager->createNotification($request, $userRole['id'], NOTIFICATION_TYPE_REVIEWER_FORM_COMMENT, $article->getJournalId(), ASSOC_TYPE_ARTICLE, $article->getId()); } } else { $reviewForm->display(); return false; } return true; } }