From c3bc1eafe92f49b14849cafb91ceb6ccac188ba8 Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Sun, 16 Aug 2015 14:47:06 +1200 Subject: [PATCH] CRM-17023 declare relevant settings metadata --- CRM/Admin/Form/Setting/Search.php | 5 +- settings/Search.setting.php | 146 ++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+), 4 deletions(-) diff --git a/CRM/Admin/Form/Setting/Search.php b/CRM/Admin/Form/Setting/Search.php index 7662dcfd41..c5824fe865 100644 --- a/CRM/Admin/Form/Setting/Search.php +++ b/CRM/Admin/Form/Setting/Search.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** @@ -46,12 +44,11 @@ class CRM_Admin_Form_Setting_Search extends CRM_Admin_Form_Setting { /** * Build the form object. - * - * @return void */ public function buildQuickForm() { CRM_Utils_System::setTitle(ts('Settings - Search Preferences')); + // @todo remove the following adds in favour of setting via the settings array (above). $this->addYesNo('includeWildCardInName', ts('Automatic Wildcard')); $this->addYesNo('includeEmailInName', ts('Include Email')); $this->addYesNo('includeNickNameInName', ts('Include Nickname')); diff --git a/settings/Search.setting.php b/settings/Search.setting.php index a2324b7dc4..57809ac858 100644 --- a/settings/Search.setting.php +++ b/settings/Search.setting.php @@ -112,4 +112,150 @@ return array( 'description' => 'If disabled, the search results will not be ordered. This may improve response time on search results on large datasets', 'help_text' => NULL, ), + 'includeWildCardInName' => array( + 'group_name' => 'Search Preferences', + 'group' => 'Search Preferences', + 'name' => 'includeWildCardInName', + 'prefetch' => 1, + // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent + 'config_only' => 1, + //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value + 'type' => 'Boolean', + 'quick_form_type' => 'YesNo', + 'default' => 1, + 'add' => '4.6', + 'title' => 'Automatic Wildcard', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => "If enabled, wildcards are automatically added to the beginning AND end of the search term when users search for contacts by Name. EXAMPLE: Searching for 'ada' will return any contact whose name includes those letters - e.g. 'Adams, Janet', 'Nadal, Jorge', etc. If disabled, a wildcard is added to the end of the search term only. EXAMPLE: Searching for 'ada' will return any contact whose last name begins with those letters - e.g. 'Adams, Janet' but NOT 'Nadal, Jorge'. Disabling this feature will speed up search significantly for larger databases, but users must manually enter wildcards ('%' or '_') to the beginning of the search term if they want to find all records which contain those letters. EXAMPLE: '%ada' will return 'Nadal, Jorge'.", + 'help_text' => NULL, + ), + 'includeEmailInName' => array( + 'group_name' => 'Search Preferences', + 'group' => 'Search Preferences', + 'name' => 'includeEmailInName', + 'prefetch' => 1, + // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent + 'config_only' => 1, + //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value + 'type' => 'Boolean', + 'quick_form_type' => 'YesNo', + 'default' => 1, + 'add' => '4.6', + 'title' => 'Include Email', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => 'If enabled, email addresses are automatically included when users search by Name. Disabling this feature will speed up search significantly for larger databases, but users will need to use the Email search fields (from Advanced Search, Search Builder, or Profiles) to find contacts by email address.', + 'help_text' => NULL, + ), + 'includeNickNameInName' => array( + 'group_name' => 'Search Preferences', + 'group' => 'Search Preferences', + 'name' => 'includeNickNameInName', + 'prefetch' => 1, + // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent + 'config_only' => 1, + //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value + 'type' => 'Boolean', + 'quick_form_type' => 'YesNo', + 'default' => 1, + 'add' => '4.6', + 'title' => 'Include Nickname', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => 'If enabled, nicknames are automatically included when users search by Name.', + 'help_text' => NULL, + ), + 'includeAlphabeticalPager' => array( + 'group_name' => 'Search Preferences', + 'group' => 'Search Preferences', + 'name' => 'includeAlphabeticalPager', + 'prefetch' => 1, + // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent + 'config_only' => 1, + //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value + 'type' => 'Boolean', + 'quick_form_type' => 'YesNo', + 'default' => 1, + 'add' => '4.6', + 'title' => 'Include Alphabetical Pager', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => 'If disabled, the alphabetical pager will not be displayed on the search screens. This will improve response time on search results on large datasets.', + 'help_text' => NULL, + ), + 'smartGroupCacheTimeout' => array( + 'group_name' => 'Search Preferences', + 'group' => 'Search Preferences', + 'name' => 'smartGroupCacheTimeout', + 'prefetch' => 1, + // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent + 'config_only' => 1, + //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value + 'type' => 'Integer', + 'quick_form_type' => 'Text', + 'default' => 1, + 'add' => '4.6', + 'title' => 'Smart group cache timeout', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => 'The number of minutes to cache smart group contacts. We strongly recommend that this value be greater than zero, since a value of zero means no caching at all. If your contact data changes frequently, you should set this value to at least 5 minutes.', + 'help_text' => NULL, + ), + 'defaultSearchProfileID' => array( + 'group_name' => 'Search Preferences', + 'group' => 'Search Preferences', + 'name' => 'defaultSearchProfileID', + 'prefetch' => 1, + // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent + 'config_only' => 1, + //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value + 'type' => 'Integer', + 'quick_form_type' => 'Text', + 'default' => 1, + 'add' => '4.6', + 'title' => 'Default Contact Search Profile', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => 'If set, this will be the default profile used for contact search.', + 'help_text' => NULL, + ), + 'autocompleteContactSearch' => array( + 'group_name' => 'Search Preferences', + 'group' => 'Search Preferences', + 'name' => 'autocompleteContactSearch', + 'prefetch' => 1, + // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent + 'config_only' => 1, + //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value + 'type' => 'Integer', + 'quick_form_type' => 'CheckBox', + 'default' => 1, + 'add' => '4.6', + 'title' => 'Autocomplete Contact Search', + 'pseudoconstant' => array('optionGroupName' => 'contact_autocomplete_options'), + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => "Selected fields will be displayed in back-office autocomplete dropdown search results (Quick Search, etc.). Contact Name is always included.", + 'help_text' => NULL, + ), + 'autocompleteContactReference' => array( + 'group_name' => 'Search Preferences', + 'group' => 'Search Preferences', + 'name' => 'autocompleteContactReference', + 'prefetch' => 1, + // prefetch causes it to be cached in config settings. Usually this is a transitional setting. Some things like urls are permanent. Remove this comment if you have assessed & it should be permanent + 'config_only' => 1, + //@todo - see https://wiki.civicrm.org/confluence/display/CRMDOC/Settings+Reference#SettingsReference-Convertingaconfigobjecttoasetting on removing this deprecated value + 'type' => 'Integer', + 'quick_form_type' => 'CheckBox', + 'default' => 1, + 'add' => '4.6', + 'title' => 'Contact Reference Options', + 'pseudoconstant' => array('optionGroupName' => 'contact_reference_options'), + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => "Selected fields will be displayed in autocomplete dropdown search results for 'Contact Reference' custom fields. Contact Name is always included. NOTE: You must assign 'access contact reference fields' permission to the anonymous role if you want to use custom contact reference fields in profiles on public pages. For most situations, you should use the 'Limit List to Group' setting when configuring a contact reference field which will be used in public forms to prevent exposing your entire contact list.", + 'help_text' => NULL, + ), ); -- 2.25.1