CRM-12466, worked on form building
authorKurund Jalmi <kurund@civicrm.org>
Fri, 17 May 2013 05:31:34 +0000 (01:31 -0400)
committerKurund Jalmi <kurund@civicrm.org>
Tue, 21 May 2013 00:52:00 +0000 (20:52 -0400)
CRM/Admin/Form/Preferences.php
CRM/Admin/Form/Preferences/Display.php
templates/CRM/Admin/Form/Preferences/Display.tpl

index d96d6d74ee9623fee21f87079e84a1c2634525ef..52fd367a334a49e1b58c0bb566fb353d9d47b52c 100644 (file)
@@ -163,17 +163,16 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
               break;
 
             case 'textarea':
-              $this->addElement('textarea',
+            case 'checkbox':
+              $this->add($fieldValue['html_type'],
                 $fieldName,
                 $fieldValue['title']
               );
               break;
 
-            case 'checkbox':
-              $this->addElement('checkbox',
-                $fieldName,
-                $fieldValue['title']
-              );
+            case 'radio':
+              $options = CRM_Core_OptionGroup::values($fieldName, FALSE, FALSE, TRUE);
+              $this->addRadio($fieldName, $fieldValue['title'], $options, NULL, '&nbsp;&nbsp;');
               break;
 
             case 'checkboxes':
index a274b0051cd89bc4136f7b08f56c672822ca46bd..bc0962cf54658cb6d947db601a20d71e6d7c9391 100644 (file)
@@ -55,15 +55,20 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
           'title' => ts('Viewing Contacts'),
           'weight' => 1,
         ),
+        'contact_smart_group_display' => array(
+          'html_type' => 'radio',
+          'title' => ts('Viewing Smart Groups'),
+          'weight' => 2,
+        ),
         'contact_edit_options' => array(
           'html_type' => 'checkboxes',
           'title' => ts('Editing Contacts'),
-          'weight' => 2,
+          'weight' => 3,
         ),
         'advanced_search_options' => array(
           'html_type' => 'checkboxes',
           'title' => ts('Contact Search'),
-          'weight' => 3,
+          'weight' => 4,
         ),
         'activity_assignee_notification' => array(
           'html_type' => 'checkbox',
@@ -73,36 +78,35 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
         'activity_assignee_notification_ics' => array(
           'html_type' => 'checkbox',
           'title' => ts('Include ICal Invite to Activity Assignees'),
-          'weight' => 5,
+          'weight' => 6,
         ),
         'contact_ajax_check_similar' => array(
           'html_type' => 'checkbox',
           'title' => ts('Check for Similar Contacts'),
-          'weight' => 5,
+          'weight' => 7,
         ),
         'user_dashboard_options' => array(
           'html_type' => 'checkboxes',
           'title' => ts('Contact Dashboard'),
-          'weight' => 6,
+          'weight' => 8,
         ),
         'display_name_format' => array(
           'html_type' => 'textarea',
           'title' => ts('Individual Display Name Format'),
-          'weight' => 7,
+          'weight' => 9,
         ),
         'sort_name_format' => array(
           'html_type' => 'textarea',
           'title' => ts('Individual Sort Name Format'),
-          'weight' => 8,
+          'weight' => 10,
         ),
         'editor_id' => array(
           'html_type' => NULL,
-          'weight' => 9,
+          'weight' => 11,
         ),
       ),
     );
 
-
     parent::preProcess();
   }
 
index fbae65ab9f163a1a15e34011726c20143e1d35d5..23eefb88b6fd96e1bfb6a1b1fd741519b57d806d 100644 (file)
       <td class="label">{$form.contact_view_options.label}</td>
       <td>{$form.contact_view_options.html}</td>
     </tr>
+    <tr class="crm-preferences-display-form-block-contact_smart_group_display">
+      <td class="label">{$form.contact_smart_group_display.label}</td>
+      <td>{$form.contact_smart_group_display.html}</td>
+    </tr>
     <tr class="crm-preferences-display-form-block-description">
       <td>&nbsp;</td>
       <td class="description">