Convert Contact Search to metadata driven
authoreileen <emcnaughton@wikimedia.org>
Mon, 8 Oct 2018 21:00:15 +0000 (22:00 +0100)
committereileen <emcnaughton@wikimedia.org>
Wed, 10 Oct 2018 08:29:13 +0000 (09:29 +0100)
CRM/Admin/Form/Preferences/Display.php
CRM/Admin/Form/SettingTrait.php
settings/Core.setting.php

index 0a078de443b563ba6ea70cad82f409ac5fd3923a..1a23425e274de2af9dec60e7e5c37dbf5f31425d 100644 (file)
@@ -39,6 +39,7 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
   protected $_settings = array(
     'contact_view_options' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
     'contact_smart_group_display' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
+    'advanced_search_options' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
   );
 
   public function preProcess() {
@@ -52,11 +53,6 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
           'title' => ts('Editing Contacts'),
           'weight' => 3,
         ),
-        'advanced_search_options' => array(
-          'html_type' => 'checkboxes',
-          'title' => ts('Contact Search'),
-          'weight' => 4,
-        ),
         'activity_assignee_notification' => array(
           'html_type' => 'checkbox',
           'title' => ts('Notify Activity Assignees'),
index 23c1adb039c63080b37f78dd8ebb20f430e8202f..6a9f7e5f799a2dccd4e983f3d1f4024067a0700a 100644 (file)
@@ -234,7 +234,7 @@ trait CRM_Admin_Form_SettingTrait {
   protected function saveMetadataDefinedSettings($params) {
     $settings = $this->getSettingsToSetByMetadata($params);
     foreach ($settings as $setting => $settingValue) {
-      if ($this->getSettingMetadataItem($setting, 'quick_form_type') === 'CheckBoxes') {
+      if ($this->getQuickFormType($this->getSettingMetadata($setting)) === 'CheckBoxes') {
         $settings[$setting] = array_keys($settingValue);
       }
     }
index fd0c2b2419fe770a1decf336b9db641c0d99eddb..5c279417f75151f20edcef328614c6e6619fa0d2 100644 (file)
@@ -89,6 +89,7 @@ return array(
     'is_domain' => 1,
     'is_contact' => 0,
     'description' => ts('Select the sections that should be included in the Basic and Advanced Search forms. EXAMPLE: If you don\'t track Relationships - then you do not need this section included in the advanced search form. Simplify the form by un-checking this option.'),
+    'serialize' => CRM_Core_DAO::SERIALIZE_SEPARATOR_BOOKEND,
   ),
   'user_dashboard_options' => array(
     'group_name' => 'CiviCRM Preferences',