From 35602e2f4087bd3f5503772ef2e3ae662b96788a Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Wed, 6 Dec 2023 22:46:15 +0000 Subject: [PATCH] Migrate LabelFormat from SearchUI to AdminUI --- .../ang/afsearchLabelFormat.aff.html | 0 .../ang/afsearchLabelFormat.aff.php | 4 +-- .../managed/SavedSearch_label_format.mgd.php | 26 +++++++++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) rename ext/{civicrm_search_ui => civicrm_admin_ui}/ang/afsearchLabelFormat.aff.html (100%) rename ext/{civicrm_search_ui => civicrm_admin_ui}/ang/afsearchLabelFormat.aff.php (69%) rename ext/{civicrm_search_ui => civicrm_admin_ui}/managed/SavedSearch_label_format.mgd.php (85%) diff --git a/ext/civicrm_search_ui/ang/afsearchLabelFormat.aff.html b/ext/civicrm_admin_ui/ang/afsearchLabelFormat.aff.html similarity index 100% rename from ext/civicrm_search_ui/ang/afsearchLabelFormat.aff.html rename to ext/civicrm_admin_ui/ang/afsearchLabelFormat.aff.html diff --git a/ext/civicrm_search_ui/ang/afsearchLabelFormat.aff.php b/ext/civicrm_admin_ui/ang/afsearchLabelFormat.aff.php similarity index 69% rename from ext/civicrm_search_ui/ang/afsearchLabelFormat.aff.php rename to ext/civicrm_admin_ui/ang/afsearchLabelFormat.aff.php index 88742dfb1b..d0d3f0d498 100644 --- a/ext/civicrm_search_ui/ang/afsearchLabelFormat.aff.php +++ b/ext/civicrm_admin_ui/ang/afsearchLabelFormat.aff.php @@ -1,12 +1,12 @@ 'search', 'title' => E::ts('Label Formats'), 'description' => E::ts('Label Formats'), 'icon' => 'fa-list-alt', - 'server_route' => 'civicrm/searchkit_ui/admin/labelFormats', + 'server_route' => 'civicrm/admin/labelFormats', 'permission' => [ 'administer CiviCRM', ], diff --git a/ext/civicrm_search_ui/managed/SavedSearch_label_format.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_label_format.mgd.php similarity index 85% rename from ext/civicrm_search_ui/managed/SavedSearch_label_format.mgd.php rename to ext/civicrm_admin_ui/managed/SavedSearch_label_format.mgd.php index 0a225004fb..406f8750c5 100644 --- a/ext/civicrm_search_ui/managed/SavedSearch_label_format.mgd.php +++ b/ext/civicrm_admin_ui/managed/SavedSearch_label_format.mgd.php @@ -1,5 +1,5 @@ 4, 'values' => [ 'name' => 'label_format', - 'label' => E::ts('label format'), + 'label' => E::ts('Label Format'), 'api_entity' => 'OptionGroup', 'api_params' => [ 'version' => 4, @@ -19,7 +19,7 @@ return [ 'OptionGroup_OptionValue_option_group_id_01.label', 'title', 'description', - 'is_reserved', + 'OptionGroup_OptionValue_option_group_id_01.is_reserved', 'OptionGroup_OptionValue_option_group_id_01.grouping', 'OptionGroup_OptionValue_option_group_id_01.is_default', ], @@ -63,7 +63,7 @@ return [ 'version' => 4, 'values' => [ 'name' => 'label_format_Table_1', - 'label' => E::ts('label format Table 1'), + 'label' => E::ts('Label Format Table 1'), 'saved_search_id.name' => 'label_format', 'type' => 'table', 'settings' => [ @@ -119,7 +119,7 @@ return [ ], [ 'type' => 'field', - 'key' => 'is_reserved', + 'key' => 'OptionGroup_OptionValue_option_group_id_01.is_reserved', 'dataType' => 'Boolean', 'label' => E::ts('Reserved'), 'sortable' => TRUE, @@ -154,6 +154,22 @@ return [ 'join' => '', 'target' => 'crm-popup', ], + [ + 'entity' => 'OptionValue', + 'action' => 'delete', + 'join' => 'OptionGroup_OptionValue_option_group_id_01', + 'target' => 'crm-popup', + 'icon' => 'fa-trash', + 'text' => E::ts('Delete'), + 'style' => 'danger', + 'path' => '', + 'task' => '', + 'condition' => [ + 'OptionGroup_OptionValue_option_group_id_01.is_reserved', + '=', + FALSE, + ], + ], ], 'type' => 'menu', 'alignment' => 'text-right', -- 2.25.1