OJSPaymentManager::publicationEnabled PHP Method

publicationEnabled() public method

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

Usage Example

 /**
  * Fetch the HTML contents of the form.
  * @param $request PKPRequest
  * return string
  */
 function fetch($request)
 {
     $context = $request->getContext();
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign('submissionId', $this->getSubmission()->getId());
     $templateMgr->assign('stageId', $this->getStageId());
     $templateMgr->assign('formParams', $this->getFormParams());
     $templateMgr->assign('context', $context);
     $journalSettingsDao = DAORegistry::getDAO('JournalSettingsDAO');
     $templateMgr->assign('issueOptions', $this->getIssueOptions($context));
     $publishedArticle = $this->getPublishedArticle();
     if ($publishedArticle) {
         $templateMgr->assign('publishedArticle', $publishedArticle);
         $issueDao = DAORegistry::getDAO('IssueDAO');
         $issue = $issueDao->getById($publishedArticle->getIssueId());
         if ($issue) {
             $templateMgr->assign('issueAccess', $issue->getAccessStatus());
             $templateMgr->assign('accessOptions', array(ARTICLE_ACCESS_ISSUE_DEFAULT => __('editor.issues.default'), ARTICLE_ACCESS_OPEN => __('editor.issues.open')));
         }
     }
     // include payment information
     // Set up required Payment Related Information
     import('classes.payment.ojs.OJSPaymentManager');
     $paymentManager = new OJSPaymentManager($request);
     $completedPaymentDao = DAORegistry::getDAO('OJSCompletedPaymentDAO');
     $publicationFeeEnabled = $paymentManager->publicationEnabled();
     $templateMgr->assign('publicationFeeEnabled', $publicationFeeEnabled);
     if ($publicationFeeEnabled) {
         $templateMgr->assign('publicationPayment', $completedPaymentDao->getPublicationCompletedPayment($context->getId(), $this->getSubission()->getId()));
     }
     $templateMgr->assign('submission', $this->getSubmission());
     return parent::fetch($request);
 }
All Usage Examples Of OJSPaymentManager::publicationEnabled