From d825b696e143556c9343af6d66846837e77317b6 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 7 Feb 2014 13:57:11 -0800 Subject: [PATCH] CRM-13966 CRM-14165 - Use $form->addSelect for contact edit fields --- CRM/Contact/Form/Edit/CommunicationPreferences.php | 7 +------ CRM/Contact/Form/Edit/Email.php | 2 +- CRM/Contact/Form/Edit/IM.php | 4 ++-- CRM/Contact/Form/Edit/Website.php | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/CRM/Contact/Form/Edit/CommunicationPreferences.php b/CRM/Contact/Form/Edit/CommunicationPreferences.php index 8b5880c6e0..ed4a108467 100644 --- a/CRM/Contact/Form/Edit/CommunicationPreferences.php +++ b/CRM/Contact/Form/Edit/CommunicationPreferences.php @@ -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; diff --git a/CRM/Contact/Form/Edit/Email.php b/CRM/Contact/Form/Edit/Email.php index 25e85027e7..75d48ad858 100644 --- a/CRM/Contact/Form/Edit/Email.php +++ b/CRM/Contact/Form/Edit/Email.php @@ -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(); diff --git a/CRM/Contact/Form/Edit/IM.php b/CRM/Contact/Form/Edit/IM.php index b06db91e7d..89be43eeea 100644 --- a/CRM/Contact/Form/Edit/IM.php +++ b/CRM/Contact/Form/Edit/IM.php @@ -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'), diff --git a/CRM/Contact/Form/Edit/Website.php b/CRM/Contact/Form/Edit/Website.php index 1f09812897..354e0ae925 100644 --- a/CRM/Contact/Form/Edit/Website.php +++ b/CRM/Contact/Form/Edit/Website.php @@ -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'), -- 2.25.1