Skip to content

Commit

Permalink
Merge pull request #26617 from seamuslee001/acl_urls
Browse files Browse the repository at this point in the history
Add in paths and new menu routes to support converting ACL page scree…
  • Loading branch information
colemanw authored Jun 23, 2023
2 parents 6e34b32 + 879766b commit 6f26ec5
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
13 changes: 12 additions & 1 deletion CRM/ACL/DAO/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/ACL/ACL.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:9d50ed80344474830f87df285dc6cbf2)
* (GenCodeChecksum:689e7e5f58bb2cc9959817ecbbd3beeb)
*/

/**
Expand All @@ -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
*
Expand Down
7 changes: 7 additions & 0 deletions CRM/ACL/Form/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,11 @@ public function postProcess() {
}
}

/**
* Explicitly declare the entity api name.
*/
public function getDefaultEntity() {
return 'ACL';
}

}
4 changes: 2 additions & 2 deletions CRM/ACL/Page/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function &links() {
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'),
],
Expand All @@ -64,7 +64,7 @@ public function &links() {
],
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,
Expand Down
12 changes: 12 additions & 0 deletions CRM/Core/xml/Menu/Misc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
<page_callback>CRM_ACL_Page_ACL</page_callback>
<access_arguments>administer CiviCRM,access CiviCRM</access_arguments>
</item>
<item>
<path>civicrm/acl/edit</path>
<title>Manage ACLs</title>
<page_callback>CRM_ACL_Form_ACL</page_callback>
<access_arguments>administer CiviCRM,access CiviCRM</access_arguments>
</item>
<item>
<path>civicrm/acl/delete</path>
<title>Manage ACLs</title>
<page_callback>CRM_ACL_Form_ACL</page_callback>
<access_arguments>administer CiviCRM,access CiviCRM</access_arguments>
</item>
<item>
<path>civicrm/acl/entityrole</path>
<title>Assign Users to ACL Roles</title>
Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/ACL/Page/ACL.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

{if $action ne 1 and $action ne 2}
<div class="action-link">
{crmButton q="action=add&reset=1" id="newACL" icon="plus-circle"}{ts}Add ACL{/ts}{/crmButton}
{crmButton p="civicrm/acl/edit" q="action=add&reset=1" id="newACL" icon="plus-circle"}{ts}Add ACL{/ts}{/crmButton}
</div>
{/if}
</div>
Expand Down
5 changes: 5 additions & 0 deletions xml/schema/ACL/ACL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<name>civicrm_acl</name>
<comment>Access Control List</comment>
<add>1.6</add>
<paths>
<add>civicrm/acl/edit?reset=1&amp;action=add</add>
<delete>civicrm/acl/delete?reset=1&amp;action=delete&amp;id=[id]</delete>
<update>civicrm/acl/edit?reset=1&amp;action=edit&amp;id=[id]</update>
</paths>
<field>
<name>id</name>
<title>ACL ID</title>
Expand Down

0 comments on commit 6f26ec5

Please sign in to comment.