3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2015
35 * This class generates form components for Search Parameters
38 class CRM_Admin_Form_Setting_Search
extends CRM_Admin_Form_Setting
{
40 protected $_settings = array(
41 'search_autocomplete_count' => CRM_Core_BAO_Setting
::SEARCH_PREFERENCES_NAME
,
42 'enable_innodb_fts' => CRM_Core_BAO_Setting
::SEARCH_PREFERENCES_NAME
,
43 'includeWildCardInName' => CRM_Core_BAO_Setting
::SEARCH_PREFERENCES_NAME
,
44 'includeEmailInName' => CRM_Core_BAO_Setting
::SEARCH_PREFERENCES_NAME
,
45 'includeNickNameInName' => CRM_Core_BAO_Setting
::SEARCH_PREFERENCES_NAME
,
46 'includeAlphabeticalPager' => CRM_Core_BAO_Setting
::SEARCH_PREFERENCES_NAME
,
47 'includeOrderByClause' => CRM_Core_BAO_Setting
::SEARCH_PREFERENCES_NAME
,
48 'smartGroupCacheTimeout' => CRM_Core_BAO_Setting
::SEARCH_PREFERENCES_NAME
,
49 'defaultSearchProfileID' => CRM_Core_BAO_Setting
::SEARCH_PREFERENCES_NAME
,
53 * Build the form object.
55 public function buildQuickForm() {
56 CRM_Utils_System
::setTitle(ts('Settings - Search Preferences'));
58 // @todo remove the following adds in favour of setting via the settings array (above).
60 // Autocomplete for Contact Search (quick search etc.)
62 ts('Contact Name') => 1,
63 ) +
array_flip(CRM_Core_OptionGroup
::values('contact_autocomplete_options',
66 $this->addCheckBox('autocompleteContactSearch', ts('Autocomplete Contact Search'), $options,
67 NULL, NULL, NULL, NULL, array(' ')
69 $element = $this->getElement('autocompleteContactSearch');
70 $element->_elements
[0]->_flagFrozen
= TRUE;
72 // Autocomplete for Contact Reference (custom fields)
74 ts('Contact Name') => 1,
75 ) +
array_flip(CRM_Core_OptionGroup
::values('contact_reference_options',
78 $this->addCheckBox('autocompleteContactReference', ts('Contact Reference Options'), $optionsCR,
79 NULL, NULL, NULL, NULL, array(' ')
81 $element = $this->getElement('autocompleteContactReference');
82 $element->_elements
[0]->_flagFrozen
= TRUE;
84 parent
::buildQuickForm();
90 public static function getAvailableProfiles() {
91 return array('' => ts('- none -')) + CRM_Core_BAO_UFGroup
::getProfiles(array(