From: Kurund Jalmi Date: Mon, 25 Apr 2022 16:54:55 +0000 (+0100) Subject: do not show disabled financial types in listing X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8811ad4921150891b206997a7a59fe16a6473e2f;p=civicrm-core.git do not show disabled financial types in listing --- 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);"]