From 95a727ffab976c46599cccd7bd0cf3fbef469084 Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Thu, 6 Jul 2023 07:55:34 +0100 Subject: [PATCH] First attempt at Find Contributions replacement --- .../ang/afsearchFindContributions.aff.html | 45 ++++ .../ang/afsearchFindContributions.aff.json | 19 ++ .../SavedSearch_Find_Contributions.mgd.php | 242 ++++++++++++++++++ 3 files changed, 306 insertions(+) create mode 100644 ext/civicrm_admin_ui/ang/afsearchFindContributions.aff.html create mode 100644 ext/civicrm_admin_ui/ang/afsearchFindContributions.aff.json create mode 100644 ext/civicrm_admin_ui/managed/SavedSearch_Find_Contributions.mgd.php diff --git a/ext/civicrm_admin_ui/ang/afsearchFindContributions.aff.html b/ext/civicrm_admin_ui/ang/afsearchFindContributions.aff.html new file mode 100644 index 0000000000..6bdd2705d8 --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchFindContributions.aff.html @@ -0,0 +1,45 @@ +
+
+ + + + + +
+
+ + + + + + + + +
+
+ Dev note: these should all be Yes/No radios.  See https://lab.civicrm.org/dev/core/-/issues/4415 + + + + + + +
+
+ + + + + +
+
+ Dev note:  several options currently - need to understand soft credits better!   + +
+
+ Dev note: want this as page name select.   Does anyone use PCP's??? + + +
+ +
diff --git a/ext/civicrm_admin_ui/ang/afsearchFindContributions.aff.json b/ext/civicrm_admin_ui/ang/afsearchFindContributions.aff.json new file mode 100644 index 0000000000..e7cbe6257e --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchFindContributions.aff.json @@ -0,0 +1,19 @@ +{ + "type": "search", + "requires": [], + "entity_type": null, + "join_entity": null, + "title": "Find Contributions", + "description": "The original searches for Contributions but also can show just soft credits and recurring contributions. Maybe recur is better as a separate search? And soft credits?", + "is_dashlet": false, + "is_public": false, + "is_token": false, + "contact_summary": null, + "summary_contact_type": null, + "icon": "fa-list-alt", + "server_route": "civicrm/sk/contrib", + "permission": "access CiviCRM", + "redirect": null, + "create_submission": false, + "navigation": null +} diff --git a/ext/civicrm_admin_ui/managed/SavedSearch_Find_Contributions.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_Find_Contributions.mgd.php new file mode 100644 index 0000000000..d080bb850a --- /dev/null +++ b/ext/civicrm_admin_ui/managed/SavedSearch_Find_Contributions.mgd.php @@ -0,0 +1,242 @@ + 'SavedSearch_Find_Contributions_2', + 'entity' => 'SavedSearch', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Find_Contributions_2', + 'label' => E::ts('Find Contributions'), + 'form_values' => NULL, + 'mapping_id' => NULL, + 'search_custom_id' => NULL, + 'api_entity' => 'Contribution', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'Contribution_Contact_contact_id_01.display_name', + 'total_amount', + 'financial_type_id:label', + 'source', + 'receive_date', + 'thankyou_date', + 'contribution_status_id:label', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => [], + '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_2_SearchDisplay_Find_Contributions_Table_1', + 'entity' => 'SearchDisplay', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Find_Contributions_Table_1', + 'label' => E::ts('Find Contributions Table 1'), + 'saved_search_id.name' => 'Find_Contributions_2', + 'type' => 'table', + 'settings' => [ + 'description' => NULL, + 'sort' => [], + 'limit' => 50, + 'pager' => [], + 'placeholder' => 5, + 'columns' => [ + [ + 'type' => 'field', + 'key' => 'Contribution_Contact_contact_id_01.display_name', + 'dataType' => 'String', + 'label' => E::ts('Name'), + 'sortable' => TRUE, + 'link' => [ + 'path' => '', + 'entity' => 'Contact', + 'action' => 'view', + 'join' => 'Contribution_Contact_contact_id_01', + 'target' => '_blank', + ], + 'title' => E::ts('View Contact'), + 'icons' => [ + [ + 'field' => 'Contribution_Contact_contact_id_01.contact_type:icon', + 'side' => 'left', + ], + ], + ], + [ + 'type' => 'field', + 'key' => 'total_amount', + 'dataType' => 'Money', + 'label' => E::ts('Amount'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'financial_type_id:label', + 'dataType' => 'Integer', + 'label' => E::ts('Type'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'source', + 'dataType' => 'String', + 'label' => E::ts('Contribution Source'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'receive_date', + 'dataType' => 'Timestamp', + 'label' => E::ts('Contribution Date'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'thankyou_date', + 'dataType' => 'Timestamp', + 'label' => E::ts('Thank-you Sent'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'contribution_status_id:label', + 'dataType' => 'Integer', + 'label' => E::ts('Status'), + 'sortable' => TRUE, + ], + [ + 'size' => 'btn-xs', + 'links' => [ + [ + 'entity' => 'Contribution', + 'action' => 'view', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-external-link', + 'text' => E::ts('View'), + 'style' => 'default', + 'path' => '', + 'condition' => [], + ], + [ + 'entity' => 'Contribution', + 'action' => 'update', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-pencil', + 'text' => E::ts('Update'), + 'style' => 'default', + 'path' => '', + 'condition' => [], + ], + ], + 'type' => 'buttons', + 'alignment' => 'text-right', + ], + [ + 'text' => '', + 'style' => 'default', + 'size' => 'btn-xs', + 'icon' => 'fa-bars', + 'links' => [ + [ + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + 'icon' => 'fa-external-link', + 'text' => E::ts('Send Letter'), + 'style' => 'default', + 'path' => 'civicrm/contribute/task?reset=1&task_item=letter&id=[id]', + 'condition' => [], + ], + [ + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + 'icon' => 'fa-external-link', + 'text' => E::ts('Send Receipt'), + 'style' => 'default', + 'path' => 'civicrm/contribute/task?reset=1&task_item=receipt&id=[id]', + 'condition' => [], + ], + [ + 'entity' => 'Contribution', + 'action' => 'delete', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-trash', + 'text' => E::ts('Delete'), + 'style' => 'danger', + 'path' => '', + 'condition' => [], + ], + ], + 'type' => 'menu', + 'alignment' => 'text-right', + ], + ], + 'actions' => TRUE, + 'classes' => [ + 'table', + 'table-striped', + ], + ], + 'acl_bypass' => FALSE, + ], + 'match' => [ + 'name', + 'saved_search_id', + ], + ], + ], +]; -- 2.25.1