<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
- *
+ * UF group BAO class.
*/
class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup {
const PUBLIC_VISIBILITY = 1,
$ctype = NULL,
$permissionType = CRM_Core_Permission::CREATE,
$orderBy = 'field_name',
- $orderProfiles = NULL
+ $orderProfiles = NULL,
+ $eventProfile = FALSE
) {
if (!is_array($id)) {
$id = CRM_Utils_Type::escape($id, 'Positive');
$query .= " AND g.is_active = 1";
}
+ $checkPermission = array(
+ array(
+ 'administer CiviCRM',
+ 'manage event profiles',
+ ),
+ );
+ if ($eventProfile && CRM_Core_Permission::check($checkPermission)) {
+ $skipPermission = TRUE;
+ }
+
// add permissioning for profiles only if not registration
if (!$skipPermission) {
$permissionClause = CRM_Core_Permission::ufGroupClause($permissionType, 'g.');
* @param bool $absolute
* Return urls in absolute form (useful when sending an email).
* @param null $additionalWhereClause
- *
- * @return void
*/
public static function getValues(
$cid, &$fields, &$values,
* (reference) an assoc array of name/value pairs.
* @param int $ufGroupId
* Ufgroup id.
- *
- * @return void
*/
public static function createUFJoin(&$params, $ufGroupId) {
$groupTypes = CRM_Utils_Array::value('uf_group_type', $params);
*
* @param array $params
* (reference) an assoc array of name/value pairs.
- *
- * @return void
*/
public static function delUFJoin(&$params) {
$ufJoin = new CRM_Core_DAO_UFJoin();
$subtypeList = $subtypes;
}
- $sel = $form->add('select', $name, $title, $subtypeList, $required);
- $sel->setMultiple(TRUE);
+ $form->add('select', $name, $title, $subtypeList, $required, array('class' => 'crm-select2', 'multiple' => TRUE));
}
elseif (in_array($fieldName, CRM_Contact_BAO_Contact::$_greetingTypes)) {
//add email greeting, postal greeting, addressee, CRM-4575
* @param int $id
* The profile id to copy.
*
- * @return void
+ * @return \CRM_Core_DAO
*/
public static function copy($id) {
$fieldsFix = array('prefix' => array('title' => ts('Copy of ')));
* Contact id.
* @param array $values
* Associative array of name/value pair.
- *
- * @return void
*/
public static function commonSendMail($contactID, &$values) {
if (!$contactID || !$values) {
* Group id.
* @param array $values
* @param CRM_Core_Smarty $template
- *
- * @return void
*/
public function profileDisplay($gid, $values, $template) {
$groupTitle = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $gid, 'title');
* An array of default values.
*
* @param bool $isStandalone
- *
- * @return void
*/
public static function setComponentDefaults(&$fields, $componentId, $component, &$defaults, $isStandalone = FALSE) {
if (!$componentId ||