pages/author/SubmissionCommentsHandler.inc.php

00001 <?php
00002 
00015 //$Id$
00016 
00017 import('pages.author.TrackSubmissionHandler');
00018 
00019 class SubmissionCommentsHandler extends AuthorHandler {
00021    var $comment;
00022    
00026    function SubmissionCommentsHandler() {
00027       parent::AuthorHandler();
00028    }
00029 
00033    function viewDirectorDecisionComments($args) {
00034       $this->validate();
00035       $this->setupTemplate(true);
00036 
00037       $paperId = $args[0];
00038 
00039       $trackSubmissionHandler = new TrackSubmissionHandler();
00040       $trackSubmissionHandler->validate($paperId);
00041       $authorSubmission =& $trackSubmissionHandler->submission;
00042       AuthorAction::viewDirectorDecisionComments($authorSubmission);
00043    }
00044 
00048    function emailDirectorDecisionComment() {
00049       $paperId = (int) Request::getUserVar('paperId');
00050       $trackSubmissionHandler = new TrackSubmissionHandler();
00051       $trackSubmissionHandler->validate($paperId);
00052       $submission =& $trackSubmissionHandler->submission;
00053 
00054       $this->setupTemplate(true);      
00055       if (AuthorAction::emailDirectorDecisionComment($submission, Request::getUserVar('send'))) {
00056          Request::redirect(null, null, null, 'submissionReview', array($paperId));
00057       }
00058    }
00059 
00063    function editComment($args) {
00064       $paperId = $args[0];
00065       $commentId = $args[1];
00066 
00067       $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId));
00068       $this->validate();
00069       $comment =& $this->comment;
00070       
00071       $this->setupTemplate(true);
00072       
00073       $trackSubmissionHandler = new TrackSubmissionHandler();
00074       $trackSubmissionHandler->validate($paperId);
00075       $authorSubmission =& $trackSubmissionHandler->submission;
00076 
00077       if ($comment->getCommentType() == COMMENT_TYPE_DIRECTOR_DECISION) {
00078          // Cannot edit a director decision comment.
00079          Request::redirect(null, null, Request::getRequestedPage());
00080       }
00081 
00082       AuthorAction::editComment($authorSubmission, $comment);
00083 
00084    }
00085 
00089    function saveComment() {
00090       $paperId = Request::getUserVar('paperId');
00091       $commentId = Request::getUserVar('commentId');
00092 
00093       // If the user pressed the "Save and email" button, then email the comment.
00094       $emailComment = Request::getUserVar('saveAndEmail') != null ? true : false;
00095 
00096       $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId));
00097       $this->validate();
00098       $comment =& $this->comment;
00099       
00100       $this->setupTemplate(true);
00101       
00102       $trackSubmissionHandler = new TrackSubmissionHandler();
00103       $trackSubmissionHandler->validate($paperId);
00104       $authorSubmission =& $trackSubmissionHandler->submission;
00105 
00106       if ($comment->getCommentType() == COMMENT_TYPE_DIRECTOR_DECISION) {
00107          // Cannot edit a director decision comment.
00108          Request::redirect(null, null, Request::getRequestedPage());
00109       }
00110 
00111       AuthorAction::saveComment($authorSubmission, $comment, $emailComment);
00112 
00113       $paperCommentDao =& DAORegistry::getDAO('PaperCommentDAO');
00114       $comment =& $paperCommentDao->getPaperCommentById($commentId);
00115 
00116       // Redirect back to initial comments page
00117       if ($comment->getCommentType() == COMMENT_TYPE_DIRECTOR_DECISION) {
00118          Request::redirect(null, null, null, 'viewDirectorDecisionComments', $paperId);
00119       }
00120    }
00121 
00125    function deleteComment($args) {
00126       $paperId = $args[0];
00127       $commentId = $args[1];
00128 
00129       $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId));
00130       $this->validate();
00131       $comment =& $this->comment;
00132       
00133       $this->setupTemplate(true);
00134       
00135       $trackSubmissionHandler = new TrackSubmissionHandler();
00136       $trackSubmissionHandler->validate($paperId);
00137       $authorSubmission =& $trackSubmissionHandler->submission;
00138       AuthorAction::deleteComment($commentId);
00139 
00140       // Redirect back to initial comments page
00141       if ($comment->getCommentType() == COMMENT_TYPE_DIRECTOR_DECISION) {
00142          Request::redirect(null, null, null, 'viewDirectorDecisionComments', $paperId);
00143       }
00144    }
00145 }
00146 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7