Main thing is to add a filter and list of fields on the custom field
authorAidan Saunders <aidan.saunders@squiffle.uk>
Wed, 24 May 2023 13:25:21 +0000 (14:25 +0100)
committerAidan Saunders <aidan.saunders@squiffle.uk>
Thu, 25 May 2023 08:56:15 +0000 (09:56 +0100)
group page.
A few tweaks/standardisations in line with other AdminUI pages.

ext/civicrm_admin_ui/ang/afsearchAdminCustomFields.aff.html
ext/civicrm_admin_ui/ang/afsearchAdminCustomFields.aff.json
ext/civicrm_admin_ui/ang/afsearchAdminCustomGroups.aff.html
ext/civicrm_admin_ui/ang/afsearchAdminCustomGroups.aff.json
ext/civicrm_admin_ui/managed/SavedSearch_Administer_Custom_Fields.mgd.php
ext/civicrm_admin_ui/managed/SavedSearch_Administer_Custom_Groups.mgd.php

index d34a79642ca092635d2453371748bcbbcb1196d2..9196548df15538643b738a522f48102107904486 100644 (file)
@@ -1,3 +1,6 @@
 <div af-fieldset="">
+  <div class="af-container af-layout-inline">
+    <af-field name="label" defn="{label: 'Field', input_attrs: {}, required: false}" />
+  </div>
   <crm-search-display-table search-name="Administer_Custom_Fields" display-name="Table" filters="{custom_group_id: routeParams.gid}"></crm-search-display-table>
 </div>
index e879778b043f764eeea54e20909f66714d4c8fe6..185667191eaf10a5c9886d71941b8217ca65e150 100644 (file)
@@ -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
 }
index ed0b0688ff20b9c8a4d05278f70ca56ee13cdec9..b4ce20e8f04159190086c59e5cb32c59298bf331 100644 (file)
@@ -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.') }}
       <a href="https://docs.civicrm.org/user/en/latest/organising-your-data/creating-custom-fields" target="_blank" class="crm-doc-link no-popup">{{:: ts('Learn more...') }}</a>
     </div>
-    <div>
+  </div>
+  <div class="af-container af-layout-inline">
+    <af-field name="title" defn="{required: false, input_attrs: {}, label: 'Group'}" />
+    <af-field name="extends" defn="{input_attrs: {multiple: true}, label: 'Used For'}" />
+    <af-field name="CustomGroup_CustomField_custom_group_id_01.label" defn="{required: false, input_attrs: {}, label: 'Field'}" />
+  </div>
+  <div class="btn-group pull-right">
       <a class="btn btn-primary" ng-href="{{:: crmUrl('civicrm/admin/custom/group/edit', {reset: 1}) }}">
-        <i class="crm-i fa-plus-circle"></i>
+        <i class="crm-i fa-plus"/>
         {{:: ts('Add Set of Custom Fields') }}
       </a>
-    </div>
   </div>
   <crm-search-display-table search-name="Administer_Custom_Groups" display-name="Table"></crm-search-display-table>
 </div>
index 870edb7c153ed1f60450020992d8ccc0ec2b8a17..449a7e5f6583f124b6edfde770cc6e4396081e60 100644 (file)
@@ -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
 }
index 49829b1bd431c58b30b0dca11a7f3ec1a8c6a7fa..0d5d157d1da5c1b79b2d55995d8b774ea47ab1ff 100644 (file)
@@ -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',
+      ],
     ],
   ],
 ];
index ee74c167054f31c428eb3f93d99b842bf90111f1..38f16723b4b1dd6adebaac1d431ffaea2d271541 100644 (file)
@@ -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:',':'<br>'}",
             ],
             [
               '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',
+      ],
     ],
   ],
 ];