Ejemplo n.º 1
0
 /**
  * Delete comment.
  */
 function deleteComment($args)
 {
     $articleId = $args[0];
     $commentId = $args[1];
     $reviewId = Request::getUserVar('reviewId');
     list($journal, $submission, $user) = SubmissionReviewHandler::validate($reviewId);
     list($comment) = SubmissionCommentsHandler::validate($user, $commentId);
     ReviewerHandler::setupTemplate(true);
     ReviewerAction::deleteComment($commentId, $user);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_PEER_REVIEW) {
         Request::redirect(null, null, 'viewPeerReviewComments', array($articleId, $comment->getAssocId()));
     }
 }
 /**
  * Delete comment.
  */
 function deleteComment($args)
 {
     LayoutEditorHandler::validate();
     LayoutEditorHandler::setupTemplate(true);
     $articleId = $args[0];
     $commentId = $args[1];
     list($journal, $submission) = SubmissionLayoutHandler::validate($articleId);
     list($comment) = SubmissionCommentsHandler::validate($commentId);
     LayoutEditorAction::deleteComment($commentId);
     // Redirect back to initial comments page
     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);
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Delete comment.
  */
 function deleteComment($args)
 {
     SectionEditorHandler::validate();
     SectionEditorHandler::setupTemplate(true);
     $articleId = $args[0];
     $commentId = $args[1];
     list($journal, $submission) = SubmissionEditHandler::validate($articleId);
     list($comment) = SubmissionCommentsHandler::validate($commentId);
     SectionEditorAction::deleteComment($commentId);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_PEER_REVIEW) {
         Request::redirect(null, null, 'viewPeerReviewComments', array($articleId, $comment->getAssocId()));
     } else {
         if ($comment->getCommentType() == COMMENT_TYPE_EDITOR_DECISION) {
             Request::redirect(null, null, 'viewEditorDecisionComments', $articleId);
         } else {
             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);
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 4
0
 /**
  * Delete comment.
  */
 function deleteComment($args)
 {
     AuthorHandler::validate();
     AuthorHandler::setupTemplate(true);
     $articleId = $args[0];
     $commentId = $args[1];
     $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
     $comment =& $articleCommentDao->getArticleCommentById($commentId);
     list($journal, $authorSubmission) = TrackSubmissionHandler::validate($articleId);
     list($comment) = SubmissionCommentsHandler::validate($commentId);
     AuthorAction::deleteComment($commentId);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_EDITOR_DECISION) {
         Request::redirect(null, null, 'viewEditorDecisionComments', $articleId);
     } else {
         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);
                 }
             }
         }
     }
 }
 /**
  * Delete comment.
  */
 function deleteComment($args)
 {
     ProofreaderHandler::validate();
     ProofreaderHandler::setupTemplate(true);
     $articleId = $args[0];
     $commentId = $args[1];
     $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
     $comment =& $articleCommentDao->getArticleCommentById($commentId);
     list($journal, $submission) = SubmissionProofreadHandler::validate($articleId);
     list($comment) = SubmissionCommentsHandler::validate($commentId);
     ProofreaderAction::deleteComment($commentId);
     // Determine which page to redirect back to.
     $commentPageMap = array(COMMENT_TYPE_PROOFREAD => 'viewProofreadComments', COMMENT_TYPE_LAYOUT => 'viewLayoutComments');
     // Redirect back to initial comments page
     Request::redirect(null, null, $commentPageMap[$comment->getCommentType()], $articleId);
 }