From 62d635fc8311e4548a18ce2917b993b03ac60f93 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 1 Dec 2021 10:03:09 +1300 Subject: [PATCH] Remove another isset - deferredFinancialType --- CRM/Event/Form/ManageEvent/Fee.php | 5 +---- CRM/Member/Form/MembershipType.php | 6 +----- templates/CRM/common/deferredFinancialType.tpl | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index 6a51501be0..f61a4e736a 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -362,10 +362,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { 'value' => 1, ] ); - if (Civi::settings()->get('deferred_revenue_enabled')) { - $deferredFinancialType = CRM_Financial_BAO_FinancialAccount::getDeferredFinancialType(); - $this->assign('deferredFinancialType', array_keys($deferredFinancialType)); - } + $this->assign('deferredFinancialType', Civi::settings()->get('deferred_revenue_enabled') ? array_keys(CRM_Financial_BAO_FinancialAccount::getDeferredFinancialType()) : NULL); $this->buildAmountLabel(); parent::buildQuickForm(); } diff --git a/CRM/Member/Form/MembershipType.php b/CRM/Member/Form/MembershipType.php index 3222ba7a7a..e715fe35c0 100644 --- a/CRM/Member/Form/MembershipType.php +++ b/CRM/Member/Form/MembershipType.php @@ -294,11 +294,7 @@ class CRM_Member_Form_MembershipType extends CRM_Member_Form_MembershipConfig { $this->addFormRule(['CRM_Member_Form_MembershipType', 'formRule']); $this->assign('membershipTypeId', $this->_id); - - if (Civi::settings()->get('deferred_revenue_enabled')) { - $deferredFinancialType = CRM_Financial_BAO_FinancialAccount::getDeferredFinancialType(); - $this->assign('deferredFinancialType', array_keys($deferredFinancialType)); - } + $this->assign('deferredFinancialType', Civi::settings()->get('deferred_revenue_enabled') ? array_keys(CRM_Financial_BAO_FinancialAccount::getDeferredFinancialType()) : NULL); } /** diff --git a/templates/CRM/common/deferredFinancialType.tpl b/templates/CRM/common/deferredFinancialType.tpl index 10c9628b2d..84f47c11e0 100644 --- a/templates/CRM/common/deferredFinancialType.tpl +++ b/templates/CRM/common/deferredFinancialType.tpl @@ -7,7 +7,7 @@ | and copyright information, see https://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{if isset($deferredFinancialType)} +{if $deferredFinancialType} {literal}