/**
  * Proof galley (outputs file contents).
  * @param $args array ($articleId, $galleyId)
  */
 function proofGalleyFile($args)
 {
     $articleId = isset($args[0]) ? (int) $args[0] : 0;
     $galleyId = isset($args[1]) ? (int) $args[1] : 0;
     $this->validate($articleId);
     $galleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
     $galley =& $galleyDao->getGalley($galleyId, $articleId);
     import('classes.file.ArticleFileManager');
     // FIXME
     if (isset($galley)) {
         if ($galley->isHTMLGalley()) {
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->assign_by_ref('galley', $galley);
             if ($galley->isHTMLGalley() && ($styleFile =& $galley->getStyleFile())) {
                 $templateMgr->addStyleSheet(Request::url(null, 'article', 'viewFile', array($articleId, $galleyId, $styleFile->getFileId())));
             }
             $templateMgr->display('submission/layout/proofGalleyHTML.tpl');
         } else {
             // View non-HTML file inline
             TrackSubmissionHandler::viewFile(array($articleId, $galley->getFileId()));
         }
     }
 }
 function payPublicationFee($args)
 {
     import('pages.author.TrackSubmissionHandler');
     TrackSubmissionHandler::payPublicationFee($args);
 }
 /**
  * Delete comment.
  */
 function deleteComment($args)
 {
     $articleId = $args[0];
     $commentId = $args[1];
     $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId));
     $this->validate();
     $comment =& $this->comment;
     $this->setupTemplate(true);
     $trackSubmissionHandler = new TrackSubmissionHandler();
     $trackSubmissionHandler->validate($articleId);
     $authorSubmission =& $trackSubmissionHandler->submission;
     AuthorAction::deleteComment($commentId);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_SECTION_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)
 {
     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)
 {
     $paperId = $args[0];
     $commentId = $args[1];
     $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId));
     $this->validate();
     $comment =& $this->comment;
     $this->setupTemplate(true);
     $trackSubmissionHandler = new TrackSubmissionHandler();
     $trackSubmissionHandler->validate($paperId);
     $authorSubmission =& $trackSubmissionHandler->submission;
     AuthorAction::deleteComment($commentId);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_DIRECTOR_DECISION) {
         Request::redirect(null, null, null, 'viewDirectorDecisionComments', $paperId);
     }
 }
 /**
  * Display a form to pay for Publishing an article
  * @param $args array ($articleId)
  */
 function payPublicationFee($args)
 {
     $articleId = isset($args[0]) ? $args[0] : 0;
     list($journal, $submission) = TrackSubmissionHandler::validate($articleId);
     parent::setupTemplate(true, $articleId);
     import('payment.ojs.OJSPaymentManager');
     $paymentManager =& OJSPaymentManager::getManager();
     $user =& Request::getUser();
     $queuedPayment =& $paymentManager->createQueuedPayment($journal->getJournalId(), PAYMENT_TYPE_PUBLICATION, $user->getUserId(), $articleId, $journal->getSetting('publicationFee'));
     $queuedPaymentId = $paymentManager->queuePayment($queuedPayment);
     $paymentManager->displayPaymentForm($queuedPaymentId, $queuedPayment);
 }