Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in paths and new menu routes to support converting ACL page scree… #26617

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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