CRM-16373 - CRM_Admin_Form_Setting_Date - Don't save through ConfigSetting::add()
authorTim Otten <totten@civicrm.org>
Tue, 8 Sep 2015 01:48:15 +0000 (18:48 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 17 Sep 2015 22:49:28 +0000 (15:49 -0700)
CRM/Admin/Form/Setting/Date.php
settings/Localization.setting.php

index fa068d993dfbdaf5115797f736ff0f93fe2c24e4..2fe63dc53a955746d4a52439a1f02b15838abbd0 100644 (file)
 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();
   }
 
index 6e13256108b1e1349a071eb8da73cf2be460a317..52ff3ba29e2ffc63aa88bd31ba44b426b6f11289 100644 (file)
@@ -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,