From 32306c050aeda15ca04502cf8562f0f54c585bcd Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Wed, 14 Feb 2018 15:41:26 +0000 Subject: [PATCH] Bug 20197: RFC3339 missing from options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The output_pref in Koha::DateUtils has rfc3339 logic, but there is no way to set the system preference to rfc3339. This adds that option. TEST PLAN ---------- 0) back up your DB if you wish. 1) apply this patch. 2) Run the following commands: $ mysql -u koha_kohadev -p > use koha_kohadev; > SELECT options FROM systempreferences WHERE variable='dateformat'; -- no rfc3339 listed. 3) Run the following commands: > quit $ updatedatabase $ mysql -u koha_kohadev -p > use koha_kohadev; > SELECT options FROM systempreferences WHERE variable='dateformat'; -- rfc3339 now listed. 4) Run the following commands: > quit $ reset_all $ mysql -u koha_kohadev -p > use koha_kohadev; > SELECT options FROM systempreferences WHERE variable='dateformat'; -- rfc3339 still listed. 5) Log into the staff client 6) Home -> Administration -> Global System Preferences -> i18n/l10n -- rfc3339 should be listed in the dateformat syspref drop-down. 7) run koha qa test tools 8) restore DB if needed Followed test plan and everything checks out. Syspref appears as another yyy-mm-dd entry though. Signed-off-by: Dilan Johnpullé Signed-off-by: Dilan Johnpullé --- installer/data/mysql/atomicupdate/bug_20197.sql | 1 + installer/data/mysql/sysprefs.sql | 2 +- .../intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_20197.sql diff --git a/installer/data/mysql/atomicupdate/bug_20197.sql b/installer/data/mysql/atomicupdate/bug_20197.sql new file mode 100644 index 0000000..2c2b771 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20197.sql @@ -0,0 +1 @@ +UPDATE systempreferences SET options='metric|us|iso|dmydot|rfc3339' WHERE variable='dateformat'; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 2ea76a4..8b2c765 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -119,7 +119,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'), ('CumulativeRestrictionPeriods',0,NULL,'Cumulate the restriction periods instead of keeping the highest','YesNo'), ('CurrencyFormat','US','US|FR|CH','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\' in \'FR\' or \'360,000.00\' in \'US\'.','Choice'), -('dateformat','us','metric|us|iso|dmydot','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd, dmydot dd.mm.yyyy)','Choice'), +('dateformat','us','metric|us|iso|dmydot|rfc3339','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd [24 hour only] , dmydot dd.mm.yyyy, rfc3339 yyyy-mm-dd)','Choice'), ('DebugLevel','2','0|1|2','Define the level of debugging information sent to the browser when errors are encountered (set to 0 in production). 0=none, 1=some, 2=most','Choice'), ('decreaseLoanHighHolds',NULL,'','Decreases the loan period for items with number of holds above the threshold specified in decreaseLoanHighHoldsValue','YesNo'), ('decreaseLoanHighHoldsControl', 'static', 'static|dynamic', "Chooses between static and dynamic high holds checking", 'Choice'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref index 75e4ba2..bf04aea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref @@ -8,7 +8,9 @@ I18N/L10N: metric: dd/mm/yyyy dmydot: dd.mm.yyyy iso: yyyy-mm-dd + rfc3339: yyyy-mm-dd - . Note: Do not change this preference on a production server with overdue items that are accruing fines. Doing so will result in duplicate fines! + - . ISO dateformats should be 24 hour time formats only. - - Format times in - pref: TimeFormat -- 2.1.4