CRM-13966 CRM-14165 - Use $form->addSelect for contact edit fields
authorColeman Watts <coleman@civicrm.org>
Fri, 7 Feb 2014 21:57:11 +0000 (13:57 -0800)
committerColeman Watts <coleman@civicrm.org>
Sat, 8 Feb 2014 05:41:56 +0000 (21:41 -0800)
CRM/Contact/Form/Edit/CommunicationPreferences.php
CRM/Contact/Form/Edit/Email.php
CRM/Contact/Form/Edit/IM.php
CRM/Contact/Form/Edit/Website.php

index 8b5880c6e0fc9c023bff54c91373085fc8e3c34d..ed4a1084671455adadb12be056a38077f33c19e6 100644 (file)
@@ -79,12 +79,7 @@ class CRM_Contact_Form_Edit_CommunicationPreferences {
     }
     $form->addGroup($commPreff, 'preferred_communication_method', ts('Preferred Method(s)'));
 
-    $form->add('select', 'preferred_language',
-      ts('Preferred Language'),
-      array(
-        '' => ts('- select -')) +
-      CRM_Contact_BAO_Contact::buildOptions('preferred_language')
-    );
+    $form->addSelect('preferred_language');
 
     if (!empty($privacyOptions)) {
       $commPreference['privacy'] = $privacyOptions;
index 25e85027e75c21fb843fae75c0a938197b6f5c15..75d48ad8584f9567cd4be4008fc6cd1a37d3979b 100644 (file)
@@ -65,7 +65,7 @@ class CRM_Contact_Form_Edit_Email {
     $form->addRule("email[$blockId][email]", ts('Email is not valid.'), 'email');
     if (isset($form->_contactType) || $blockEdit) {
       //Block type
-      $form->addElement('select', "email[$blockId][location_type_id]", '', CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'));
+      $form->addSelect("email[$blockId][location_type_id]", array('data-api-entity' => 'email', 'class' => 'six'));
 
       $multipleBulk = CRM_Core_BAO_Email::isMultipleBulkMail();
 
index b06db91e7d67f645a2b0962193e6a5908b519442..89be43eeeab8b56b17a0f585741b7f5959a76ffe 100644 (file)
@@ -59,10 +59,10 @@ class CRM_Contact_Form_Edit_IM {
     $form->applyFilter('__ALL__', 'trim');
 
     //IM provider select
-    $form->addElement('select', "im[$blockId][provider_id]", '', CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id'));
+    $form->addSelect("im[$blockId][provider_id]", array('data-api-entity' => 'im', 'class' => 'six'));
 
     //Block type select
-    $form->addElement('select', "im[$blockId][location_type_id]", '', CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id'));
+    $form->addSelect("im[$blockId][location_type_id]", array('data-api-entity' => 'im', 'class' => 'six'));
 
     //IM box
     $form->addElement('text', "im[$blockId][name]", ts('Instant Messenger'),
index 1f09812897616ca1af157475867e29bedf5cb626..354e0ae9252c3f29a1050f38748bd75930defb3c 100644 (file)
@@ -59,7 +59,7 @@ class CRM_Contact_Form_Edit_Website {
     $form->applyFilter('__ALL__', 'trim');
 
     //Website type select
-    $form->addElement('select', "website[$blockId][website_type_id]", '', CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id'));
+    $form->addSelect("website[$blockId][website_type_id]", array('data-api-entity' => 'website', 'class' => 'six'));
 
     //Website box
     $form->addElement('text', "website[$blockId][url]", ts('Website'),