Skip to content

Commit

Permalink
Add All imports menu item for users with Administer QUeues
Browse files Browse the repository at this point in the history
This adds the (only just added) search display for 'all imports' to the menu, but
only for users with 'Administer Queues' - for other users they would only see
their own imports, so it would duplicate 'my imports'.

This is useful for site admins etc trying to understand issues their users might be having
with imports.

Note the extension needs to be enabled
  • Loading branch information
eileenmcnaughton committed Jun 12, 2023
1 parent f113935 commit 5b6def1
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 1 deletion.
74 changes: 73 additions & 1 deletion ext/civiimport/Managed/UserJobSearches.mgd.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
'params' => [
'version' => 4,
'values' => [
'name' => 'Imports',
'name' => 'all_imports',
'label' => 'Imports',
'form_values' => NULL,
'mapping_id' => NULL,
Expand Down Expand Up @@ -211,4 +211,76 @@
],
],
],
[
'name' => 'SavedSearch_Import_Templates_SearchDisplay_AllImports',
'entity' => 'SearchDisplay',
'cleanup' => 'always',
'update' => 'unmodified',
'params' => [
'version' => 4,
'values' => [
'name' => 'all_imports',
'label' => E::ts('All Imports'),
'saved_search_id.name' => 'all_imports',
'type' => 'table',
'settings' => [
'description' => E::ts('All import jobs'),
'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/import/contribution?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,
],
],
],
];
3 changes: 3 additions & 0 deletions ext/civiimport/ang/afsearchAllImports.aff.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div af-fieldset="">
<crm-search-display-table search-name="all_imports" display-name="all_imports"></crm-search-display-table>
</div>
23 changes: 23 additions & 0 deletions ext/civiimport/ang/afsearchAllImports.aff.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "search",
"requires": [],
"entity_type": null,
"join_entity": null,
"title": "All Imports",
"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/all-imports",
"permission": "administer queues",
"redirect": null,
"create_submission": false,
"navigation": {
"parent": "Reports",
"label": "All imports",
"weight": 17
}
}

0 comments on commit 5b6def1

Please sign in to comment.