From: Brienne Kordis Date: Tue, 6 Dec 2022 19:24:02 +0000 (-0500) Subject: conditionally hide Fees drop down item X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4b79f51c67e9c0304c8ced51432da9f0fc0d1b2a;p=civicrm-core.git conditionally hide Fees drop down item --- diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index 57a620ec1b..fc1a6f8784 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -147,13 +147,20 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { 'url' => 'civicrm/event/manage/location', 'field' => 'loc_block_id', ]; + // Check to see if CiviContribute is an enabled component. + $components = \Civi\Api4\Setting::get() + ->addSelect('enable_components') + ->execute()[0]['value']; + // If CiviContribute is active, create the Fees dropdown menu item. + if (in_array('CiviContribute', $components)) { + self::$_tabLinks[$cacheKey]['fee'] + = [ + 'title' => ts('Fees'), + 'url' => 'civicrm/event/manage/fee', + 'field' => 'is_monetary', + ]; + } - self::$_tabLinks[$cacheKey]['fee'] - = [ - 'title' => ts('Fees'), - 'url' => 'civicrm/event/manage/fee', - 'field' => 'is_monetary', - ]; self::$_tabLinks[$cacheKey]['registration'] = [ 'title' => ts('Online Registration'),