use addfield method
authorTim Mallezie <tim.mallezie@chiro.be>
Sun, 17 May 2015 18:18:47 +0000 (20:18 +0200)
committerTim Mallezie <tim.mallezie@chiro.be>
Sun, 17 May 2015 18:18:47 +0000 (20:18 +0200)
CRM/Contact/Form/Edit/Organization.php

index da41d8f5db312425e69bfdbe26afda5a3de5daac..a067b1be869ef0c5f2166341f078b4c7a3315704 100644 (file)
@@ -53,32 +53,27 @@ class CRM_Contact_Form_Edit_Organization {
    * @return void
    */
   public static function buildQuickForm(&$form, $inlineEditMode = NULL) {
-    $attributes = CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact');
-
     $form->applyFilter('__ALL__', 'trim');
 
     if (!$inlineEditMode || $inlineEditMode == 1) {
       // Organization_name
-      $form->add('text', 'organization_name', ts('Organization Name'), $attributes['organization_name']);
+      $form->addField('organization_name');
     }
 
     if (!$inlineEditMode || $inlineEditMode == 2) {
       // legal_name
-      $form->addElement('text', 'legal_name', ts('Legal Name'), $attributes['legal_name']);
+      $form->addField('legal_name');
 
       // nick_name
-      $form->addElement('text', 'nick_name', ts('Nickname'),
-        CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'nick_name')
-      );
+      $form->addField('nick_name');
 
       // sic_code
-      $form->addElement('text', 'sic_code', ts('SIC Code'), $attributes['sic_code']);
-
-      $form->addElement('text', 'contact_source', ts('Source'), CRM_Utils_Array::value('source', $attributes));
+      $form->addField('sic_code');
+      $form->addField('contact_source');
     }
 
     if (!$inlineEditMode) {
-      $form->add('text', 'external_identifier', ts('External ID'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'external_identifier'), FALSE);
+      $form->addField('external_identifier', array('label' => ts('External ID')));
       $form->addRule('external_identifier',
         ts('External ID already exists in Database.'),
         'objectExists',