From: demeritcowboy Date: Wed, 24 Jan 2024 15:52:12 +0000 (-0500) Subject: bring back missing actions X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=22a8aa118fd369113084eda493278b620894af8a;p=civicrm-core.git bring back missing actions --- 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']}";