Commit 7399a0a6 authored by eileen's avatar eileen

Convert a couple more settings fields.

These are the 2 textarea fields at the end of the display form - sort format & display format.

The text boxes are too small on page load - but this is unchanged IMHO
parent 8f86a6be
......@@ -41,6 +41,8 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
'contact_smart_group_display' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'advanced_search_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() {
......@@ -74,16 +76,6 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
'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,
......@@ -113,13 +105,6 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences {
$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;
}
......
......@@ -210,6 +210,7 @@ trait CRM_Admin_Form_SettingTrait {
'checkbox' => 'CheckBox',
'radio' => 'Radio',
'select' => 'Select',
'textarea' => 'Element',
];
return $mapping[$spec['html_type']];
}
......
......@@ -158,28 +158,26 @@ return array(
'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',
......
......@@ -199,7 +199,7 @@
</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>
......@@ -207,7 +207,7 @@
</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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment