use addField in phone form
authorTim Mallezie <tim.mallezie@chiro.be>
Tue, 19 May 2015 15:52:43 +0000 (17:52 +0200)
committerTim Mallezie <tim.mallezie@chiro.be>
Tue, 19 May 2015 15:52:43 +0000 (17:52 +0200)
CRM/Contact/Form/Edit/Phone.php
xml/schema/Core/Phone.xml

index 4afc211754b21010d692e4091d92284d8b6ec2c6..b6205e21f607c571dd5d7ea7793240e37bd80046 100644 (file)
@@ -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,
         ));
index 7dee80ee063f5985f3404988543ce771d9040cd0..29b17c1df38aa935d4c2b7acb08f5cdf5b960829 100644 (file)
     <dataPattern>/^[\d\(\)\-\.\s]+$/</dataPattern>
     <comment>Complete phone number.</comment>
     <add>1.1</add>
+    <html>
+      <type>Text</type>
+    </html>
   </field>
   <field>
     <name>phone_ext</name>