[Patches] [PATCH] Bug 5543 - Date ISO format wrong separator

koha-patchbot at kohaaloha.com koha-patchbot at kohaaloha.com
Tue Dec 13 22:05:08 NZDT 2011


From: Owen Leonard <oleonard at myacpl.org>
Date: Wed, 7 Dec 2011 12:18:53 -0500
Subject: [PATCH] Bug 5543 - Date ISO format wrong separator

This patch converts the changes in Fridolyn SOMERS patch
to T:T and adds an update to the database to correct
the description there.

Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
---
 installer/data/mysql/sysprefs.sql                  |    2 +-
 installer/data/mysql/updatedatabase.pl             |    8 ++++++++
 .../intranet-tmpl/prog/en/includes/date-format.inc |    2 +-
 .../en/modules/admin/preferences/i18n_l10n.pref    |    2 +-
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql
index ae2c1cb..32860b7 100755
--- a/installer/data/mysql/sysprefs.sql
+++ b/installer/data/mysql/sysprefs.sql
@@ -139,7 +139,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ThingISBN',0,'Use with FRBRizeEditions. If ON, Koha will use the ThingISBN web service in the Editions tab on the detail pages.','','YesNo');
 
 -- I18N/L10N
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('dateformat','us','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy/mm/dd)','metric|us|iso','Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('dateformat','us','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd)','metric|us|iso','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opaclanguages','en','Set the default language in the OPAC.',NULL,'Languages');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opaclanguagesdisplay',0,'If ON, enables display of Change Language feature on OPAC','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowersTitles','Mr|Mrs|Miss|Ms','Define appropriate Titles for patrons',NULL,'free');
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 0063a75..4ebf26a 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -4578,6 +4578,14 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.06.02.XXX";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("UPDATE  `systempreferences` SET  `explanation` = 'Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd)' WHERE `systempreferences`.`variable` =  'dateformat'");
+    print "Correcting the description of ISO format in the dateformat system preference.";
+    SetVersion($DBversion);
+}
+
+
 =head1 FUNCTIONS
 
 =head2 DropAllForeignKeys($table)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc
index 5ef0d79..8aafb04 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/date-format.inc
@@ -1 +1 @@
-[% IF ( dateformat_us ) %](MM/DD/YYYY)[% ELSIF ( dateformat_metric ) %](DD/MM/YYYY)[% ELSE %](YYYY/MM/DD)[% END %]
\ No newline at end of file
+[% IF ( dateformat_us ) %](MM/DD/YYYY)[% ELSIF ( dateformat_metric ) %](DD/MM/YYYY)[% ELSE %](YYYY-MM-DD)[% END %]
\ No newline at end of file
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 591e6ca..9d409ba 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
@@ -6,7 +6,7 @@ I18N/L10N:
           choices:
               us: mm/dd/yyyy
               metric: dd/mm/yyyy
-              iso: yyyy/mm/dd
+              iso: yyyy-mm-dd
         - .
     -
         - "Enable the following languages on the staff interface:"
-- 
1.7.5.4


More information about the Patches mailing list