more comment fixes
[civicrm-core.git] / CRM / Contact / Form / GroupContact.php
index 052569046b5f00f8b287b3cd54d2863570e5f6af..64e83e772cb56b6163f4da5ad091a4fd5833f0e3 100644 (file)
@@ -1,7 +1,7 @@
 <?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 {
 
@@ -53,6 +50,23 @@ 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');
@@ -61,8 +75,6 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
 
   /**
    * Build the form object.
-   *
-   * @return void
    */
   public function buildQuickForm() {
     // get the list of all the groups
@@ -101,10 +113,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(
@@ -118,8 +127,7 @@ class CRM_Contact_Form_GroupContact extends CRM_Core_Form {
   }
 
   /**
-   *
-   * @return void
+   * Post process form.
    */
   public function postProcess() {
     $contactID = array($this->_contactId);