Add select2 to basic search
authorColeman Watts <coleman@civicrm.org>
Sun, 27 Apr 2014 05:46:39 +0000 (22:46 -0700)
committerColeman Watts <coleman@civicrm.org>
Sun, 27 Apr 2014 05:46:39 +0000 (22:46 -0700)
CRM/Contact/Form/Search/Basic.php

index b5c337a65b53a2f37064167dd4a9bd7b113939e8..b8197dd9eec1d478835f953162b770a94ee0d1bb 100644 (file)
@@ -73,7 +73,9 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search {
       $contactTypes = array('' => ts('- any contact type -')) + CRM_Contact_BAO_ContactType::getSelectElements();
       $this->add('select', 'contact_type',
         ts('is...'),
-        $contactTypes
+        $contactTypes,
+        FALSE,
+        array('class' => 'crm-select2')
       );
     }
 
@@ -83,15 +85,14 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search {
 
       // add select for groups
       $group = array('' => ts('- any group -')) + $groupHierarchy;
-      $this->_groupElement = &$this->addElement('select', 'group', ts('in'), $group);
+      $this->add('select', 'group', ts('in'), $group, FALSE, array('class' => 'crm-select2'));
     }
 
     if (!empty($searchOptions['tags'])) {
       // tag criteria
       if (!empty($this->_tag)) {
-        $tag = array(
-          '' => ts('- any tag -')) + $this->_tag;
-        $this->_tagElement = &$this->addElement('select', 'tag', ts('with'), $tag);
+        $tag = array('' => ts('- any tag -')) + $this->_tag;
+        $this->add('select', 'tag', ts('with'), $tag, FALSE, array('class' => 'crm-select2'));
       }
     }