/**
  * Save comment.
  */
 function saveComment()
 {
     $articleId = Request::getUserVar('articleId');
     $commentId = Request::getUserVar('commentId');
     $reviewId = Request::getUserVar('reviewId');
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     $article = $articleDao->getArticle($articleId);
     list($journal, $submission, $user) = SubmissionReviewHandler::validate($reviewId);
     list($comment) = SubmissionCommentsHandler::validate($user, $commentId);
     // If the user pressed the "Save and email" button, then email the comment.
     $emailComment = Request::getUserVar('saveAndEmail') != null ? true : false;
     ReviewerHandler::setupTemplate(true);
     ReviewerAction::saveComment($article, $comment, $emailComment);
     // Refresh the comment
     $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
     $comment =& $articleCommentDao->getArticleCommentById($commentId);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_PEER_REVIEW) {
         Request::redirect(null, null, 'viewPeerReviewComments', array($articleId, $comment->getAssocId()));
     }
 }
 /**
  * Save comment.
  * @param $args array
  * @param $request object
  */
 function saveComment($args, $request)
 {
     $articleId = (int) $request->getUserVar('articleId');
     $commentId = (int) $request->getUserVar('commentId');
     $reviewId = (int) $request->getUserVar('reviewId');
     $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId));
     $this->validate($request, $reviewId);
     $this->setupTemplate(true);
     // If the user pressed the "Save and email" button, then email the comment.
     $emailComment = $request->getUserVar('saveAndEmail') != null ? true : false;
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     $article = $articleDao->getArticle($articleId);
     ReviewerAction::saveComment($article, $this->comment, $emailComment, $request);
     // Refresh the comment
     $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
     $comment =& $articleCommentDao->getArticleCommentById($commentId);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_PEER_REVIEW) {
         $request->redirect(null, null, 'viewPeerReviewComments', array($articleId, $comment->getAssocId()));
     }
 }
 /**
  * Save comment.
  */
 function saveComment()
 {
     $paperId = Request::getUserVar('paperId');
     $commentId = Request::getUserVar('commentId');
     $reviewId = Request::getUserVar('reviewId');
     $paperDao =& DAORegistry::getDAO('PaperDAO');
     $submission = $paperDao->getPaper($paperId);
     $submissionReviewHandler = new SubmissionReviewHandler();
     $submissionReviewHandler->validate($reviewId);
     $user =& $submissionReviewHandler->user;
     $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId, $user));
     $this->validate();
     $comment =& $this->comment;
     // If the user pressed the "Save and email" button, then email the comment.
     $emailComment = Request::getUserVar('saveAndEmail') != null ? true : false;
     $this->setupTemplate(true);
     ReviewerAction::saveComment($submission, $comment, $emailComment);
     // Refresh the comment
     $paperCommentDao =& DAORegistry::getDAO('PaperCommentDAO');
     $comment =& $paperCommentDao->getPaperCommentById($commentId);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_PEER_REVIEW) {
         Request::redirect(null, null, null, 'viewPeerReviewComments', array($paperId, $comment->getAssocId()));
     }
 }