Skip to content

Commit

Permalink
Merge pull request civicrm#12925 from eileenmcnaughton/setting
Browse files Browse the repository at this point in the history
Setting conversion
  • Loading branch information
eileenmcnaughton authored Oct 24, 2018
2 parents 331a021 + 94b60b6 commit a65a969
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 32 deletions.
26 changes: 4 additions & 22 deletions CRM/Admin/Form/Preferences/Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
'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,
'user_dashboard_options' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'preserve_activity_tab_filter' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'display_name_format' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'sort_name_format' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
);

public function preProcess() {
Expand Down Expand Up @@ -69,21 +72,7 @@ public function preProcess() {
'weight' => 8,
'html_type' => NULL,
),
'user_dashboard_options' => array(
'html_type' => 'checkboxes',
'title' => ts('Contact Dashboard'),
'weight' => 9,
),
'display_name_format' => array(
'html_type' => 'textarea',
'title' => ts('Individual Display Name Format'),
'weight' => 10,
),
'sort_name_format' => array(
'html_type' => 'textarea',
'title' => ts('Individual Sort Name Format'),
'weight' => 11,
),

'editor_id' => array(
'html_type' => NULL,
'weight' => 12,
Expand Down Expand Up @@ -113,13 +102,6 @@ public function setDefaultValues() {
$defaults = parent::setDefaultValues();
parent::cbsDefaultValues($defaults);

if ($this->_config->display_name_format) {
$defaults['display_name_format'] = $this->_config->display_name_format;
}
if ($this->_config->sort_name_format) {
$defaults['sort_name_format'] = $this->_config->sort_name_format;
}

return $defaults;
}

Expand Down
1 change: 1 addition & 0 deletions CRM/Admin/Form/SettingTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ protected function getQuickFormType($spec) {
'checkbox' => 'CheckBox',
'radio' => 'Radio',
'select' => 'Select',
'textarea' => 'Element',
];
return $mapping[$spec['html_type']];
}
Expand Down
13 changes: 6 additions & 7 deletions settings/Core.setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@
'title' => ts('Contact Dashboard'),
'is_domain' => 1,
'is_contact' => 0,
'description' => NULL,
'description' => ts('Select the sections that should be included in the Contact Dashboard. EXAMPLE: If you don\'t want constituents to view their own contribution history, un-check that option.'),
'help_text' => NULL,
'serialize' => CRM_Core_DAO::SERIALIZE_SEPARATOR_BOOKEND,
),
'address_options' => array(
'group_name' => 'CiviCRM Preferences',
Expand Down Expand Up @@ -158,28 +159,26 @@
'group' => 'core',
'name' => 'display_name_format',
'type' => 'String',
'html_type' => 'Text',
'html_type' => 'textarea',
'default' => '{contact.individual_prefix}{ }{contact.first_name}{ }{contact.last_name}{ }{contact.individual_suffix}',
'add' => '4.1',
'title' => ts('Individual Display Name Format'),
'is_domain' => 1,
'is_contact' => 0,
'description' => NULL,
'help_text' => NULL,
'description' => ts('Display name format for individual contact display names.'),
),
'sort_name_format' => array(
'group_name' => 'CiviCRM Preferences',
'group' => 'core',
'name' => 'sort_name_format',
'type' => 'String',
'html_type' => 'Text',
'html_type' => 'textarea',
'default' => '{contact.last_name}{, }{contact.first_name}',
'add' => '4.1',
'title' => ts('Individual Sort Name Format'),
'is_domain' => 1,
'is_contact' => 0,
'description' => NULL,
'help_text' => NULL,
'description' => ts('Sort name format for individual contact display names.'),
),
'remote_profile_submissions' => array(
'group_name' => 'CiviCRM Preferences',
Expand Down
6 changes: 3 additions & 3 deletions templates/CRM/Admin/Form/Preferences/Display.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
<tr class="crm-preferences-display-form-block-description">
<td>&nbsp;</td>
<td class="description">
{ts}Select the sections that should be included in the Contact Dashboard. EXAMPLE: If you don't want constituents to view their own contribution history, un-check that option.{/ts}
{$settings_fields.user_dashboard_options.description}
</td>
</tr>
<tr class="crm-preferences-display-form-block-editor_id">
Expand Down Expand Up @@ -199,15 +199,15 @@
</tr>
<tr class="crm-preferences-display-form-block-description">
<td>&nbsp;</td>
<td class="description">{ts}Display name format for individual contact display names.{/ts}</td>
<td class="description">{$settings_fields.display_name_format.description}</td>
</tr>
<tr class="crm-preferences-display-form-block-sort_name_format">
<td class="label">{$form.sort_name_format.label}</td>
<td>{$form.sort_name_format.html}</td>
</tr>
<tr class="crm-preferences-display-form-block-description">
<td>&nbsp;</td>
<td class="description">{ts}Sort name format for individual contact display names.{/ts}</td>
<td class="description">{$settings_fields.sort_name_format.description}</td>
</tr>
</table>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
Expand Down

0 comments on commit a65a969

Please sign in to comment.