<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
*/
protected $_contactId;
- function preProcess() {
+ public function preProcess() {
$this->_contactId = $this->get('contactId');
$this->_groupContactId = $this->get('groupContactId');
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
}
/**
- * Build the form object
+ * Build the form object.
*
* @return void
- * @access public
*/
public function buildQuickForm() {
// get the list of all the groups
$groupSelect = $groupHierarchy;
}
- $groupSelect = array( '' => ts('- select group -')) + $groupSelect;
+ $groupSelect = array('' => ts('- select group -')) + $groupSelect;
if (count($groupSelect) > 1) {
$session = CRM_Core_Session::singleton();
$msg = ts('Add to a group');
}
- $this->add('select', 'group_id', '', $groupSelect, TRUE, array('class' => 'crm-select2 crm-action-menu action-icon-plus', 'placeholder' => $msg));
+ $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 void
*/
public function postProcess() {
$contactID = array($this->_contactId);
- $groupId = $this->controller->exportValue('GroupContact', 'group_id');
- $method = ($this->_context == 'user') ? 'Web' : 'Admin';
+ $groupId = $this->controller->exportValue('GroupContact', 'group_id');
+ $method = ($this->_context == 'user') ? 'Web' : 'Admin';
$session = CRM_Core_Session::singleton();
$userID = $session->get('userID');
CRM_Core_Session::setStatus(ts("Contact has been added to '%1'.", array(1 => $groups[$groupId])), ts('Added to Group'), 'success');
}
}
-}
+}