From a6c28496e02b785091f58bc1138f67e3259aadde Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 7 Sep 2015 18:48:15 -0700 Subject: [PATCH] CRM-16373 - CRM_Admin_Form_Setting_Date - Don't save through ConfigSetting::add() --- CRM/Admin/Form/Setting/Date.php | 11 +++++------ settings/Localization.setting.php | 20 +++++++++----------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/CRM/Admin/Form/Setting/Date.php b/CRM/Admin/Form/Setting/Date.php index fa068d993d..2fe63dc53a 100644 --- a/CRM/Admin/Form/Setting/Date.php +++ b/CRM/Admin/Form/Setting/Date.php @@ -37,6 +37,11 @@ class CRM_Admin_Form_Setting_Date extends CRM_Admin_Form_Setting { public $_settings = array( + 'dateformatDatetime' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, + 'dateformatFull' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, + 'dateformatPartial' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, + 'dateformatYear' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, + 'dateformatTime' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, 'weekBegins' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, 'dateInputFormat' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, 'timeInputFormat' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, @@ -49,12 +54,6 @@ class CRM_Admin_Form_Setting_Date extends CRM_Admin_Form_Setting { public function buildQuickForm() { CRM_Utils_System::setTitle(ts('Settings - Date')); - $this->addElement('text', 'dateformatDatetime', ts('Complete Date and Time')); - $this->addElement('text', 'dateformatFull', ts('Complete Date')); - $this->addElement('text', 'dateformatPartial', ts('Month and Year')); - $this->addElement('text', 'dateformatYear', ts('Year Only')); - $this->addElement('text', 'dateformatTime', ts('Time Only')); - parent::buildQuickForm(); } diff --git a/settings/Localization.setting.php b/settings/Localization.setting.php index 6e13256108..52ff3ba29e 100644 --- a/settings/Localization.setting.php +++ b/settings/Localization.setting.php @@ -267,12 +267,12 @@ return array( 'name' => 'dateformatDatetime', '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' => 'String', + 'quick_form_type' => 'Element', + 'html_type' => 'text', 'default' => '%B %E%f, %Y %l:%M %P', 'add' => '4.3', - 'title' => 'Complete Date and Time', + 'title' => 'Date Format: Complete Date and Time', 'is_domain' => 1, 'is_contact' => 0, 'description' => '', @@ -284,12 +284,12 @@ return array( 'name' => 'dateformatFull', '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' => 'String', + 'quick_form_type' => 'Element', + 'html_type' => 'text', 'default' => '%B %E%f, %Y', 'add' => '4.3', - 'title' => 'Complete Date', + 'title' => 'Date Format: Complete Date', 'is_domain' => 1, 'is_contact' => 0, 'description' => '', @@ -301,12 +301,12 @@ return array( 'name' => 'dateformatPartial', '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' => 'String', + 'quick_form_type' => 'Element', + 'html_type' => 'text', 'default' => '%B %Y', 'add' => '4.3', - 'title' => 'Month and Year', + 'title' => 'Date Format: Month and Year', 'is_domain' => 1, 'is_contact' => 0, 'description' => '', @@ -315,7 +315,6 @@ return array( 'dateformatTime' => array( 'add' => '4.7', 'prefetch' => 1, - 'config_only' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, @@ -336,7 +335,6 @@ return array( 'dateformatYear' => array( 'add' => '4.7', 'prefetch' => 1, - 'config_only' => 1, 'help_text' => NULL, 'is_domain' => 1, 'is_contact' => 0, -- 2.25.1