From: Coleman Watts Date: Sat, 21 Dec 2013 00:19:29 +0000 (-0800) Subject: CRM-14015 CRM-14023 - Extend enable/disable to acl entityRole page (and add aclRole... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=663072a5cf4df8443935e0ddb83aa849202881e6;p=civicrm-core.git CRM-14015 CRM-14023 - Extend enable/disable to acl entityRole page (and add aclRole api) --- diff --git a/CRM/ACL/BAO/EntityRole.php b/CRM/ACL/BAO/EntityRole.php index cb041cee78..173ba7d7ed 100644 --- a/CRM/ACL/BAO/EntityRole.php +++ b/CRM/ACL/BAO/EntityRole.php @@ -52,8 +52,8 @@ class CRM_ACL_BAO_EntityRole extends CRM_ACL_DAO_EntityRole { static function create(&$params) { $dao = new CRM_ACL_DAO_EntityRole(); $dao->copyValues($params); - $dao->save(); + return $dao; } static function retrieve(&$params, &$defaults) { diff --git a/CRM/ACL/Page/EntityRole.php b/CRM/ACL/Page/EntityRole.php index c3c5456e21..d91c6a19b4 100644 --- a/CRM/ACL/Page/EntityRole.php +++ b/CRM/ACL/Page/EntityRole.php @@ -75,14 +75,12 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic { ), CRM_Core_Action::DISABLE => array( 'name' => ts('Disable'), - 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_ACL_BAO_EntityRole' . '\',\'' . 'enable-disable' . '\' );"', - 'ref' => 'disable-action', + 'ref' => 'crm-enable-disable', 'title' => ts('Disable ACL Role Assignment'), ), CRM_Core_Action::ENABLE => array( 'name' => ts('Enable'), - 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_ACL_BAO_EntityRole' . '\',\'' . 'disable-enable' . '\' );"', - 'ref' => 'enable-action', + 'ref' => 'crm-enable-disable', 'title' => ts('Enable ACL Role Assignment'), ), CRM_Core_Action::DELETE => array( @@ -141,6 +139,7 @@ class CRM_ACL_Page_EntityRole extends CRM_Core_Page_Basic { // finally browse the acl's if ($action & CRM_Core_Action::BROWSE) { + CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js'); $this->browse(); } diff --git a/api/v3/AclRole.php b/api/v3/AclRole.php new file mode 100644 index 0000000000..25d10dab97 --- /dev/null +++ b/api/v3/AclRole.php @@ -0,0 +1,77 @@ + {strip} {* handle enable/disable actions*} - {include file="CRM/common/enableDisable.tpl"} + {include file="CRM/common/enableDisableApi.tpl"} {include file="CRM/common/jsortable.tpl"} @@ -54,7 +54,7 @@ {foreach from=$rows item=row} - +
{$row.acl_role} {$row.entity} {if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}