From: Coleman Watts Date: Sun, 9 Feb 2014 22:35:29 +0000 (-0800) Subject: CRM-13966 - Add select2 to grant, participant forms X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0f352c3a5ea6d6988fdb55a6049630036c6795b0;p=civicrm-core.git CRM-13966 - Add select2 to grant, participant forms --- diff --git a/CRM/Admin/Form/Setting/Search.php b/CRM/Admin/Form/Setting/Search.php index 6c7fe79572..e34a1b1c51 100644 --- a/CRM/Admin/Form/Setting/Search.php +++ b/CRM/Admin/Form/Setting/Search.php @@ -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.) diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index dfbbe6cb6c..6b5e6ad854 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -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); diff --git a/CRM/Grant/Form/Grant.php b/CRM/Grant/Form/Grant.php index 9898a23e45..b6f331d315 100644 --- a/CRM/Grant/Form/Grant.php +++ b/CRM/Grant/Form/Grant.php @@ -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')); diff --git a/xml/schema/Event/Participant.xml b/xml/schema/Event/Participant.xml index 88dae9fcd9..6677e5fb58 100644 --- a/xml/schema/Event/Participant.xml +++ b/xml/schema/Event/Participant.xml @@ -57,7 +57,7 @@ status_id participant_status_id - Participant Status Id + Participant Status /(participant.)?(status)$/i true int unsigned