Пример #1
0
 /**
  * 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');
 }
Пример #2
0
 /**
  * Validation check for submission.
  * Checks that article ID is valid, if specified.
  * @param $articleId int
  * @param $step int
  */
 function validate($request, $articleId = null, $step = false, $reason = null)
 {
     parent::validate($reason);
     $articleDao =& DAORegistry::getDAO('ArticleDAO');
     $user =& $request->getUser();
     $journal =& $request->getJournal();
     if ($step !== false && ($step < 1 || $step > 5 || !$articleId && $step != 1)) {
         $request->redirect(null, null, 'submit', array(1));
     }
     $article = null;
     // Check that article exists for this journal and user and that submission is incomplete
     if ($articleId) {
         $article =& $articleDao->getArticle((int) $articleId);
         if (!$article || $article->getUserId() !== $user->getId() || $article->getJournalId() !== $journal->getId() || $step !== false && $step > $article->getSubmissionProgress()) {
             $request->redirect(null, null, 'submit');
         }
     }
     $this->article =& $article;
     return true;
 }
 /**
  * Validate that the user is the author for the article.
  * Redirects to author index page if validation fails.
  */
 function validate($articleId)
 {
     parent::validate();
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $journal =& Request::getJournal();
     $user =& Request::getUser();
     $isValid = true;
     $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($articleId);
     if ($authorSubmission == null) {
         $isValid = false;
     } else {
         if ($authorSubmission->getJournalId() != $journal->getId()) {
             $isValid = false;
         } else {
             if ($authorSubmission->getUserId() != $user->getId()) {
                 $isValid = false;
             }
         }
     }
     if (!$isValid) {
         Request::redirect(null, Request::getRequestedPage());
     }
     $this->journal =& $journal;
     $this->submission =& $authorSubmission;
     return true;
 }
Пример #4
0
 /**
  * Validate that the user is the author for the paper.
  * Redirects to author index page if validation fails.
  * @param $paperId int
  * @param $requiresEditAccess boolean True means that the author must
  * 	  have edit access over the specified paper in order for
  * 	  validation to be successful.
  * @param $isDeleting boolean True iff user is deleting a paper
  */
 function validate($paperId, $requiresEditAccess = false, $isDeleting = false)
 {
     parent::validate();
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     $user =& Request::getUser();
     $isValid = true;
     $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($paperId);
     if ($authorSubmission == null) {
         $isValid = false;
     } else {
         if ($authorSubmission->getSchedConfId() != $schedConf->getId()) {
             $isValid = false;
         } else {
             if ($authorSubmission->getUserId() != $user->getId()) {
                 $isValid = false;
             }
         }
     }
     if ($isValid && $requiresEditAccess) {
         if (!AuthorAction::mayEditPaper($authorSubmission)) {
             $isValid = false;
         }
     }
     if (!$isValid) {
         Request::redirect(null, null, Request::getRequestedPage());
     }
     $this->submission =& $authorSubmission;
     return true;
 }
 /**
  * Constructor
  **/
 function SubmissionCommentsHandler()
 {
     parent::AuthorHandler();
 }
 /**
  * Validate that the user is the author of the comment.
  */
 function validate($commentId)
 {
     parent::validate();
     $isValid = true;
     $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
     $user =& Request::getUser();
     $comment =& $articleCommentDao->getArticleCommentById($commentId);
     if ($comment == null) {
         $isValid = false;
     } else {
         if ($comment->getAuthorId() != $user->getUserId()) {
             $isValid = false;
         }
     }
     if (!$isValid) {
         Request::redirect(null, Request::getRequestedPage());
     }
     return array($comment);
 }
Пример #7
0
 /**
  * Validation check for submission.
  * Checks that paper ID is valid, if specified.
  * @param $request object
  * @param $paperId int
  * @param $step int
  */
 function validate($request, $paperId = null, $step = false)
 {
     parent::validate();
     $conference =& $request->getConference();
     $schedConf =& $request->getSchedConf();
     $paperDao =& DAORegistry::getDAO('PaperDAO');
     $user =& $request->getUser();
     if ($step !== false && ($step < 1 || $step > 5 || !isset($paperId) && $step != 1)) {
         $request->redirect(null, null, null, 'submit', array(1));
     }
     $paper = null;
     if ($paperId) {
         // Check that paper exists for this conference and user and that submission is incomplete
         $paper =& $paperDao->getPaper((int) $paperId);
         if (!$paper || $paper->getUserId() !== $user->getId() || $paper->getSchedConfId() !== $schedConf->getId()) {
             $request->redirect(null, null, null, 'submit');
         }
         if ($step !== false && $step > $paper->getSubmissionProgress()) {
             $request->redirect(null, null, null, 'submit');
         }
     } else {
         // If the paper does not exist, require that the
         // submission window be open or that this user be a
         // director or track director.
         import('classes.schedConf.SchedConfAction');
         $schedConf =& $request->getSchedConf();
         if (!$schedConf || !SchedConfAction::submissionsOpen($schedConf) && !Validation::isDirector($schedConf->getConferenceId(), $schedConf->getId()) && !Validation::isTrackDirector($schedConf->getConferenceId())) {
             $request->redirect(null, null, 'author', 'index');
         }
     }
     $this->paper =& $paper;
     return true;
 }
 /**
  * Validate that the user is the author for the paper.
  * Redirects to author index page if validation fails.
  * @param $paperId int
  * @param $requiresEditAccess boolean True means that the author must
  * 	  have edit access over the specified paper in order for
  * 	  validation to be successful.
  * @param $isDeleting boolean True iff user is deleting a paper, and is not
  *	  coming from an old URL (e.g. submission ack email)
  */
 function validate($request, $paperId, $requiresEditAccess = false, $isDeleting = false)
 {
     parent::validate();
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $conference =& $request->getConference();
     $schedConf =& $request->getSchedConf();
     $user =& $request->getUser();
     $isValid = true;
     $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($paperId);
     if ($authorSubmission == null) {
         $isValid = false;
     } else {
         if ($authorSubmission->getSchedConfId() != $schedConf->getId()) {
             $isValid = false;
         } else {
             if ($authorSubmission->getUserId() != $user->getId()) {
                 $isValid = false;
             }
         }
     }
     if ($isValid && !$isDeleting) {
         // The user may be coming in on an old URL e.g. from the submission
         // ack email. If OCS is awaiting the completion of the submission,
         // send them to the submit page.
         if ($authorSubmission->getSubmissionProgress() != 0) {
             $request->redirect(null, null, null, 'submit', array($authorSubmission->getSubmissionProgress()), array('paperId' => $authorSubmission->getId()));
         }
     }
     if ($isValid && $requiresEditAccess) {
         if (!AuthorAction::mayEditPaper($authorSubmission)) {
             $isValid = false;
         }
     }
     if (!$isValid) {
         $request->redirect(null, null, $request->getRequestedPage());
     }
     $this->submission =& $authorSubmission;
     return true;
 }
Пример #9
0
 /**
  * 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);
 }
Пример #11
0
 /**
  * Constructor
  **/
 function TrackSubmissionHandler()
 {
     parent::AuthorHandler();
 }