CRM-13966 - Add select2 to grant, participant forms
authorColeman Watts <coleman@civicrm.org>
Sun, 9 Feb 2014 22:35:29 +0000 (14:35 -0800)
committerColeman Watts <coleman@civicrm.org>
Mon, 10 Feb 2014 02:33:37 +0000 (18:33 -0800)
CRM/Admin/Form/Setting/Search.php
CRM/Event/Form/Participant.php
CRM/Grant/Form/Grant.php
xml/schema/Event/Participant.xml

index 6c7fe79572de17498b4a356ea090234f2a6ec466..e34a1b1c5195f80a581c02db0211fe281bdecf44 100644 (file)
@@ -67,8 +67,7 @@ class CRM_Admin_Form_Setting_Search extends CRM_Admin_Form_Setting {
     $profiles = CRM_Core_BAO_UFGroup::getProfiles($types);
 
     $this->add('select', 'defaultSearchProfileID', ts('Default Contact Search Profile'),
-      array(
-        '' => ts('- select -')) + $profiles
+      array('' => ts('- none -')) + $profiles, FALSE, array('class' => 'crm-select2 huge')
     );
 
     // Autocomplete for Contact Search (quick search etc.)
index dfbbe6cb6ce4a904d02a505672e7e55c8cd37053..6b5e6ad8545aa19b360976fe7682d019721a0608 100644 (file)
@@ -910,12 +910,7 @@ loadCampaign( {$this->_eID}, {$eventCampaigns} );
     $this->assign('notificationStatusIds', $notificationStatusIds);
 
     $this->_participantStatuses = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
-    $this->add('select', 'status_id', ts('Participant Status'),
-      array(
-        '' => ts('- select -')) + $this->_participantStatuses,
-      TRUE,
-      $checkCancelledJs
-    );
+    $this->addSelect('status_id', $checkCancelledJs, TRUE);
 
     $this->addElement('checkbox', 'is_notify', ts('Send Notification'), NULL);
 
index 9898a23e45714750107ffc7e56b92e818824da67..b6f331d3158112d3894797e163b5f87cd7dbb4d8 100644 (file)
@@ -194,23 +194,14 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form {
     }
 
     $attributes = CRM_Core_DAO::getAttribute('CRM_Grant_DAO_Grant');
-    $grantType = CRM_Core_OptionGroup::values('grant_type');
-    $this->add('select', 'grant_type_id', ts('Grant Type'),
-      array(
-        '' => ts('- select -')) + $grantType, TRUE,
-      array('onChange' => "CRM.buildCustomData( 'Grant', this.value );")
-    );
+    $this->addSelect('grant_type_id', array('onChange' => "CRM.buildCustomData( 'Grant', this.value );"), TRUE);
 
     //need to assign custom data type and subtype to the template
     $this->assign('customDataType', 'Grant');
     $this->assign('customDataSubType', $this->_grantType);
     $this->assign('entityID', $this->_id);
 
-    $grantStatus = CRM_Core_OptionGroup::values('grant_status');
-    $this->add('select', 'status_id', ts('Grant Status'),
-      array(
-        '' => ts('- select -')) + $grantStatus, TRUE
-    );
+    $this->addSelect('status_id', array(), TRUE);
 
     $this->addDate('application_received_date', ts('Application Received'), FALSE, array('formatType' => 'custom'));
     $this->addDate('decision_date', ts('Grant Decision'), FALSE, array('formatType' => 'custom'));
index 88dae9fcd9ec010176a3e1b224e720cb44f723f6..6677e5fb582fcf632f93aeaf24fe3c3016b3d0f2 100644 (file)
@@ -57,7 +57,7 @@
   <field>
       <name>status_id</name>
       <uniqueName>participant_status_id</uniqueName>
-      <title>Participant Status Id</title>
+      <title>Participant Status</title>
       <headerPattern>/(participant.)?(status)$/i</headerPattern>
       <import>true</import>
       <type>int unsigned</type>