From b5af68f1dd30d0a234388f89664177045be0a5bc Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 22 Mar 2023 21:15:32 +1300 Subject: [PATCH] Add Template search --- .../Managed/UserJobSearches.mgd.php | 112 ++++++++++++++++++ ext/civiimport/ang/afsearchTemplates.aff.html | 3 + ext/civiimport/ang/afsearchTemplates.aff.json | 23 ++++ 3 files changed, 138 insertions(+) create mode 100644 ext/civiimport/ang/afsearchTemplates.aff.html create mode 100644 ext/civiimport/ang/afsearchTemplates.aff.json diff --git a/ext/civiimport/Managed/UserJobSearches.mgd.php b/ext/civiimport/Managed/UserJobSearches.mgd.php index b3e1de0a0c..b26f770caf 100644 --- a/ext/civiimport/Managed/UserJobSearches.mgd.php +++ b/ext/civiimport/Managed/UserJobSearches.mgd.php @@ -52,4 +52,116 @@ return [ ], ], ], + [ + 'name' => 'SavedSearch_Import_Templates', + 'entity' => 'SavedSearch', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Import_Templates', + 'label' => E::ts('Import Templates'), + 'description' => E::ts('Available import templates'), + 'form_values' => NULL, + 'mapping_id' => NULL, + 'search_custom_id' => NULL, + 'api_entity' => 'UserJob', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'created_id.display_name', + 'name', + 'created_date', + 'job_type:label', + ], + 'orderBy' => [], + 'where' => [ + [ + 'is_template', + '=', + TRUE, + ], + ], + 'groupBy' => [], + 'join' => [], + 'having' => [], + ], + 'expires_date' => NULL, + ], + ], + ], + [ + 'name' => 'SavedSearch_Import_Templates_SearchDisplay_Import_Templates_Table_1', + 'entity' => 'SearchDisplay', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Import_Templates', + 'label' => E::ts('Import Templates'), + 'saved_search_id.name' => 'Import_Templates', + 'type' => 'table', + 'settings' => [ + 'description' => E::ts('Available import templates'), + 'sort' => [], + 'limit' => 50, + 'pager' => [], + 'placeholder' => 5, + 'columns' => [ + [ + 'type' => 'field', + 'key' => 'id', + 'dataType' => 'Integer', + 'label' => E::ts('ID'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'created_id.display_name', + 'dataType' => 'String', + 'label' => E::ts('Created By'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'name', + 'dataType' => 'String', + 'label' => E::ts('Import Name'), + 'sortable' => TRUE, + 'link' => [ + 'path' => 'civicrm/contribute/import?reset=1&template_id=[id]', + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + ], + ], + [ + 'type' => 'field', + 'key' => 'created_date', + 'dataType' => 'Timestamp', + 'label' => E::ts('Created Date'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'job_type:label', + 'dataType' => 'String', + 'label' => E::ts('Type'), + 'sortable' => TRUE, + ], + ], + 'actions' => TRUE, + 'classes' => [ + 'table', + 'table-striped', + ], + ], + 'acl_bypass' => FALSE, + ], + ], + ], ]; diff --git a/ext/civiimport/ang/afsearchTemplates.aff.html b/ext/civiimport/ang/afsearchTemplates.aff.html new file mode 100644 index 0000000000..a71e3383db --- /dev/null +++ b/ext/civiimport/ang/afsearchTemplates.aff.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/ext/civiimport/ang/afsearchTemplates.aff.json b/ext/civiimport/ang/afsearchTemplates.aff.json new file mode 100644 index 0000000000..6948f1d48b --- /dev/null +++ b/ext/civiimport/ang/afsearchTemplates.aff.json @@ -0,0 +1,23 @@ +{ + "type": "search", + "requires": [], + "entity_type": null, + "join_entity": null, + "title": "Import Templates", + "description": "", + "is_dashlet": false, + "is_public": false, + "is_token": false, + "contact_summary": null, + "summary_contact_type": null, + "icon": "fa-list-alt", + "server_route": "civicrm/imports/templates", + "permission": "access CiviCRM", + "redirect": null, + "create_submission": false, + "navigation": { + "parent": "Reports", + "label": "Import Templates", + "weight": 16 + } +} -- 2.25.1