From a6c048110076ac2ba80dcfc61a0fbda2b307b7fc Mon Sep 17 00:00:00 2001 From: Tim Mallezie Date: Tue, 19 May 2015 17:52:43 +0200 Subject: [PATCH] use addField in phone form --- CRM/Contact/Form/Edit/Phone.php | 21 +++++++++------------ xml/schema/Core/Phone.xml | 3 +++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CRM/Contact/Form/Edit/Phone.php b/CRM/Contact/Form/Edit/Phone.php index 4afc211754..b6205e21f6 100644 --- a/CRM/Contact/Form/Edit/Phone.php +++ b/CRM/Contact/Form/Edit/Phone.php @@ -59,21 +59,18 @@ class CRM_Contact_Form_Edit_Phone { $form->applyFilter('__ALL__', 'trim'); //phone type select - $form->addSelect("phone[$blockId][phone_type_id]", array( - 'entity' => 'phone', - 'class' => 'eight', - 'placeholder' => NULL, - )); - + $form->addField("phone[$blockId][phone_type_id]", array( + 'entity' => 'phone', + 'class' => 'eight', + 'placeholder' => NULL, + )); //main phone number with crm_phone class - $form->add('text', "phone[$blockId][phone]", ts('Phone'), array_merge(CRM_Core_DAO::getAttribute('CRM_Core_DAO_Phone', 'phone'), array('class' => 'crm_phone twelve'))); - // phone extension - $form->addElement('text', "phone[$blockId][phone_ext]", ts('Extension'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_Phone', 'phone_ext')); - + $form->addField("phone[$blockId][phone]", array('entity' => 'phone', 'class' => 'crm_phone twelve')); + $form->addField("phone[$blockId][phone_ext]", array('entity' => 'phone')); if (isset($form->_contactType) || $blockEdit) { //Block type select - $form->addSelect("phone[$blockId][location_type_id]", array( - 'entity' => 'phone', + $form->addField("phone[$blockId][location_type_id]", array( + 'entity' => 'phone', 'class' => 'eight', 'placeholder' => NULL, )); diff --git a/xml/schema/Core/Phone.xml b/xml/schema/Core/Phone.xml index 7dee80ee06..29b17c1df3 100644 --- a/xml/schema/Core/Phone.xml +++ b/xml/schema/Core/Phone.xml @@ -100,6 +100,9 @@ /^[\d\(\)\-\.\s]+$/ Complete phone number. 1.1 + + Text + phone_ext -- 2.25.1