/** * Display journal author index page. */ function index($args) { list($journal) = AuthorHandler::validate(); AuthorHandler::setupTemplate(); $user =& Request::getUser(); $rangeInfo =& Handler::getRangeInfo('submissions'); $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO'); $page = isset($args[0]) ? $args[0] : ''; switch ($page) { case 'completed': $active = false; break; default: $page = 'active'; $active = true; } $submissions = $authorSubmissionDao->getAuthorSubmissions($user->getUserId(), $journal->getJournalId(), $active, $rangeInfo); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('pageToDisplay', $page); if (!$active) { // Make view counts available if enabled. $templateMgr->assign('statViews', $journal->getSetting('statViews')); } $templateMgr->assign_by_ref('submissions', $submissions); // assign payment import('payment.ojs.OJSPaymentManager'); $paymentManager =& OJSPaymentManager::getManager(); if ($paymentManager->isConfigured()) { $templateMgr->assign('submissionEnabled', $paymentManager->submissionEnabled()); $templateMgr->assign('fastTrackEnabled', $paymentManager->fastTrackEnabled()); $templateMgr->assign('publicationEnabled', $paymentManager->publicationEnabled()); $completedPaymentDAO =& DAORegistry::getDAO('OJSCompletedPaymentDAO'); $templateMgr->assign_by_ref('completedPaymentDAO', $completedPaymentDAO); } /** Opatan Inc. **/ $journalPath = $journal->getPath(); $templateMgr->assign('journalTitle', $journalPath); import('issue.IssueAction'); $issueAction =& new IssueAction(); $templateMgr->register_function('print_issue_id', array($issueAction, 'smartyPrintIssueId')); $templateMgr->assign('helpTopicId', 'editorial.authorsRole.submissions'); $templateMgr->display('author/index.tpl'); }
/** * Save a supplementary file. * @param $args array ($suppFileId) */ function saveSuppFile($args) { $paperId = Request::getUserVar('paperId'); $this->validate($paperId, true); $authorSubmission =& $this->submission; parent::setupTemplate(true, $paperId, 'summary'); $suppFileId = isset($args[0]) ? (int) $args[0] : 0; import('submission.form.SuppFileForm'); $submitForm = new SuppFileForm($authorSubmission, $suppFileId); $submitForm->readInputData(); if ($submitForm->validate()) { $submitForm->execute(); Request::redirect(null, null, null, 'submission', $paperId); } else { $submitForm->display(); } }
/** * 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); } } } } }
/** * Save a supplementary file. * @param $args array ($suppFileId) */ function saveSuppFile($args, $request) { $paperId = $request->getUserVar('paperId'); $this->validate($request, $paperId, true); $authorSubmission =& $this->submission; parent::setupTemplate($request, true, $paperId, 'summary'); $suppFileId = (int) array_shift($args); import('classes.submission.form.SuppFileForm'); $submitForm = new SuppFileForm($authorSubmission, $suppFileId); $submitForm->readInputData(); if ($submitForm->validate()) { $submitForm->execute(); $request->redirect(null, null, null, 'submission', $paperId); } else { $submitForm->display(); } }
/** * Delete a supplementary file. * @param $args array, the first parameter is the supplementary file to delete */ function deleteSubmitSuppFile($args) { import("file.ArticleFileManager"); parent::validate(); parent::setupTemplate(true); $articleId = Request::getUserVar('articleId'); $suppFileId = isset($args[0]) ? (int) $args[0] : 0; // Opatan Inc. : form of step 2 is validated instead of step 4 list($journal, $article) = SubmitHandler::validate($articleId, 2); $suppFileDao =& DAORegistry::getDAO('SuppFileDAO'); $suppFile = $suppFileDao->getSuppFile($suppFileId, $articleId); $suppFileDao->deleteSuppFileById($suppFileId, $articleId); if ($suppFile->getFileId()) { $articleFileManager =& new ArticleFileManager($articleId); $articleFileManager->deleteFile($suppFile->getFileId()); } // Opatan Inc. : it is redirected to step 2 instead of step 4 Request::redirect(null, null, 'submit', '2', array('articleId' => $articleId)); }
/** * 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); }