public static function isACLFinancialTypeStatus() {
if (!isset(\Civi::$statics[__CLASS__]['is_acl_enabled'])) {
\Civi::$statics[__CLASS__]['is_acl_enabled'] = FALSE;
- $contributeSettings = Civi::settings()->get('contribution_invoice_settings');
- if (CRM_Utils_Array::value('acl_financial_type', $contributeSettings)) {
- \Civi::$statics[__CLASS__]['is_acl_enabled'] = TRUE;
+ $realSetting = \Civi::$statics[__CLASS__]['is_acl_enabled'] = Civi::settings()->get('acl_financial_type');
+ if (!$realSetting) {
+ $contributeSettings = Civi::settings()->get('contribution_invoice_settings');
+ if (CRM_Utils_Array::value('acl_financial_type', $contributeSettings)) {
+ \Civi::$statics[__CLASS__]['is_acl_enabled'] = TRUE;
+ }
}
}
return \Civi::$statics[__CLASS__]['is_acl_enabled'];
protected function enableFinancialACLs() {
$contributeSettings = Civi::settings()->get('contribution_invoice_settings');
$this->callAPISuccess('Setting', 'create', [
- 'contribution_invoice_settings' => array_merge($contributeSettings, ['acl_financial_type' => TRUE])
+ 'contribution_invoice_settings' => array_merge($contributeSettings, ['acl_financial_type' => TRUE]),
+ 'acl_financial_type' => TRUE,
]);
unset(\Civi::$statics['CRM_Financial_BAO_FinancialType']);
}
protected function disableFinancialACLs() {
$contributeSettings = Civi::settings()->get('contribution_invoice_settings');
$this->callAPISuccess('Setting', 'create', [
- 'contribution_invoice_settings' => array_merge($contributeSettings, ['acl_financial_type' => FALSE])
+ 'contribution_invoice_settings' => array_merge($contributeSettings, ['acl_financial_type' => FALSE]),
+ 'acl_financial_type' => FALSE,
]);
unset(\Civi::$statics['CRM_Financial_BAO_FinancialType']);
}