From 879766b134338a4800d1b511edd2d0b049e19a94 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 23 Jun 2023 15:13:05 +1000 Subject: [PATCH] Add in paths and new menu routes to support converting ACL page screen to search kit --- CRM/ACL/DAO/ACL.php | 13 ++++++++++++- CRM/ACL/Form/ACL.php | 7 +++++++ CRM/ACL/Page/ACL.php | 4 ++-- CRM/Core/xml/Menu/Misc.xml | 12 ++++++++++++ templates/CRM/ACL/Page/ACL.tpl | 2 +- xml/schema/ACL/ACL.xml | 5 +++++ 6 files changed, 39 insertions(+), 4 deletions(-) diff --git a/CRM/ACL/DAO/ACL.php b/CRM/ACL/DAO/ACL.php index 4abc03ab4c..9683d71d3c 100644 --- a/CRM/ACL/DAO/ACL.php +++ b/CRM/ACL/DAO/ACL.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/ACL/ACL.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:9d50ed80344474830f87df285dc6cbf2) + * (GenCodeChecksum:689e7e5f58bb2cc9959817ecbbd3beeb) */ /** @@ -30,6 +30,17 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO { */ public static $_log = FALSE; + /** + * Paths for accessing this entity in the UI. + * + * @var string[] + */ + protected static $_paths = [ + 'add' => 'civicrm/acl/edit?reset=1&action=add', + 'delete' => 'civicrm/acl/delete?reset=1&action=delete&id=[id]', + 'update' => 'civicrm/acl/edit?reset=1&action=edit&id=[id]', + ]; + /** * Unique table ID * diff --git a/CRM/ACL/Form/ACL.php b/CRM/ACL/Form/ACL.php index a86ebb1fcb..4a42798476 100644 --- a/CRM/ACL/Form/ACL.php +++ b/CRM/ACL/Form/ACL.php @@ -294,4 +294,11 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form { } } + /** + * Explicitly declare the entity api name. + */ + public function getDefaultEntity() { + return 'ACL'; + } + } diff --git a/CRM/ACL/Page/ACL.php b/CRM/ACL/Page/ACL.php index 9aea585919..826b9c6190 100644 --- a/CRM/ACL/Page/ACL.php +++ b/CRM/ACL/Page/ACL.php @@ -46,7 +46,7 @@ class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic { self::$_links = [ CRM_Core_Action::UPDATE => [ 'name' => ts('Edit'), - 'url' => 'civicrm/acl', + 'url' => 'civicrm/acl/edit', 'qs' => 'reset=1&action=update&id=%%id%%', 'title' => ts('Edit ACL'), ], @@ -64,7 +64,7 @@ class CRM_ACL_Page_ACL extends CRM_Core_Page_Basic { ], CRM_Core_Action::DELETE => [ 'name' => ts('Delete'), - 'url' => 'civicrm/acl', + 'url' => 'civicrm/acl/delete', 'qs' => 'reset=1&action=delete&id=%%id%%', 'title' => ts('Delete ACL'), 'weight' => 100, diff --git a/CRM/Core/xml/Menu/Misc.xml b/CRM/Core/xml/Menu/Misc.xml index 34c93bf27a..5aad20becc 100644 --- a/CRM/Core/xml/Menu/Misc.xml +++ b/CRM/Core/xml/Menu/Misc.xml @@ -34,6 +34,18 @@ CRM_ACL_Page_ACL administer CiviCRM,access CiviCRM + + civicrm/acl/edit + Manage ACLs + CRM_ACL_Form_ACL + administer CiviCRM,access CiviCRM + + + civicrm/acl/delete + Manage ACLs + CRM_ACL_Form_ACL + administer CiviCRM,access CiviCRM + civicrm/acl/entityrole Assign Users to ACL Roles diff --git a/templates/CRM/ACL/Page/ACL.tpl b/templates/CRM/ACL/Page/ACL.tpl index c867e1457e..c00c3e49d5 100644 --- a/templates/CRM/ACL/Page/ACL.tpl +++ b/templates/CRM/ACL/Page/ACL.tpl @@ -55,7 +55,7 @@ {if $action ne 1 and $action ne 2} {/if} diff --git a/xml/schema/ACL/ACL.xml b/xml/schema/ACL/ACL.xml index d7a71d63be..b054c68777 100644 --- a/xml/schema/ACL/ACL.xml +++ b/xml/schema/ACL/ACL.xml @@ -6,6 +6,11 @@ civicrm_acl Access Control List 1.6 + + civicrm/acl/edit?reset=1&action=add + civicrm/acl/delete?reset=1&action=delete&id=[id] + civicrm/acl/edit?reset=1&action=edit&id=[id] + id ACL ID -- 2.25.1