Skip to content

Commit

Permalink
Add in paths and new menu routes to support converting ACL page scree…
Browse files Browse the repository at this point in the history
…n to search kit
  • Loading branch information
seamuslee001 committed Jun 23, 2023
1 parent da5fc82 commit add0cc9
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 5 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
4 changes: 2 additions & 2 deletions templates/CRM/ACL/Page/ACL.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
</table>
{/strip}

{if $action ne 1 and $action ne 2}
{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 add0cc9

Please sign in to comment.