<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
}
- /**
- * This function sets the default values for the form. GroupContact that in edit/view mode
- * the default values are retrieved from the database
- *
- * @access public
- *
- * @return None
- */
- function setDefaultValues() {
- $defaults = array();
- $params = array();
-
- return $defaults;
- }
-
- /**
- * This function is used to add the rules for form.
- *
- * @return None
- * @access public
- */
- function addRules() {}
-
/**
* Function to build the form
*
- * @return None
+ * @return void
* @access public
*/
public function buildQuickForm() {
}
// Arrange groups into hierarchical listing (child groups follow their parents and have indentation spacing in title)
- $ids = implode(',', array_keys($allGroups));
- $ids = 'IN (' . $ids . ')';
- $groupHierarchy = CRM_Contact_BAO_Group::getGroupsHierarchy($ids, NULL, ' ', TRUE);
+ $groupHierarchy = CRM_Contact_BAO_Group::getGroupsHierarchy($allGroups, NULL, ' ', TRUE);
// get the list of groups contact is currently in ("Added") or unsubscribed ("Removed").
$currentGroups = CRM_Contact_BAO_GroupContact::getGroupList($this->_contactId);
$msg = ts('Add to a group');
}
- $this->add('select', 'group_id', $msg, $groupSelect, TRUE);
+ $this->add('select', 'group_id', '', $groupSelect, TRUE, array('class' => 'crm-select2 crm-action-menu action-icon-plus', 'placeholder' => $msg));
$this->addButtons(array(
array(
*
* @access public
*
- * @return None
+ * @return void
*/
public function postProcess() {
$contactID = array($this->_contactId);
$groupId = $this->controller->exportValue('GroupContact', 'group_id');
- $method = 'Admin';
$method = ($this->_context == 'user') ? 'Web' : 'Admin';
$session = CRM_Core_Session::singleton();