From 44a82625a1e85b3941d02c2893d70f4fa45935cc Mon Sep 17 00:00:00 2001 From: Frank Dillon Date: Thu, 26 Jul 2007 22:57:40 +0000 Subject: [PATCH] Added Dutch and German date formats to user profile --- docs/upgrades/upgrade_7.3.22-7.4.0.pl | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/upgrades/upgrade_7.3.22-7.4.0.pl b/docs/upgrades/upgrade_7.3.22-7.4.0.pl index 020ce6324..67afc026b 100644 --- a/docs/upgrades/upgrade_7.3.22-7.4.0.pl +++ b/docs/upgrades/upgrade_7.3.22-7.4.0.pl @@ -39,6 +39,7 @@ addFieldsToDatabaseLinks($session); addWikiAttachments($session); addAdminConsoleGroupSettings($session); updateCommerce($session); +updateProfileDateFormats($session); finish($session); # this line required @@ -486,10 +487,29 @@ sub updateCommerce { } } + print "OK!\n" unless $quiet; +} + +#------------------------------------------------- +sub updateProfileDateFormats { + my $session = shift; + my $db = $session->db; + print "\tUpdating Date Formats in User Profile...." unless ($quiet); + + my ($dateFormat) = $db->quickArray("select possibleValues from userProfileField where fieldName='dateFormat'"); + + if($dateFormat) { + #Replace first character with new string + my $newFormats = q|{ +'%d-%m-%y'=>WebGUI::DateTime::epochToHuman("","%d-%m-%y"), +'%d.%m.%y'=>WebGUI::DateTime::epochToHuman("","%d.%m.%y"),|; + + $dateFormat = $newFormats.substr($dateFormat,1,length($dateFormat)); + $db->write("update userProfileField set possibleValues=? where fieldName='dateFormat'",[$dateFormat]); + } print "OK!\n" unless $quiet; } - # ---- DO NOT EDIT BELOW THIS LINE ---- #-------------------------------------------------