From 22a8aa118fd369113084eda493278b620894af8a Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Wed, 24 Jan 2024 10:52:12 -0500 Subject: [PATCH] bring back missing actions --- Civi/Api4/Service/Links/ActivityLinksProvider.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Civi/Api4/Service/Links/ActivityLinksProvider.php b/Civi/Api4/Service/Links/ActivityLinksProvider.php index 7b95e01d1c..22308db56e 100644 --- a/Civi/Api4/Service/Links/ActivityLinksProvider.php +++ b/Civi/Api4/Service/Links/ActivityLinksProvider.php @@ -79,11 +79,9 @@ class ActivityLinksProvider extends \Civi\Core\Service\AutoSubscriber { private static function getActivityTypeAddLinks($contactId, $checkPermissions): array { $addLinks = []; $activityTypeQuery = OptionValue::get(FALSE) - ->addSelect('name', 'label', 'icon', 'value') + ->addSelect('name', 'label', 'icon', 'value', 'filter', 'component_id') ->addWhere('option_group_id:name', '=', 'activity_type') ->addWhere('is_active', '=', TRUE) - ->addWhere('filter', 'IS EMPTY') - ->addWhere('component_id', 'IS NULL') ->addOrderBy('weight'); // TODO: Code block was moved from CRM_Activity_Form_ActivityLinks and could use further cleanup @@ -135,6 +133,9 @@ class ActivityLinksProvider extends \Civi\Core\Service\AutoSubscriber { elseif ($act['name'] == 'Print PDF Letter') { $url = 'civicrm/activity/pdf/add'; } + elseif (!empty($act['filter']) || (!empty($act['component_id']) && $act['component_id'] != '1')) { + continue; + } $act['icon'] = $act['icon'] ?? 'fa-plus-square-o'; $act['path'] = "$url?$urlParams{$act['value']}"; -- 2.25.1