/** * Post reviewer comments. * @param $article object * @param $reviewId int * @param $emailComment boolean * @param $request Request */ function postPeerReviewComment(&$article, $reviewId, $emailComment, $request) { if (HookRegistry::call('SectionEditorAction::postPeerReviewComment', array(&$article, &$reviewId, &$emailComment))) { return; } import('classes.submission.form.comment.PeerReviewCommentForm'); $commentForm = new PeerReviewCommentForm($article, $reviewId, Validation::isEditor() ? ROLE_ID_EDITOR : ROLE_ID_SECTION_EDITOR); $commentForm->readInputData(); if ($commentForm->validate()) { $commentForm->execute(); // Send a notification to associated users import('classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $notificationUsers = $article->getAssociatedUserIds(false, false); foreach ($notificationUsers as $userRole) { $notificationManager->createNotification($request, $userRole['id'], NOTIFICATION_TYPE_REVIEWER_COMMENT, $article->getJournalId(), ASSOC_TYPE_ARTICLE, $article->getId()); } if ($emailComment) { $commentForm->email($request); } } else { $commentForm->display(); return false; } return true; }
/** * Post reviewer comments. * @param $user object Current user * @param $paper object * @param $reviewId int * @param $emailComment boolean */ function postPeerReviewComment(&$user, &$paper, $reviewId, $emailComment) { if (!HookRegistry::call('ReviewerAction::postPeerReviewComment', array(&$user, &$paper, &$reviewId, &$emailComment))) { import("submission.form.comment.PeerReviewCommentForm"); $commentForm = new PeerReviewCommentForm($paper, $reviewId, ROLE_ID_REVIEWER); $commentForm->setUser($user); $commentForm->readInputData(); if ($commentForm->validate()) { $commentForm->execute(); // Send a notification to associated users import('notification.Notification'); $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.reviewerComment", $paper->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_REVIEWER_COMMENT); } if ($emailComment) { $commentForm->email(); } } else { $commentForm->display(); return false; } return true; } }
/** * Post reviewer comments. * @param $user object Current user * @param $article object * @param $reviewId int * @param $emailComment boolean */ function postPeerReviewComment(&$user, &$article, $reviewId, $emailComment) { if (!HookRegistry::call('ReviewerAction::postPeerReviewComment', array(&$user, &$article, &$reviewId, &$emailComment))) { import('classes.submission.form.comment.PeerReviewCommentForm'); $commentForm = new PeerReviewCommentForm($article, $reviewId, ROLE_ID_REVIEWER); $commentForm->setUser($user); $commentForm->readInputData(); if ($commentForm->validate()) { $commentForm->execute(); // Send a notification to secretary(ies) import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $notificationUsers = $article->getAssociatedUserIds(false, false, false, true); $url = Request::url(null, 'sectionEditor', 'submission', array($article->getId(), 'submissionReview'), null, 'peerReview'); $param = $article->getProposalId() . ':<br/>' . $user->getUsername() . ' commented his review'; foreach ($notificationUsers as $userRole) { $notificationManager->createNotification($userRole['id'], 'notification.type.reviewerComment', $param, $url, 1, NOTIFICATION_TYPE_REVIEWER_COMMENT); } if ($emailComment) { $commentForm->email(); } } else { $commentForm->display(); return false; } return true; } }
/** * Post reviewer comments. * @param $article object * @param $reviewId int * @param $emailComment boolean */ function postPeerReviewComment(&$article, $reviewId, $emailComment) { if (HookRegistry::call('SectionEditorAction::postPeerReviewComment', array(&$article, &$reviewId, &$emailComment))) { return; } import('classes.submission.form.comment.PeerReviewCommentForm'); $commentForm = new PeerReviewCommentForm($article, $reviewId, Validation::isEditor() ? ROLE_ID_EDITOR : ROLE_ID_SECTION_EDITOR); $commentForm->readInputData(); if ($commentForm->validate()) { $commentForm->execute(); // Send a notification to associated users import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $notificationUsers = $article->getAssociatedUserIds(false, false); foreach ($notificationUsers as $userRole) { $url = Request::url(null, $userRole['role'], 'submissionReview', $article->getId(), null, 'peerReview'); $notificationManager->createNotification($userRole['id'], 'notification.type.reviewerComment', $article->getLocalizedTitle(), $url, 1, NOTIFICATION_TYPE_REVIEWER_COMMENT); } if ($emailComment) { $commentForm->email(); } } else { $commentForm->display(); return false; } return true; }
/** * Post reviewer comments. * @param $paper object * @param $reviewId int * @param $emailComment boolean */ function postPeerReviewComment(&$request, &$paper, $reviewId, $emailComment) { if (HookRegistry::call('TrackDirectorAction::postPeerReviewComment', array(&$paper, &$reviewId, &$emailComment, &$request))) { return; } import('classes.submission.form.comment.PeerReviewCommentForm'); $commentForm = new PeerReviewCommentForm($paper, $reviewId, Validation::isDirector() ? ROLE_ID_DIRECTOR : ROLE_ID_TRACK_DIRECTOR); $commentForm->readInputData(); if ($commentForm->validate()) { $commentForm->execute(); // Send a notification to associated users import('classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $notificationUsers = $paper->getAssociatedUserIds(false, false); $conference = $request->getConference(); foreach ($notificationUsers as $userRole) { $notificationManager->createNotification($request, $userRole['id'], NOTIFICATION_TYPE_REVIEWER_COMMENT, $conference->getId(), ASSOC_TYPE_PAPER, $paper->getId()); } if ($emailComment) { $commentForm->email(); } } else { $commentForm->display(); return false; } return true; }
/** * Post reviewer comments. * @param $article object * @param $reviewId int * @param $emailComment boolean */ function postPeerReviewComment(&$article, $reviewId, $emailComment) { if (HookRegistry::call('SectionEditorAction::postPeerReviewComment', array(&$article, &$reviewId, &$emailComment))) { return; } $user =& Request::getUser(); $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $userDao =& DAORegistry::getDAO('UserDAO'); $reviewAssignment =& $reviewAssignmentDao->getById($reviewId); $reviewer =& $userDao->getUser($reviewAssignment->getReviewerId()); import('classes.submission.form.comment.PeerReviewCommentForm'); $commentForm = new PeerReviewCommentForm($article, $reviewId, Validation::isEditor() ? ROLE_ID_EDITOR : ROLE_ID_SECTION_EDITOR); $commentForm->readInputData(); if ($commentForm->validate()) { $commentForm->execute(); // Send a notification to associated users (if exist, other secretaries of the committees and the concerned reviewer) import('lib.pkp.classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $notificationUsers = $article->getAssociatedUserIds(false, true); foreach ($notificationUsers as $userRole) { $param = $article->getProposalId() . ':<br/>' . $user->getUsername() . ' commented '; if ($userRole['role'] == 'sectionEditor') { $param = $param . 'the review of ' . $reviewer->getUsername(); $url = Request::url(null, $userRole['role'], 'submissionReview', $article->getId(), null, 'peerReview'); } else { $url = Request::url(null, $userRole['role'], 'submission', $reviewId); $param = $param . 'your review'; } if ($userRole['role'] == 'sectionEditor' && $user->getId() != $userRole['id'] || $userRole['role'] == 'reviewer' && $reviewer->getId() == $userRole['id']) { $notificationManager->createNotification($userRole['id'], 'notification.type.reviewerComment', $param, $url, 1, NOTIFICATION_TYPE_REVIEWER_COMMENT); } } if ($emailComment) { $commentForm->email(); } } else { $commentForm->display(); return false; } return true; }