CRM-15552 Field communication_style not available to be added to profiles
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 18 Nov 2014 13:06:18 +0000 (18:36 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Fri, 21 Nov 2014 06:35:42 +0000 (12:05 +0530)
CRM/Contact/BAO/Contact.php
CRM/Core/BAO/UFGroup.php

index d544bb648070393e10897243f9e12af1e36cfe99..9daf97084dd370f9191450909337dd1f94cea408 100644 (file)
@@ -1312,6 +1312,10 @@ WHERE id={$id}; ";
             'title' => ts('Note(s)'),
             'name' => 'note',
           ),
+          'communication_style_id' => array(
+            'title' => ts('Communication Style'),
+            'name' => 'communication_style_id',
+          ),
         ));
       }
 
index 14cb13cb23726ff1cbc7f47ce5b984cf6591fde6..bcf799c4544eb2a382ed5bf0d0471efc4325d47d 100644 (file)
@@ -1923,6 +1923,20 @@ AND    ( entity_id IS NULL OR entity_id <= 0 )
         $group->setAttribute('allowClear', TRUE);
       }
     }
+    elseif ($fieldName === 'communication_style_id') {
+      $styleOptions = array();
+      $style = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'communication_style_id');
+      foreach ($style as $key => $var) {
+        $styleOptions[$key] = $form->createElement('radio', NULL, ts('Communication Style'), $var, $key);
+      }
+      $group = $form->addGroup($styleOptions, $name, $title);
+      if ($required) {
+        $form->addRule($name, ts('%1 is a required field.', array(1 => $title)), 'required');
+      }
+      else {
+        $group->setAttribute('allowClear', TRUE);
+      }
+    }
     elseif ($fieldName === 'prefix_id' || $fieldName === 'suffix_id') {
       $form->addSelect($name, array(
         'label' => $title,