From d72f1d4ab90802afc492492018a2d829a7441919 Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Wed, 24 May 2023 14:25:21 +0100 Subject: [PATCH] Main thing is to add a filter and list of fields on the custom field group page. A few tweaks/standardisations in line with other AdminUI pages. --- .../ang/afsearchAdminCustomFields.aff.html | 3 ++ .../ang/afsearchAdminCustomFields.aff.json | 13 +++++- .../ang/afsearchAdminCustomGroups.aff.html | 11 +++-- .../ang/afsearchAdminCustomGroups.aff.json | 13 +++++- ...vedSearch_Administer_Custom_Fields.mgd.php | 12 +++++- ...vedSearch_Administer_Custom_Groups.mgd.php | 40 +++++++++++++++---- 6 files changed, 77 insertions(+), 15 deletions(-) diff --git a/ext/civicrm_admin_ui/ang/afsearchAdminCustomFields.aff.html b/ext/civicrm_admin_ui/ang/afsearchAdminCustomFields.aff.html index d34a79642c..9196548df1 100644 --- a/ext/civicrm_admin_ui/ang/afsearchAdminCustomFields.aff.html +++ b/ext/civicrm_admin_ui/ang/afsearchAdminCustomFields.aff.html @@ -1,3 +1,6 @@
+
+ +
diff --git a/ext/civicrm_admin_ui/ang/afsearchAdminCustomFields.aff.json b/ext/civicrm_admin_ui/ang/afsearchAdminCustomFields.aff.json index e879778b04..185667191e 100644 --- a/ext/civicrm_admin_ui/ang/afsearchAdminCustomFields.aff.json +++ b/ext/civicrm_admin_ui/ang/afsearchAdminCustomFields.aff.json @@ -1,8 +1,19 @@ { "type": "search", "requires": [], + "entity_type": null, + "join_entity": null, "title": "Fields", "description": "Administer custom fields list", + "is_dashlet": false, + "is_public": false, + "is_token": false, + "contact_summary": null, + "summary_contact_type": null, + "icon": "fa-list-alt", "server_route": "civicrm/admin/custom/group/fields", - "permission": "administer CiviCRM data" + "permission": "administer CiviCRM data", + "redirect": null, + "create_submission": false, + "navigation": null } diff --git a/ext/civicrm_admin_ui/ang/afsearchAdminCustomGroups.aff.html b/ext/civicrm_admin_ui/ang/afsearchAdminCustomGroups.aff.html index ed0b0688ff..b4ce20e8f0 100644 --- a/ext/civicrm_admin_ui/ang/afsearchAdminCustomGroups.aff.html +++ b/ext/civicrm_admin_ui/ang/afsearchAdminCustomGroups.aff.html @@ -4,12 +4,17 @@ {{:: ts('Custom data is stored in custom fields. Custom fields are organized into logically related custom data sets (e.g. Volunteer Info). Use custom fields to collect and store custom data which are not included in the standard CiviCRM forms. You can create one or many sets of custom fields.') }} {{:: ts('Learn more...') }} -
+
+
+ + + +
+
- + {{:: ts('Add Set of Custom Fields') }} -
diff --git a/ext/civicrm_admin_ui/ang/afsearchAdminCustomGroups.aff.json b/ext/civicrm_admin_ui/ang/afsearchAdminCustomGroups.aff.json index 870edb7c15..449a7e5f65 100644 --- a/ext/civicrm_admin_ui/ang/afsearchAdminCustomGroups.aff.json +++ b/ext/civicrm_admin_ui/ang/afsearchAdminCustomGroups.aff.json @@ -1,8 +1,19 @@ { "type": "search", "requires": [], + "entity_type": null, + "join_entity": null, "title": "Custom Field Groups", "description": "Administer custom field groups list", + "is_dashlet": false, + "is_public": false, + "is_token": false, + "contact_summary": null, + "summary_contact_type": null, + "icon": "fa-list-alt", "server_route": "civicrm/admin/custom/group", - "permission": "administer CiviCRM data" + "permission": "administer CiviCRM data", + "redirect": null, + "create_submission": false, + "navigation": null } diff --git a/ext/civicrm_admin_ui/managed/SavedSearch_Administer_Custom_Fields.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_Administer_Custom_Fields.mgd.php index 49829b1bd4..0d5d157d1d 100644 --- a/ext/civicrm_admin_ui/managed/SavedSearch_Administer_Custom_Fields.mgd.php +++ b/ext/civicrm_admin_ui/managed/SavedSearch_Administer_Custom_Fields.mgd.php @@ -13,6 +13,7 @@ return [ 'name' => 'Administer_Custom_Fields', 'label' => E::ts('Administer Custom Fields'), 'form_values' => NULL, + 'mapping_id' => NULL, 'search_custom_id' => NULL, 'api_entity' => 'CustomField', 'api_params' => [ @@ -35,7 +36,9 @@ return [ ], 'expires_date' => NULL, 'description' => NULL, - 'mapping_id' => NULL, + ], + 'match' => [ + 'name', ], ], ], @@ -127,7 +130,7 @@ return [ 'alignment' => 'text-right', ], [ - 'text' => E::ts('Actions'), + 'text' => '', 'style' => 'default', 'size' => 'btn-xs', 'icon' => 'fa-bars', @@ -198,9 +201,14 @@ return [ 'text' => E::ts('Add Custom Field'), 'icon' => 'fa-plus', ], + 'placeholder' => 5, ], 'acl_bypass' => FALSE, ], + 'match' => [ + 'name', + 'saved_search_id', + ], ], ], ]; diff --git a/ext/civicrm_admin_ui/managed/SavedSearch_Administer_Custom_Groups.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_Administer_Custom_Groups.mgd.php index ee74c16705..38f16723b4 100644 --- a/ext/civicrm_admin_ui/managed/SavedSearch_Administer_Custom_Groups.mgd.php +++ b/ext/civicrm_admin_ui/managed/SavedSearch_Administer_Custom_Groups.mgd.php @@ -13,6 +13,7 @@ return [ 'name' => 'Administer_Custom_Groups', 'label' => E::ts('Administer Custom Groups'), 'form_values' => NULL, + 'mapping_id' => NULL, 'search_custom_id' => NULL, 'api_entity' => 'CustomGroup', 'api_params' => [ @@ -25,6 +26,7 @@ return [ 'extends_entity_column_id:label', 'style:label', 'COUNT(CustomGroup_CustomField_custom_group_id_01.id) AS COUNT_CustomGroup_CustomField_custom_group_id_01_id', + 'GROUP_CONCAT(DISTINCT CustomGroup_CustomField_custom_group_id_01.label) AS GROUP_CONCAT_CustomGroup_CustomField_custom_group_id_01_label', ], 'orderBy' => [], 'where' => [], @@ -46,7 +48,9 @@ return [ ], 'expires_date' => NULL, 'description' => NULL, - 'mapping_id' => NULL, + ], + 'match' => [ + 'name', ], ], ], @@ -89,6 +93,14 @@ return [ 'label' => E::ts('Group Title'), 'sortable' => TRUE, ], + [ + 'type' => 'field', + 'key' => 'extends_entity_column_id:label', + 'dataType' => 'Integer', + 'label' => E::ts('Used for'), + 'sortable' => TRUE, + 'empty_value' => '[extends:label]', + ], [ 'type' => 'field', 'key' => 'is_active', @@ -99,18 +111,18 @@ return [ ], [ 'type' => 'field', - 'key' => 'extends_entity_column_id:label', - 'dataType' => 'Integer', - 'label' => E::ts('Used for'), + 'key' => 'style:label', + 'dataType' => 'String', + 'label' => E::ts('Style'), 'sortable' => TRUE, - 'empty_value' => '[extends:label]', ], [ - 'type' => 'field', - 'key' => 'style:label', + 'type' => 'html', + 'key' => 'GROUP_CONCAT_CustomGroup_CustomField_custom_group_id_01_label', 'dataType' => 'String', - 'label' => E::ts('Style'), + 'label' => E::ts('Fields'), 'sortable' => TRUE, + 'rewrite' => "{capture assign=fields}[GROUP_CONCAT_CustomGroup_CustomField_custom_group_id_01_label]{/capture}{ \$fields|replace:',':'
'}", ], [ 'size' => 'btn-xs', @@ -124,6 +136,7 @@ return [ 'text' => E::ts('Fields (%1)', [1 => '[COUNT_CustomGroup_CustomField_custom_group_id_01_id]']), 'style' => 'default', 'path' => 'civicrm/admin/custom/group/fields#/?gid=[id]', + 'condition' => [], ], [ 'entity' => 'CustomGroup', @@ -133,6 +146,8 @@ return [ 'icon' => 'fa-pencil', 'text' => E::ts('Settings'), 'style' => 'default', + 'path' => '', + 'condition' => [], ], ], 'type' => 'buttons', @@ -152,6 +167,8 @@ return [ 'icon' => 'fa-eye', 'text' => E::ts('Preview Group'), 'style' => 'default', + 'path' => '', + 'condition' => [], ], [ 'entity' => 'CustomGroup', @@ -161,6 +178,8 @@ return [ 'icon' => 'fa-trash', 'text' => E::ts('Delete Group'), 'style' => 'danger', + 'path' => '', + 'condition' => [], ], ], 'type' => 'menu', @@ -176,9 +195,14 @@ return [ FALSE, ], ], + 'placeholder' => 5, ], 'acl_bypass' => FALSE, ], + 'match' => [ + 'name', + 'saved_search_id', + ], ], ], ]; -- 2.25.1