Add size to schema, add size support in addfield
authorTim Mallezie <tim.mallezie@chiro.be>
Thu, 9 Apr 2015 20:47:29 +0000 (22:47 +0200)
committerTim Mallezie <tim.mallezie@chiro.be>
Tue, 14 Apr 2015 14:40:19 +0000 (16:40 +0200)
CRM/Contact/Form/Edit/Notes.php
CRM/Core/Form.php
xml/schema/Core/Note.xml

index db31ca5dee8178703f99c82e269046a57594c3ad..93c5733771ce5c192f9b897727233299f766975c 100644 (file)
@@ -42,7 +42,7 @@ class CRM_Contact_Form_Edit_Notes {
    */
   public static function buildQuickForm(&$form) {
     $form->applyFilter('__ALL__', 'trim');
-    $form->addField('subject', array('entity' => 'note', 'size' => 60, 'maxlength' => 254));
+    $form->addField('subject', array('entity' => 'note', 'size' => '60'));
     $form->addField('note', array('entity' => 'note', 'rows' => 3));
   }
 
index d6a01204125ecb2e3bc5670121e16cf05559ff2f..fe18c2dbee560c57361da5ca5211fc8e1b547fc8 100644 (file)
@@ -1243,6 +1243,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
       case 'Text':
       case 'Link':
         //TODO: Autodetect ranges
+        $props['size'] = isset($props['size']) ? $props['size'] : 60;
         $this->add('text', $name, $label, $props, $required);
         break;
 
index 302aa4c9a0f6470acca99158a8dbbb5f7ba87b50..c71cd3f8da2a1dc7d0ce7e510e794b6d731a4b45 100644 (file)
@@ -91,6 +91,7 @@
     <comment>subject of note description</comment>
     <html>
       <type>Text</type>
+      <size>60</size>
     </html>
     <add>1.5</add>
   </field>