Hello, I used the ojs2.4.8, I want to send the review comments to the author by the editor-in-chief, but there isn’t any ideas. then I found these codes, is it useful for me? Could you help me for it?
function postPeerReviewComment($args, &$request) {
$articleId = (int) $request->getUserVar(‘articleId’);
$reviewId = (int) $request->getUserVar(‘reviewId’);// If the user pressed the "Save and email" button, then email the comment. $emailComment = $request->getUserVar('saveAndEmail') != null ? true : false; $this->validate($request, $reviewId); $this->setupTemplate(true); if (ReviewerAction::postPeerReviewComment($this->user, $this->submission, $reviewId, $emailComment, $request)) { ReviewerAction::viewPeerReviewComments($this->user, $this->submission, $reviewId); }
}
function postPeerReviewComment(&$user, &$article, $reviewId, $emailComment, $request) {
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 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; }
}