* Base class for settings forms.
*/
class CRM_Admin_Form_Preferences extends CRM_Core_Form {
+
+ use CRM_Admin_Form_SettingTrait;
+
protected $_system = FALSE;
protected $_contactID = NULL;
public $_action = NULL;
$this->_config->contact_id = $this->_contactID;
}
+ $this->addFieldsDefinedInSettingsMetadata();
$settings = Civi::settings();
foreach ($this->_varNames as $groupName => $settingNames) {
foreach ($settingNames as $settingName => $options) {
* This class generates form components for the display preferences.
*/
class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
+
+ protected $_settings = array(
+ 'contact_view_options' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
+ );
+
public function preProcess() {
CRM_Utils_System::setTitle(ts('Settings - Display Preferences'));
$optionValues = CRM_Activity_BAO_Activity::buildOptions('activity_type_id');
$this->_varNames = array(
CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME => array(
- 'contact_view_options' => array(
- 'html_type' => 'checkboxes',
- 'title' => ts('Viewing Contacts'),
- 'weight' => 1,
- ),
'contact_smart_group_display' => array(
'html_type' => 'radio',
'title' => ts('Viewing Smart Groups'),
elseif ($add == 'addCheckBox') {
$this->addCheckBox($setting, ts($props['title']), $options['values'], NULL, CRM_Utils_Array::value('html_attributes', $props), NULL, NULL, [' ']);
}
+ elseif ($add == 'addCheckBoxes') {
+ $options = array_flip($options['values']);
+ $newOptions = [];
+ foreach ($options as $key => $val) {
+ $newOptions[$key] = $val;
+ }
+ $this->addCheckBox($setting,
+ $props['title'],
+ $newOptions,
+ NULL, NULL, NULL, NULL,
+ [' ', ' ', '<br/>']
+ );
+ }
elseif ($add == 'addChainSelect') {
$this->addChainSelect($setting, [
'label' => ts($props['title']),
'group' => 'core',
'name' => 'contact_view_options',
'type' => 'String',
+ 'quick_form_type' => 'CheckBoxes',
'html_type' => 'checkboxes',
'pseudoconstant' => array(
'optionGroupName' => 'contact_view_options',
),
'default' => '\ 11\ 12\ 13\ 14\ 15\ 16\ 17\ 18\ 19\ 110\ 111\ 113\ 1',
'add' => '4.1',
- 'title' => 'Viewing Contacts',
+ 'title' => ts('Viewing Contacts'),
'is_domain' => '1',
'is_contact' => 0,
- 'description' => NULL,
+ 'description' => ts("Select the tabs that should be displayed when viewing a contact record. EXAMPLE: If your organization does not keep track of 'Relationships', then un-check this option to simplify the screen display. Tabs for Contributions, Pledges, Memberships, Events, Grants and Cases are also hidden if the corresponding component is not enabled. Go to Administer > System Settings > Enable Components to modify the components which are available for your site."),
'help_text' => NULL,
),
'contact_edit_options' => array(