OJSPaymentManager::submissionEnabled PHP Method

submissionEnabled() public method

Determine whether submission fees are enabled.
public submissionEnabled ( ) : boolean
return boolean true iff this fee is enabled.
    function submissionEnabled()
    {
        $journal = $this->request->getJournal();
        return $this->isConfigured() && $journal->getSetting('submissionFeeEnabled') && $journal->getSetting('submissionFee') > 0;
    }

Usage Example

 /**
  * 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();
 }
All Usage Examples Of OJSPaymentManager::submissionEnabled