<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
- * This class generates form components for groupContact
- *
+ * This class generates form components for groupContact.
*/
class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
*/
protected $_contactId;
+ /**
+ * Explicitly declare the entity api name.
+ */
+ public function getDefaultEntity() {
+ return 'GroupContact';
+ }
+
+ /**
+ * Explicitly declare the form context.
+ */
+ public function getDefaultContext() {
+ return 'create';
+ }
+
+ /**
+ * Pre process form.
+ */
public function preProcess() {
$this->_contactId = $this->get('contactId');
$this->_groupContactId = $this->get('groupContactId');
/**
* Build the form object.
- *
- * @return void
*/
public function buildQuickForm() {
// get the list of all the groups
$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->addField('group_id', array('class' => 'crm-action-menu action-icon-plus', 'placeholder' => $msg, 'options' => $groupSelect));
$this->addButtons(array(
array(
}
/**
- *
- * @return void
+ * Post process form.
*/
public function postProcess() {
$contactID = array($this->_contactId);