Merge pull request #23299 from kurund/hide-disabled-financial-types
authorcolemanw <coleman@civicrm.org>
Sat, 14 Oct 2023 15:27:46 +0000 (11:27 -0400)
committerGitHub <noreply@github.com>
Sat, 14 Oct 2023 15:27:46 +0000 (11:27 -0400)
do not show disabled financial types in select for manage events

1  2 
CRM/Event/Form/ManageEvent/Fee.php

index 52eb1eb987a7a87db753fc1e017d7ac968099d7d,002daac241eb765d3f3a22654867277783c7f63e..4cdc3eb1b8d6ea1bfe32d0c20db867c27770b89a
@@@ -246,16 -246,17 +246,17 @@@ class CRM_Event_Form_ManageEvent_Fee ex
      );
  
      // 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,
 +    $this->addElement('checkbox', 'is_pay_later', ts('Pay later option'), NULL,
        ['onclick' => "return showHideByValue('is_pay_later','','payLaterOptions','block','radio',false);"]
      );
      $this->addElement('textarea', 'pay_later_text', ts('Pay Later Label'),