/** * Save comment. * @param $args array * @param $request object */ function saveComment($args, $request) { $articleId = (int) $request->getUserVar('articleId'); $commentId = (int) $request->getUserVar('commentId'); $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId)); $this->validate($request, $articleId); $comment =& $this->comment; $this->setupTemplate(true); // If the user pressed the "Save and email" button, then email the comment. $emailComment = $request->getUserVar('saveAndEmail') != null ? true : false; CopyeditorAction::saveComment($this->submission, $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_COPYEDIT) { $request->redirect(null, null, 'viewCopyeditComments', $articleId); } else { if ($comment->getCommentType() == COMMENT_TYPE_LAYOUT) { $request->redirect(null, null, 'viewLayoutComments', $articleId); } else { if ($comment->getCommentType() == COMMENT_TYPE_PROOFREAD) { $request->redirect(null, null, 'viewProofreadComments', $articleId); } } } }
/** * Save comment. */ function saveComment() { CopyeditorHandler::validate(); CopyeditorHandler::setupTemplate(true); $articleId = Request::getUserVar('articleId'); $commentId = Request::getUserVar('commentId'); // If the user pressed the "Save and email" button, then email the comment. $emailComment = Request::getUserVar('saveAndEmail') != null ? true : false; list($journal, $submission) = SubmissionCopyeditHandler::validate($articleId); list($comment) = SubmissionCommentsHandler::validate($commentId); CopyeditorAction::saveComment($submission, $comment, $emailComment); $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO'); $comment =& $articleCommentDao->getArticleCommentById($commentId); // Redirect back to initial comments page if ($comment->getCommentType() == COMMENT_TYPE_COPYEDIT) { Request::redirect(null, null, 'viewCopyeditComments', $articleId); } else { if ($comment->getCommentType() == COMMENT_TYPE_LAYOUT) { Request::redirect(null, null, 'viewLayoutComments', $articleId); } else { if ($comment->getCommentType() == COMMENT_TYPE_PROOFREAD) { Request::redirect(null, null, 'viewProofreadComments', $articleId); } } } }