addfield in IM form
authorTim Mallezie <tim.mallezie@chiro.be>
Sun, 17 May 2015 14:06:08 +0000 (16:06 +0200)
committerTim Mallezie <tim.mallezie@chiro.be>
Sun, 17 May 2015 14:06:08 +0000 (16:06 +0200)
CRM/Contact/Form/Edit/IM.php
xml/schema/Core/IM.xml

index 80028fa494f674fefa304188d22753aeb9871163..a5a808bda7da8ee47da0f638e25bc2bf25be6cfd 100644 (file)
@@ -60,20 +60,12 @@ class CRM_Contact_Form_Edit_IM {
     $form->applyFilter('__ALL__', 'trim');
 
     //IM provider select
-    $form->addSelect("im[$blockId][provider_id]", array('entity' => 'im', 'class' => 'eight', 'placeholder' => NULL));
-
+    $form->addField("im[$blockId][provider_id]", array('entity' => 'im', 'class' => 'eight', 'placeholder' => NULL));
     //Block type select
-    $form->addSelect("im[$blockId][location_type_id]", array(
-        'entity' => 'im',
-        'class' => 'eight',
-        'placeholder' => NULL,
-      ));
+    $form->addField("im[$blockId][location_type_id]", array('entity' => 'im', 'class' => 'eight', 'placeholder' => NULL));
 
     //IM box
-    $form->addElement('text', "im[$blockId][name]", ts('Instant Messenger'),
-      CRM_Core_DAO::getAttribute('CRM_Core_DAO_IM', 'name')
-    );
-
+    $form->addField("im[$blockId][name]", array('entity' => 'im'));
     //is_Primary radio
     $js = array('id' => 'IM_' . $blockId . '_IsPrimary');
     if (!$blockEdit) {
index 0b2675395b985a0dbfd8c8e4253e661fca7668c5..ce4e3961e6cb8d4a1600abbf584ffa77ed116ed0 100644 (file)
@@ -44,6 +44,9 @@
       <labelColumn>display_name</labelColumn>
     </pseudoconstant>
     <add>2.0</add>
+    <html>
+      <type>Select</type>
+    </html>
   </field>
   <index>
     <name>index_location_type</name>
@@ -60,6 +63,9 @@
     <dataPattern>/^[A-Za-z][0-9A-Za-z]{20,}$/</dataPattern>
     <comment>IM screen name</comment>
     <add>1.1</add>
+    <html>
+      <type>Text</type>
+    </html>
   </field>
   <field>
     <name>provider_id</name>