From: Tim Mallezie Date: Wed, 29 Apr 2015 16:10:48 +0000 (+0200) Subject: use addField in CRM_Contact_Form_GroupContact CRM-16178 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f30a8dfb2d94acf086b003f033ccd3a2fbb8d063;p=civicrm-core.git use addField in CRM_Contact_Form_GroupContact CRM-16178 --- diff --git a/CRM/Contact/Form/GroupContact.php b/CRM/Contact/Form/GroupContact.php index 052569046b..869a3e1f46 100644 --- a/CRM/Contact/Form/GroupContact.php +++ b/CRM/Contact/Form/GroupContact.php @@ -53,6 +53,20 @@ 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'; + } + public function preProcess() { $this->_contactId = $this->get('contactId'); $this->_groupContactId = $this->get('groupContactId'); @@ -101,10 +115,7 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form { $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(