From: Tim Mallezie Date: Tue, 19 May 2015 15:52:43 +0000 (+0200) Subject: use addField in phone form X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a6c048110076ac2ba80dcfc61a0fbda2b307b7fc;p=civicrm-core.git use addField in phone form --- 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