From 8811ad4921150891b206997a7a59fe16a6473e2f Mon Sep 17 00:00:00 2001 From: Kurund Jalmi Date: Mon, 25 Apr 2022 17:54:55 +0100 Subject: [PATCH] do not show disabled financial types in listing --- CRM/Event/Form/ManageEvent/Fee.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index ec9c2a8b50..002daac241 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -246,14 +246,15 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { ); // financial type - if (!CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() || - (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && CRM_Core_Permission::check('administer CiviCRM Financial Types'))) { - $this->addSelect('financial_type_id'); - } - else { - CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes, CRM_Core_Action::ADD); - $this->addSelect('financial_type_id', ['context' => 'search', 'options' => $financialTypes]); + CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes, CRM_Core_Action::ADD); + $financialOptions = [ + 'options' => $financialTypes, + ]; + if (!CRM_Core_Permission::check('administer CiviCRM Financial Types')) { + $financialOptions['context'] = 'search'; } + $this->addSelect('financial_type_id', $financialOptions); + // add pay later options $this->addElement('checkbox', 'is_pay_later', ts('Enable Pay Later option?'), NULL, ['onclick' => "return showHideByValue('is_pay_later','','payLaterOptions','block','radio',false);"] -- 2.25.1