static function create(&$params) {
$dao = new CRM_ACL_DAO_EntityRole();
$dao->copyValues($params);
-
$dao->save();
+ return $dao;
}
static function retrieve(&$params, &$defaults) {
),
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(
// finally browse the acl's
if ($action & CRM_Core_Action::BROWSE) {
+ CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
$this->browse();
}
--- /dev/null
+<?php
+
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.4 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2013 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License and the CiviCRM Licensing Exception along |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+*/
+
+/**
+ * File for the CiviCRM APIv3 acl_role functions
+ *
+ * @package CiviCRM_APIv3
+ * @subpackage API_acl_role
+ *
+ */
+
+/**
+ * Save an acl_role
+ *
+ * Allowed @params array keys are:
+ * {@getfields acl_role_create}
+ * @example acl_roleCreate.php
+ *
+ * @return array of newly created acl_role property values.
+ * @access public
+ */
+function civicrm_api3_acl_role_create($params) {
+ return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+}
+
+/**
+ * Get an acl_role
+ *
+ * Allowed @params array keys are:
+ * {@getfields acl_role_get}
+ * @example acl_roleCreate.php
+ *
+ * @return array of retrieved acl_role property values.
+ * @access public
+ */
+function civicrm_api3_acl_role_get($params) {
+ return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+}
+
+/**
+ * Delete an acl_role
+ *
+ * Allowed @params array keys are:
+ * {@getfields acl_role_delete}
+ * @example acl_roleCreate.php
+ *
+ * @return array of deleted values.
+ * @access public
+ */
+function civicrm_api3_acl_role_delete($params) {
+ return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+}
// len ('civicrm_api3_') == 13
$name = substr($name, 13, $last - 13);
}
+
+ $name = _civicrm_api_get_camel_name($name, 3);
- if (strtolower($name) == 'individual' || strtolower($name) == 'household' || strtolower($name) == 'organization') {
+ if ($name == 'Individual' || $name == 'Household' || $name == 'Organization') {
$name = 'Contact';
}
//hack to deal with incorrectly named BAO/DAO - see CRM-10859 -
// several of these have been removed but am not confident mailing_recipients is
// tests so have not tackled.
- if($name == 'mailing_recipients' || $name == 'MailingRecipients'){
+ if ($name == 'MailingRecipients') {
return 'CRM_Mailing_BAO_Recipients';
}
+ if ($name == 'AclRole') {
+ return 'CRM_ACL_DAO_EntityRole';
+ }
// correct approach for im & acl is unclear
- if (strtolower($name) == 'im' || strtolower($name) == 'acl') {
+ if ($name == 'Im' || $name == 'Acl') {
$name = strtoupper($name);
}
- return CRM_Core_DAO_AllCoreTables::getFullName(_civicrm_api_get_camel_name($name, 3));
+ return CRM_Core_DAO_AllCoreTables::getFullName($name);
}
/**
<div id="ltype">
{strip}
{* handle enable/disable actions*}
- {include file="CRM/common/enableDisable.tpl"}
+ {include file="CRM/common/enableDisableApi.tpl"}
{include file="CRM/common/jsortable.tpl"}
<table id="options" class="display">
<thead>
</thead>
<tbody>
{foreach from=$rows item=row}
- <tr id="row_{$row.id}"class="{cycle values="odd-row,even-row"} {$row.class} crm-acl_entity_role {if NOT $row.is_active} disabled{/if}">
+ <tr id="acl_role-{$row.id}" class="{cycle values="odd-row,even-row"} {$row.class} crm-acl_entity_role crm-entity {if NOT $row.is_active} disabled{/if}">
<td class="crm-acl_entity_role-acl_role">{$row.acl_role}</td>
<td class="crm-acl_entity_role-entity">{$row.entity}</td>
<td class="crm-acl_entity_role-is_active" id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>