From 5e897663d15ab7b4d969c5d7b3dea4eb89ca5366 Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Tue, 8 Nov 2022 22:40:58 +0000 Subject: [PATCH] AdminUI: add Manage Contribution Pages --- CRM/Contribute/DAO/ContributionPage.php | 14 ++ .../afsearchManageContributionPages.aff.html | 20 ++ .../afsearchManageContributionPages.aff.json | 19 ++ ...edSearch_Manage_Contribution_Pages.mgd.php | 231 ++++++++++++++++++ xml/schema/Contribute/ContributionPage.xml | 8 + 5 files changed, 292 insertions(+) create mode 100644 ext/civicrm_admin_ui/ang/afsearchManageContributionPages.aff.html create mode 100644 ext/civicrm_admin_ui/ang/afsearchManageContributionPages.aff.json create mode 100644 ext/civicrm_admin_ui/managed/SavedSearch_Manage_Contribution_Pages.mgd.php diff --git a/CRM/Contribute/DAO/ContributionPage.php b/CRM/Contribute/DAO/ContributionPage.php index c3744c8dfe..e7ed82d1c7 100644 --- a/CRM/Contribute/DAO/ContributionPage.php +++ b/CRM/Contribute/DAO/ContributionPage.php @@ -38,6 +38,17 @@ class CRM_Contribute_DAO_ContributionPage extends CRM_Core_DAO { */ public static $_log = TRUE; + /** + * Paths for accessing this entity in the UI. + * + * @var string[] + */ + protected static $_paths = [ + 'add' => 'civicrm/admin/contribute/add?reset=1&action=add', + 'update' => 'civicrm/admin/contribute/settings?reset=1&action=update&id=[id]', + 'delete' => 'civicrm/admin/contribute?reset=1&action=delete&id=[id]', + ]; + /** * Contribution ID * @@ -536,6 +547,9 @@ class CRM_Contribute_DAO_ContributionPage extends CRM_Core_DAO { 'entity' => 'ContributionPage', 'bao' => 'CRM_Contribute_BAO_ContributionPage', 'localizable' => 1, + 'html' => [ + 'type' => 'Text', + ], 'add' => '1.3', ], 'intro_text' => [ diff --git a/ext/civicrm_admin_ui/ang/afsearchManageContributionPages.aff.html b/ext/civicrm_admin_ui/ang/afsearchManageContributionPages.aff.html new file mode 100644 index 0000000000..7c8cde1dcc --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchManageContributionPages.aff.html @@ -0,0 +1,20 @@ +
+
{{:: ts('CiviContribute allows you to create and maintain any number of Online Contribution Pages. You can create different pages for different programs or campaigns, and you can customize text, amounts, types of information collected from contributors, etc.') }}
+
+
+
+ + +
+ + +
diff --git a/ext/civicrm_admin_ui/ang/afsearchManageContributionPages.aff.json b/ext/civicrm_admin_ui/ang/afsearchManageContributionPages.aff.json new file mode 100644 index 0000000000..06408ef48c --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchManageContributionPages.aff.json @@ -0,0 +1,19 @@ +{ + "type": "search", + "requires": [], + "entity_type": null, + "join_entity": null, + "title": "Manage Contribution Pages", + "description": "", + "is_dashlet": false, + "is_public": false, + "is_token": false, + "contact_summary": null, + "summary_contact_type": null, + "icon": "fa-list-alt", + "server_route": "civicrm/admin/contribute", + "permission": "access CiviContribute", + "redirect": null, + "create_submission": false, + "navigation": null +} diff --git a/ext/civicrm_admin_ui/managed/SavedSearch_Manage_Contribution_Pages.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_Manage_Contribution_Pages.mgd.php new file mode 100644 index 0000000000..87a6f7a581 --- /dev/null +++ b/ext/civicrm_admin_ui/managed/SavedSearch_Manage_Contribution_Pages.mgd.php @@ -0,0 +1,231 @@ + 'SavedSearch_Manage_Contribution_Pages', + 'entity' => 'SavedSearch', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Manage_Contribution_Pages', + 'label' => E::ts('Manage Contribution Pages'), + 'form_values' => NULL, + 'mapping_id' => NULL, + 'search_custom_id' => NULL, + 'api_entity' => 'ContributionPage', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'title', + 'id', + 'is_active', + 'financial_type_id:label', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => [], + 'join' => [], + 'having' => [], + ], + 'expires_date' => NULL, + 'description' => NULL, + ], + ], + ], + [ + 'name' => 'SavedSearch_Manage_Contribution_Pages_SearchDisplay_Manage_Contribution_Pages_Table_1', + 'entity' => 'SearchDisplay', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Manage_Contribution_Pages_Table_1', + 'label' => E::ts('Manage Contribution Pages Table 1'), + 'saved_search_id.name' => 'Manage_Contribution_Pages', + 'type' => 'table', + 'settings' => [ + 'actions' => FALSE, + 'limit' => 50, + 'classes' => [ + 'table', + 'table-striped', + ], + 'pager' => [ + 'show_count' => TRUE, + 'expose_limit' => TRUE, + ], + 'placeholder' => 5, + 'sort' => [ + [ + 'is_active', + 'DESC', + ], + [ + 'title', + 'ASC', + ], + ], + 'columns' => [ + [ + 'type' => 'field', + 'key' => 'title', + 'dataType' => 'String', + 'label' => E::ts('Title'), + 'sortable' => TRUE, + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + ], + [ + 'type' => 'field', + 'key' => 'id', + 'dataType' => 'Integer', + 'label' => E::ts('ID'), + 'sortable' => TRUE, + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + ], + [ + 'type' => 'field', + 'key' => 'is_active', + 'dataType' => 'Boolean', + 'label' => E::ts('Enabled?'), + 'sortable' => TRUE, + 'editable' => TRUE, + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + ], + [ + 'type' => 'field', + 'key' => 'financial_type_id:label', + 'dataType' => 'Integer', + 'label' => E::ts('Financial Type'), + 'sortable' => TRUE, + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + ], + [ + 'text' => E::ts('Links'), + 'style' => 'default', + 'size' => 'btn-sm', + 'icon' => 'fa-link', + 'links' => [ + [ + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + 'icon' => 'fa-external-link', + 'text' => E::ts('Live Page'), + 'style' => 'default', + 'path' => 'civicrm/contribute/transact?reset=1&id=[id]', + 'condition' => [], + ], + [ + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + 'icon' => 'fa-external-link', + 'text' => E::ts('Test-drive'), + 'style' => 'default', + 'path' => 'civicrm/contribute/transact?reset=1&id=[id]&action=preview', + 'condition' => [], + ], + ], + 'type' => 'menu', + 'alignment' => 'text-right', + ], + [ + 'size' => 'btn-xs', + 'links' => [ + [ + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + 'icon' => 'fa-search', + 'text' => E::ts('Find Contributions'), + 'style' => 'default', + 'path' => 'civicrm/contribute/search?contribution_page_id=[id]&force=1&reset=1', + 'condition' => [], + ], + ], + 'type' => 'buttons', + 'alignment' => 'text-right', + ], + [ + 'size' => 'btn-xs', + 'links' => [ + [ + 'entity' => 'ContributionPage', + 'action' => 'update', + 'join' => '', + 'target' => '', + 'icon' => 'fa-pencil', + 'text' => E::ts('Edit'), + 'style' => 'default', + 'path' => '', + 'condition' => [], + ], + [ + 'path' => 'civicrm/admin/contribute?action=copy&gid=[id]', + 'icon' => 'fa-clone', + 'text' => E::ts('Clone'), + 'style' => 'secondary', + 'condition' => [], + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + ], + [ + 'entity' => 'ContributionPage', + 'action' => 'delete', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-trash', + 'text' => E::ts('Delete'), + 'style' => 'danger', + 'path' => '', + 'condition' => [], + ], + ], + 'type' => 'buttons', + 'alignment' => 'text-right', + ], + ], + 'button' => NULL, + ], + 'acl_bypass' => FALSE, + ], + ], + ], +]; diff --git a/xml/schema/Contribute/ContributionPage.xml b/xml/schema/Contribute/ContributionPage.xml index 41580a76fa..56519fefbc 100644 --- a/xml/schema/Contribute/ContributionPage.xml +++ b/xml/schema/Contribute/ContributionPage.xml @@ -9,6 +9,11 @@ true CiviContribute title + + civicrm/admin/contribute/add?reset=1&action=add + civicrm/admin/contribute/settings?reset=1&action=update&id=[id] + civicrm/admin/contribute?reset=1&action=delete&id=[id] + id Contribution Page ID @@ -32,6 +37,9 @@ true Contribution Page title. For top of page display 1.3 + + Text + intro_text -- 2.25.1