From 71c1f87552d8bfebbd772c2db0d1a42f7927fd6e Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 30 Nov 2022 10:40:21 +1300 Subject: [PATCH] Add Imports search This allows an over-view of a user's searches --- ext/civiimport/Managed/ImportSearches.mgd.php | 14 ------ .../Managed/UserJobSearches.mgd.php | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 ext/civiimport/Managed/UserJobSearches.mgd.php diff --git a/ext/civiimport/Managed/ImportSearches.mgd.php b/ext/civiimport/Managed/ImportSearches.mgd.php index e1ce9d4b45..2f80a3cd38 100644 --- a/ext/civiimport/Managed/ImportSearches.mgd.php +++ b/ext/civiimport/Managed/ImportSearches.mgd.php @@ -1,22 +1,8 @@ addWhere('name', '=', 'SearchDisplay') - ->selectRowCount() - ->execute()->count()) { - return []; - } -} -catch (CRM_Core_Exception $e) { - return []; -} - $managedEntities = []; $importEntities = Import::getImportTables(); foreach ($importEntities as $importEntity) { diff --git a/ext/civiimport/Managed/UserJobSearches.mgd.php b/ext/civiimport/Managed/UserJobSearches.mgd.php new file mode 100644 index 0000000000..8a78511d26 --- /dev/null +++ b/ext/civiimport/Managed/UserJobSearches.mgd.php @@ -0,0 +1,50 @@ + 'SavedSearch_My_imports', + 'entity' => 'SavedSearch', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'My_imports', + 'label' => E::ts('My imports'), + 'form_values' => NULL, + 'mapping_id' => NULL, + 'search_custom_id' => NULL, + 'api_entity' => 'UserJob', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'created_date', + 'status_id:label', + 'job_type:label', + ], + 'orderBy' => [], + 'where' => [ + [ + 'created_id', + '=', + 'user_contact_id', + ], + [ + 'is_template', + '=', + FALSE, + ], + ], + 'groupBy' => [], + 'join' => [], + 'having' => [], + ], + 'expires_date' => NULL, + 'description' => NULL, + ], + ], + ], +]; -- 2.25.1