From 3cb3f33dbe4aa9a1f0d92879a162da02a636566d Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Tue, 18 Jul 2023 11:27:19 +0100 Subject: [PATCH] Add Summary section Add 'Experimental' top-level menu Add menu item for 'Find Contributions' under 'Experimental' --- .../ang/afsearchFindContributions.aff.html | 4 + .../ang/afsearchFindContributions.aff.json | 10 +- .../managed/Navigation_Experimental.mgd.php | 33 ++++ ...edSearch_Find_contributions_totals.mgd.php | 141 ++++++++++++++++++ 4 files changed, 185 insertions(+), 3 deletions(-) create mode 100644 ext/civicrm_search_ui/managed/Navigation_Experimental.mgd.php create mode 100644 ext/civicrm_search_ui/managed/SavedSearch_Find_contributions_totals.mgd.php diff --git a/ext/civicrm_search_ui/ang/afsearchFindContributions.aff.html b/ext/civicrm_search_ui/ang/afsearchFindContributions.aff.html index dac698a11b..de6d529e26 100644 --- a/ext/civicrm_search_ui/ang/afsearchFindContributions.aff.html +++ b/ext/civicrm_search_ui/ang/afsearchFindContributions.aff.html @@ -1,4 +1,5 @@
+

This is intended as a replacement for the Find Contributions page.  Please provide feedback at https://lab.civicrm.org/dev/core/-/issues/3912

@@ -40,5 +41,8 @@
+
+ +
diff --git a/ext/civicrm_search_ui/ang/afsearchFindContributions.aff.json b/ext/civicrm_search_ui/ang/afsearchFindContributions.aff.json index e7cbe6257e..f5dbd9da55 100644 --- a/ext/civicrm_search_ui/ang/afsearchFindContributions.aff.json +++ b/ext/civicrm_search_ui/ang/afsearchFindContributions.aff.json @@ -10,10 +10,14 @@ "is_token": false, "contact_summary": null, "summary_contact_type": null, - "icon": "fa-list-alt", + "icon": "fa-credit-card", "server_route": "civicrm/sk/contrib", - "permission": "access CiviCRM", + "permission": "access CiviContribute", "redirect": null, "create_submission": false, - "navigation": null + "navigation": { + "parent": "Experimental", + "label": "Find Contributions", + "weight": 0 + } } diff --git a/ext/civicrm_search_ui/managed/Navigation_Experimental.mgd.php b/ext/civicrm_search_ui/managed/Navigation_Experimental.mgd.php new file mode 100644 index 0000000000..94a6191f3b --- /dev/null +++ b/ext/civicrm_search_ui/managed/Navigation_Experimental.mgd.php @@ -0,0 +1,33 @@ + 'Navigation_Experimental', + 'entity' => 'Navigation', + 'cleanup' => 'unused', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'domain_id' => 'current_domain', + 'label' => E::ts('Experimental'), + 'name' => 'Experimental', + 'url' => NULL, + 'icon' => 'crm-i fa-flask', + 'permission' => [ + 'access CiviCRM', + ], + 'permission_operator' => 'AND', + 'parent_id' => NULL, + 'is_active' => TRUE, + 'has_separator' => 0, + 'weight' => 113, + ], + 'match' => [ + 'name', + ], + ], + ], +]; diff --git a/ext/civicrm_search_ui/managed/SavedSearch_Find_contributions_totals.mgd.php b/ext/civicrm_search_ui/managed/SavedSearch_Find_contributions_totals.mgd.php new file mode 100644 index 0000000000..675dc65a1b --- /dev/null +++ b/ext/civicrm_search_ui/managed/SavedSearch_Find_contributions_totals.mgd.php @@ -0,0 +1,141 @@ + 'SavedSearch_Find_Contributions_totals', + 'entity' => 'SavedSearch', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Find_Contributions_totals', + 'label' => E::ts('Find Contributions - totals'), + 'form_values' => NULL, + 'mapping_id' => NULL, + 'search_custom_id' => NULL, + 'api_entity' => 'Contribution', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'GROUP_CONCAT(DISTINCT Contribution_Contact_contact_id_01.display_name) AS GROUP_CONCAT_Contribution_Contact_contact_id_01_display_name', + 'SUM(total_amount) AS SUM_total_amount', + 'GROUP_CONCAT(DISTINCT financial_type_id:label) AS GROUP_CONCAT_financial_type_id_label', + 'GROUP_CONCAT(DISTINCT source) AS GROUP_CONCAT_source', + 'GROUP_CONCAT(DISTINCT receive_date) AS GROUP_CONCAT_receive_date', + 'GROUP_CONCAT(DISTINCT thankyou_date) AS GROUP_CONCAT_thankyou_date', + 'GROUP_CONCAT(DISTINCT contribution_status_id:label) AS GROUP_CONCAT_contribution_status_id_label', + 'GROUP_CONCAT(DISTINCT receipt_date) AS GROUP_CONCAT_receipt_date', + 'GROUP_CONCAT(DISTINCT contribution_recur_id) AS GROUP_CONCAT_contribution_recur_id', + 'COUNT(id) AS COUNT_id', + 'currency:label', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => [ + 'currency', + ], + 'join' => [ + [ + 'Contact AS Contribution_Contact_contact_id_01', + 'INNER', + [ + 'contact_id', + '=', + 'Contribution_Contact_contact_id_01.id', + ], + ], + [ + 'ContributionSoft AS Contribution_ContributionSoft_contribution_id_01', + 'LEFT', + [ + 'id', + '=', + 'Contribution_ContributionSoft_contribution_id_01.contribution_id', + ], + ], + [ + 'PCP AS Contribution_ContributionSoft_contribution_id_01_ContributionSoft_PCP_pcp_id_01', + 'LEFT', + [ + 'Contribution_ContributionSoft_contribution_id_01.pcp_id', + '=', + 'Contribution_ContributionSoft_contribution_id_01_ContributionSoft_PCP_pcp_id_01.id', + ], + ], + ], + 'having' => [], + ], + 'expires_date' => NULL, + 'description' => NULL, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'SavedSearch_Find_Contributions_totals_SearchDisplay_Find_Contributions_totals_Table_1', + 'entity' => 'SearchDisplay', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Find_Contributions_totals_Table_1', + 'label' => E::ts('Find Contributions - totals Table 1'), + 'saved_search_id.name' => 'Find_Contributions_totals', + 'type' => 'table', + 'settings' => [ + 'description' => NULL, + 'sort' => [ + [ + 'SUM_total_amount', + 'DESC', + ], + ], + 'limit' => 50, + 'pager' => [ + 'hide_single' => TRUE, + ], + 'placeholder' => 5, + 'columns' => [ + [ + 'type' => 'field', + 'key' => 'currency:label', + 'dataType' => 'String', + 'label' => E::ts('Currency'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'SUM_total_amount', + 'dataType' => 'Money', + 'label' => E::ts('Total Amount'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'COUNT_id', + 'dataType' => 'Integer', + 'label' => E::ts('Number of contributions'), + 'sortable' => TRUE, + ], + ], + 'actions' => FALSE, + 'classes' => [ + 'table', + 'table-striped', + ], + ], + 'acl_bypass' => FALSE, + ], + 'match' => [ + 'name', + 'saved_search_id', + ], + ], + ], +]; -- 2.25.1