+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
*/
class CRM_ACL_Form_ACL extends CRM_Admin_Form {
$this->add('text', 'name', ts('Description'), CRM_Core_DAO::getAttribute('CRM_ACL_DAO_ACL', 'name'), TRUE);
- $operations = array('' => ts('- select -')) + CRM_ACL_BAO_ACL::operation();
+ $operations = ['' => ts('- select -')] + CRM_ACL_BAO_ACL::operation();
$this->add('select',
'operation',
ts('Operation'),
$operations, TRUE
);
- $objTypes = array(
+ $objTypes = [
'1' => ts('A group of contacts'),
'2' => ts('A profile'),
'3' => ts('A set of custom data fields'),
- );
+ ];
if (CRM_Core_Permission::access('CiviEvent')) {
$objTypes['4'] = ts('Events');
}
- $extra = array('onclick' => "showObjectSelect();");
+ $extra = ['onclick' => "showObjectSelect();"];
$this->addRadio('object_type',
ts('Type of Data'),
$objTypes,
);
$label = ts('Role');
- $role = array(
+ $role = [
'-1' => ts('- select role -'),
'0' => ts('Everyone'),
- ) + CRM_Core_OptionGroup::values('acl_role');
+ ] + CRM_Core_OptionGroup::values('acl_role');
$this->add('select', 'entity_id', $label, $role, TRUE);
- $group = array(
+ $group = [
'-1' => ts('- select -'),
'0' => ts('All Groups'),
- ) + CRM_Core_PseudoConstant::group();
+ ] + CRM_Core_PseudoConstant::group();
- $customGroup = array(
+ $customGroup = [
'-1' => ts('- select -'),
'0' => ts('All Custom Groups'),
- ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
+ ] + CRM_Core_PseudoConstant::get('CRM_Core_DAO_CustomField', 'custom_group_id');
- $ufGroup = array(
+ $ufGroup = [
'-1' => ts('- select -'),
'0' => ts('All Profiles'),
- ) + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
+ ] + CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
- $event = array(
+ $event = [
'-1' => ts('- select -'),
'0' => ts('All Events'),
- ) + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
+ ] + CRM_Event_PseudoConstant::event(NULL, FALSE, "( is_template IS NULL OR is_template != 1 )");
$this->add('select', 'group_id', ts('Group'), $group);
$this->add('select', 'custom_group_id', ts('Custom Data'), $customGroup);
$this->add('checkbox', 'is_active', ts('Enabled?'));
- $this->addFormRule(array('CRM_ACL_Form_ACL', 'formRule'));
+ $this->addFormRule(['CRM_ACL_Form_ACL', 'formRule']);
}
/**
$errors['entity_id'] = ts('Please assign this permission to a Role.');
}
- $validOperations = array('View', 'Edit');
+ $validOperations = ['View', 'Edit'];
$operationMessage = ts("Only 'View' and 'Edit' operations are valid for this type of data");
// Figure out which type of object we're permissioning on and make sure user has selected a value.