CRM-13966 - Style regular selects to more or less match select2
[civicrm-core.git] / CRM / Grant / BAO / Query.php
index ab5824baacf1d05282c205efb8c9f0f1b085afa8..91da27c50db156b0fe5f7bd2927120b71148981d 100644 (file)
@@ -48,35 +48,35 @@ class CRM_Grant_BAO_Query {
    */
   static function select(&$query) {
     if ($query->_mode & CRM_Contact_BAO_Query::MODE_GRANT) {
-      if (CRM_Utils_Array::value('grant_status_id', $query->_returnProperties)) {
+      if (!empty($query->_returnProperties['grant_status_id'])) {
         $query->_select['grant_status_id'] = 'grant_status.id as grant_status_id';
         $query->_element['grant_status'] = 1;
         $query->_tables['grant_status'] = $query->_whereTables['grant_status'] = 1;
         $query->_tables['civicrm_grant'] = $query->_whereTables['civicrm_grant'] = 1;
       }
 
-      if (CRM_Utils_Array::value('grant_status', $query->_returnProperties)) {
+      if (!empty($query->_returnProperties['grant_status'])) {
         $query->_select['grant_status'] = 'grant_status.label as grant_status';
         $query->_element['grant_status'] = 1;
         $query->_tables['grant_status'] = $query->_whereTables['grant_status'] = 1;
         $query->_tables['civicrm_grant'] = $query->_whereTables['civicrm_grant'] = 1;
       }
 
-      if (CRM_Utils_Array::value('grant_type_id', $query->_returnProperties)) {
+      if (!empty($query->_returnProperties['grant_type_id'])) {
         $query->_select['grant_type_id'] = 'grant_type.id as grant_type_id';
         $query->_element['grant_type'] = 1;
         $query->_tables['grant_type'] = $query->_whereTables['grant_type'] = 1;
         $query->_tables['civicrm_grant'] = $query->_whereTables['civicrm_grant'] = 1;
       }
 
-      if (CRM_Utils_Array::value('grant_type', $query->_returnProperties)) {
+      if (!empty($query->_returnProperties['grant_type'])) {
         $query->_select['grant_type'] = 'grant_type.label as grant_type';
         $query->_element['grant_type'] = 1;
         $query->_tables['grant_type'] = $query->_whereTables['grant_type'] = 1;
         $query->_tables['civicrm_grant'] = $query->_whereTables['civicrm_grant'] = 1;
       }
 
-      if (CRM_Utils_Array::value('grant_note', $query->_returnProperties)) {
+      if (!empty($query->_returnProperties['grant_note'])) {
         $query->_select['grant_note'] = "civicrm_note.note as grant_note";
         $query->_element['grant_note'] = 1;
         $query->_tables['grant_note'] = 1;
@@ -301,14 +301,14 @@ class CRM_Grant_BAO_Query {
 
     $grantType = CRM_Core_OptionGroup::values('grant_type');
     $form->add('select', 'grant_type_id', ts('Grant Type'),
-      array(
-        '' => ts('- any -')) + $grantType
+      array('' => ts('- any -')) + $grantType,
+      FALSE, array('class' => 'crm-select2')
     );
 
     $grantStatus = CRM_Core_OptionGroup::values('grant_status');
     $form->add('select', 'grant_status_id', ts('Grant Status'),
-      array(
-        '' => ts('- any -')) + $grantStatus
+      array('' => ts('- any -')) + $grantStatus,
+      FALSE, array('class' => 'crm-select2')
     );
 
     $form->addDate('grant_application_received_date_low', ts('App. Received Date - From'), FALSE, array('formatType' => 'searchDate'));
@@ -360,11 +360,6 @@ class CRM_Grant_BAO_Query {
     $form->assign('validGrant', TRUE);
   }
 
-  static function addShowHide(&$showHide) {
-    $showHide->addHide('grantForm');
-    $showHide->addShow('grantForm_show');
-  }
-
   static function searchAction(&$row, $id) {}
 
   static function tableNames(&$tables) {}