/** * Function to build the form * * @return None * @access public */ public function buildQuickForm() { parent::buildQuickForm(); if ($this->_action & CRM_Core_Action::DELETE) { return; } $attributes = CRM_Core_DAO::getAttribute('CRM_ACL_DAO_ACL'); $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(); $this->add('select', 'operation', ts('Operation'), $operations, TRUE); $objTypes = array('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();"); $this->addRadio('object_type', ts('Type of Data'), $objTypes, $extra, ' ', TRUE); $label = ts('Role'); $role = array('-1' => ts('- select role -'), '0' => ts('Everyone')) + CRM_Core_OptionGroup::values('acl_role'); $this->add('select', 'entity_id', $label, $role, TRUE); $group = array('-1' => ts('- select -'), '0' => ts('All Groups')) + CRM_Core_PseudoConstant::group(); $customGroup = array('-1' => ts('- select -'), '0' => ts('All Custom Groups')) + CRM_Core_PseudoConstant::customGroup(); $ufGroup = array('-1' => ts('- select -'), '0' => ts('All Profiles')) + CRM_Core_PseudoConstant::ufGroup(); $event = array('-1' => ts('- select -'), '0' => ts('All Events')) + 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('select', 'uf_group_id', ts('Profile'), $ufGroup); $this->add('select', 'event_id', ts('Event'), $event); $this->add('checkbox', 'is_active', ts('Enabled?')); $this->addFormRule(array('CRM_ACL_Form_ACL', 'formRule')); }