);
// 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'),