do not show disabled financial types in listing
authorKurund Jalmi <kurund.jalmi@gmail.com>
Mon, 25 Apr 2022 16:54:55 +0000 (17:54 +0100)
committerGitHub <noreply@github.com>
Mon, 25 Apr 2022 16:54:55 +0000 (17:54 +0100)
CRM/Event/Form/ManageEvent/Fee.php

index ec9c2a8b507f9ee26403324b11b015a5c13cfffb..002daac241eb765d3f3a22654867277783c7f63e 100644 (file)
@@ -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);"]