submissionEnabled() public method

Determine whether submission fees are enabled.
public submissionEnabled ( ) : boolean
return boolean true iff this fee is enabled.
 /**
  * Display the form.
  */
 function display()
 {
     $journal =& $this->request->getJournal();
     $user =& $this->request->getUser();
     $templateMgr =& TemplateManager::getManager();
     // Get sections for this journal
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     // If this user is a section editor or an editor, they are
     // allowed to submit to sections flagged as "editor-only" for
     // submissions. Otherwise, display only sections they are
     // allowed to submit to.
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $isEditor = $roleDao->userHasRole($journal->getId(), $user->getId(), ROLE_ID_EDITOR) || $roleDao->userHasRole($journal->getId(), $user->getId(), ROLE_ID_SECTION_EDITOR);
     $templateMgr->assign('sectionOptions', array('0' => __('author.submit.selectSection')) + $sectionDao->getSectionTitles($journal->getId(), !$isEditor));
     // Set up required Payment Related Information
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($this->request);
     if ($paymentManager->submissionEnabled() || $paymentManager->fastTrackEnabled() || $paymentManager->publicationEnabled()) {
         $templateMgr->assign('authorFees', true);
         $completedPaymentDao =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
         $articleId = $this->articleId;
         if ($paymentManager->submissionEnabled()) {
             $templateMgr->assign_by_ref('submissionPayment', $completedPaymentDao->getSubmissionCompletedPayment($journal->getId(), $articleId));
         }
         if ($paymentManager->fastTrackEnabled()) {
             $templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDao->getFastTrackCompletedPayment($journal->getId(), $articleId));
         }
     }
     // Provide available submission languages. (Convert the array
     // of locale symbolic names xx_XX into an associative array
     // of symbolic names => readable names.)
     $supportedSubmissionLocales = $journal->getSetting('supportedSubmissionLocales');
     if (empty($supportedSubmissionLocales)) {
         $supportedSubmissionLocales = array($journal->getPrimaryLocale());
     }
     $templateMgr->assign('supportedSubmissionLocaleNames', array_flip(array_intersect(array_flip(AppLocale::getAllLocales()), $supportedSubmissionLocales)));
     parent::display();
 }
 /**
  * Validate the form
  */
 function validate()
 {
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($this->request);
     if ($paymentManager->submissionEnabled()) {
         if (!parent::validate()) {
             return false;
         }
         $journal =& $this->request->getJournal();
         $journalId = $journal->getId();
         $articleId = $this->articleId;
         $user =& $this->request->getUser();
         $completedPaymentDao =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
         if ($completedPaymentDao->hasPaidSubmission($journalId, $articleId)) {
             return parent::validate();
         } elseif ($this->request->getUserVar('qualifyForWaiver') && $this->request->getUserVar('commentsToEditor') != '') {
             return parent::validate();
         } elseif ($this->request->getUserVar('paymentSent')) {
             return parent::validate();
         } else {
             $queuedPayment =& $paymentManager->createQueuedPayment($journalId, PAYMENT_TYPE_SUBMISSION, $user->getId(), $articleId, $journal->getSetting('submissionFee'));
             $queuedPaymentId = $paymentManager->queuePayment($queuedPayment);
             $paymentManager->displayPaymentForm($queuedPaymentId, $queuedPayment);
             exit;
         }
     } else {
         return parent::validate();
     }
 }
 /**
  * View the submission page.
  * @param $args array
  * @param $request PKPRequest
  */
 function submission($args, &$request)
 {
     $articleId = (int) array_shift($args);
     $this->validate($articleId);
     $journal =& $request->getJournal();
     $submission =& $this->submission;
     // FIXME? For comments.readerComments under Status and
     // author.submit.selectPrincipalContact under Metadata
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_READER, LOCALE_COMPONENT_OJS_AUTHOR);
     $this->setupTemplate(true, $articleId);
     $user =& $request->getUser();
     $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
     $journalSettings = $journalSettingsDao->getJournalSettings($journal->getId());
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $isEditor = $roleDao->userHasRole($journal->getId(), $user->getId(), ROLE_ID_EDITOR);
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     $section =& $sectionDao->getSection($submission->getSectionId());
     $enableComments = $journal->getSetting('enableComments');
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign_by_ref('submission', $submission);
     $templateMgr->assign_by_ref('section', $section);
     $templateMgr->assign_by_ref('submissionFile', $submission->getSubmissionFile());
     $templateMgr->assign_by_ref('suppFiles', $submission->getSuppFiles());
     $templateMgr->assign_by_ref('reviewFile', $submission->getReviewFile());
     $templateMgr->assign_by_ref('journalSettings', $journalSettings);
     $templateMgr->assign('userId', $user->getId());
     $templateMgr->assign('isEditor', $isEditor);
     $templateMgr->assign('enableComments', $enableComments);
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     $templateMgr->assign_by_ref('sections', $sectionDao->getSectionTitles($journal->getId()));
     if ($enableComments) {
         import('classes.article.Article');
         $templateMgr->assign('commentsStatus', $submission->getCommentsStatus());
         $templateMgr->assign_by_ref('commentsStatusOptions', Article::getCommentsStatusOptions());
     }
     $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
     $publishedArticle =& $publishedArticleDao->getPublishedArticleByArticleId($submission->getId());
     if ($publishedArticle) {
         $issueDao =& DAORegistry::getDAO('IssueDAO');
         $issue =& $issueDao->getIssueById($publishedArticle->getIssueId());
         $templateMgr->assign_by_ref('issue', $issue);
         $templateMgr->assign_by_ref('publishedArticle', $publishedArticle);
     }
     if ($isEditor) {
         $templateMgr->assign('helpTopicId', 'editorial.editorsRole.submissionSummary');
     }
     // Set up required Payment Related Information
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     if ($paymentManager->submissionEnabled() || $paymentManager->fastTrackEnabled() || $paymentManager->publicationEnabled()) {
         $templateMgr->assign('authorFees', true);
         $completedPaymentDao =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
         if ($paymentManager->submissionEnabled()) {
             $templateMgr->assign_by_ref('submissionPayment', $completedPaymentDao->getSubmissionCompletedPayment($journal->getId(), $articleId));
         }
         if ($paymentManager->fastTrackEnabled()) {
             $templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDao->getFastTrackCompletedPayment($journal->getId(), $articleId));
         }
         if ($paymentManager->publicationEnabled()) {
             $templateMgr->assign_by_ref('publicationPayment', $completedPaymentDao->getPublicationCompletedPayment($journal->getId(), $articleId));
         }
     }
     $templateMgr->assign('canEditMetadata', true);
     $templateMgr->display('sectionEditor/submission.tpl');
 }
Example #4
0
 /**
  * Display journal author index page.
  * @param $args array
  * @param $request PKPRequest
  */
 function index($args, $request)
 {
     $this->validate($request);
     $this->setupTemplate($request);
     $journal =& $request->getJournal();
     $user =& $request->getUser();
     $rangeInfo =& $this->getRangeInfo('submissions');
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $page = array_shift($args);
     switch ($page) {
         case 'completed':
             $active = false;
             break;
         default:
             $page = 'active';
             $active = true;
     }
     $sort = $request->getUserVar('sort');
     $sort = isset($sort) ? $sort : 'title';
     $sortDirection = $request->getUserVar('sortDirection');
     $sortDirection = isset($sortDirection) && ($sortDirection == SORT_DIRECTION_ASC || $sortDirection == SORT_DIRECTION_DESC) ? $sortDirection : SORT_DIRECTION_ASC;
     if ($sort == 'status') {
         // FIXME Does not pass $rangeInfo else we only get partial results
         $unsortedSubmissions = $authorSubmissionDao->getAuthorSubmissions($user->getId(), $journal->getId(), $active, null, $sort, $sortDirection);
         // Sort all submissions by status, which is too complex to do in the DB
         $submissionsArray = $unsortedSubmissions->toArray();
         $compare = create_function('$s1, $s2', 'return strcmp($s1->getSubmissionStatus(), $s2->getSubmissionStatus());');
         usort($submissionsArray, $compare);
         if ($sortDirection == SORT_DIRECTION_DESC) {
             $submissionsArray = array_reverse($submissionsArray);
         }
         // Convert submission array back to an ItemIterator class
         import('lib.pkp.classes.core.ArrayItemIterator');
         $submissions =& ArrayItemIterator::fromRangeInfo($submissionsArray, $rangeInfo);
     } else {
         $submissions = $authorSubmissionDao->getAuthorSubmissions($user->getId(), $journal->getId(), $active, $rangeInfo, $sort, $sortDirection);
     }
     $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('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     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);
     }
     import('classes.issue.IssueAction');
     $issueAction = new IssueAction();
     $templateMgr->register_function('print_issue_id', array($issueAction, 'smartyPrintIssueId'));
     $templateMgr->assign('helpTopicId', 'editorial.authorsRole.submissions');
     $templateMgr->assign('sort', $sort);
     $templateMgr->assign('sortDirection', $sortDirection);
     $templateMgr->display('author/index.tpl');
 }
 /**
  * Display a summary of the status of an author's submission.
  * @param $args array
  * @param $request PKPRequest
  */
 function submission($args, $request)
 {
     $journal =& $request->getJournal();
     $user =& $request->getUser();
     $articleId = (int) array_shift($args);
     $this->validate($request, $articleId);
     $submission =& $this->submission;
     $this->setupTemplate($request, true, $articleId);
     $journalSettingsDao =& DAORegistry::getDAO('JournalSettingsDAO');
     $journalSettings = $journalSettingsDao->getJournalSettings($journal->getId());
     // Setting the round.
     $round = (int) array_shift($args);
     if (!$round) {
         $round = $submission->getCurrentRound();
     }
     $templateMgr =& TemplateManager::getManager();
     $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
     $publishedArticle =& $publishedArticleDao->getPublishedArticleByArticleId($submission->getId());
     if ($publishedArticle) {
         $issueDao =& DAORegistry::getDAO('IssueDAO');
         $issue =& $issueDao->getIssueById($publishedArticle->getIssueId());
         $templateMgr->assign_by_ref('issue', $issue);
     }
     $sectionDao =& DAORegistry::getDAO('SectionDAO');
     $section =& $sectionDao->getSection($submission->getSectionId());
     $templateMgr->assign_by_ref('section', $section);
     $templateMgr->assign_by_ref('journalSettings', $journalSettings);
     $templateMgr->assign_by_ref('submission', $submission);
     $templateMgr->assign_by_ref('publishedArticle', $publishedArticle);
     $templateMgr->assign_by_ref('reviewAssignments', $submission->getReviewAssignments($round));
     $templateMgr->assign('round', $round);
     $templateMgr->assign_by_ref('submissionFile', $submission->getSubmissionFile());
     $templateMgr->assign_by_ref('revisedFile', $submission->getRevisedFile());
     $templateMgr->assign_by_ref('suppFiles', $submission->getSuppFiles());
     import('classes.submission.sectionEditor.SectionEditorSubmission');
     $templateMgr->assign_by_ref('editorDecisionOptions', SectionEditorSubmission::getEditorDecisionOptions());
     // Set up required Payment Related Information
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     if ($paymentManager->submissionEnabled() || $paymentManager->fastTrackEnabled() || $paymentManager->publicationEnabled()) {
         $templateMgr->assign('authorFees', true);
         $completedPaymentDao =& DAORegistry::getDAO('OJSCompletedPaymentDAO');
         if ($paymentManager->submissionEnabled()) {
             $templateMgr->assign_by_ref('submissionPayment', $completedPaymentDao->getSubmissionCompletedPayment($journal->getId(), $articleId));
         }
         if ($paymentManager->fastTrackEnabled()) {
             $templateMgr->assign_by_ref('fastTrackPayment', $completedPaymentDao->getFastTrackCompletedPayment($journal->getId(), $articleId));
         }
         if ($paymentManager->publicationEnabled()) {
             $templateMgr->assign_by_ref('publicationPayment', $completedPaymentDao->getPublicationCompletedPayment($journal->getId(), $articleId));
         }
     }
     $templateMgr->assign('helpTopicId', 'editorial.authorsRole');
     $initialCopyeditSignoff = $submission->getSignoff('SIGNOFF_COPYEDITING_INITIAL');
     $templateMgr->assign('canEditMetadata', !$initialCopyeditSignoff->getDateCompleted() && $submission->getStatus() != STATUS_PUBLISHED);
     $templateMgr->display('author/submission.tpl');
 }