From fa5183b927ef81236d5d41c988cd52390afe76ba Mon Sep 17 00:00:00 2001 From: tonnesen Date: Fri, 25 Oct 2002 17:23:41 +0000 Subject: [PATCH] New system preference for setting date format when entering patron birth dates. Defaults to non-us if not set. --- memberentry.pl | 11 +++++++++-- newmember.pl | 9 ++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/memberentry.pl b/memberentry.pl index 4fa22b6e62..2681f5c510 100755 --- a/memberentry.pl +++ b/memberentry.pl @@ -16,6 +16,14 @@ my $flagsrequired; $flagsrequired->{borrowers}=1; my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired); +my %systemprefs=systemprefs(); +my $dateformat=$systemprefs{'dateformat'}; +($dateformat) || ($dateformat='nonus'); +my $datehintstring=''; +($dateformat eq 'US') ? ($datehintstring="mm/dd/yy") : ($datehintstring="dd/mm/yy"); + + + my $member=$input->param('bornum'); if ($member eq ''){ $member=NewBorrowerNumber(); @@ -54,7 +62,6 @@ if ($type eq 'Add'){ } my $cardnumber=$data->{'cardnumber'}; -my %systemprefs=systemprefs(); # FIXME # This logic should probably be moved out of the presentation code. # Not tonight though. @@ -124,7 +131,7 @@ if ($data->{'sex'} eq 'M'){ } print <M -    Date of Birth (dd/mm/yy) +    Date of Birth ($datehintstring) diff --git a/newmember.pl b/newmember.pl index 944482ff8d..3a0d0f12a5 100755 --- a/newmember.pl +++ b/newmember.pl @@ -5,11 +5,18 @@ use strict; use C4::Output; use C4::Input; -use C4::Input; use C4::Auth; +use C4::Search; # Only used for systemprefs, remove when switching to Context use CGI; use Date::Manip; + +my %systemprefs=systemprefs(); +my $dateformat=$systemprefs{'dateformat'}; +($dateformat) || ($dateformat='nonus'); +Date_Init("DateFormat=$dateformat"); + + my %env; my $input = new CGI; my $flagsrequired; -- 2.39.5