From 0f8e6bfb732bdd7656f60bb0bcd9edf5d32beac6 Mon Sep 17 00:00:00 2001 From: oleonard Date: Mon, 26 Jan 2004 19:32:36 +0000 Subject: [PATCH] Added variables available to template: streetaddress, city, phone, cardnumber. Added FIXME comments to sections where HTML should be moved to template --- circ/circulation.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/circ/circulation.pl b/circ/circulation.pl index e75e75716e..9f34ce59fd 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -171,6 +171,10 @@ if ($question) { # Barcode entry box, with hidden inputs attached.... + +# FIXME - How can we move this HTML into the template? Can we create +# arrays of the months, dates, etc and use in the template to +# output the data that's getting built here? my $counter = 1; my $dayoptions = ''; my $monthoptions = ''; @@ -230,6 +234,9 @@ if ($borrower) { my $datedue = $book->{'date_due'}; $dd=format_date($dd); $datedue=~s/-//g; +# FIXME - Instead of declaring the font color here, can we set a variable +# that says 'overdue'? Then the template can check for it: if ($datedue < $todaysdate) { $dd="$dd\n"; } @@ -258,6 +265,7 @@ if ($borrower) { my $pcolor = ''; $datedue=~s/-//g; if ($datedue < $todaysdate) { +# FIXME - See line 233 above regarding overdues $dd="$dd\n"; } ($pcolor eq $linecolor1) ? ($pcolor=$linecolor2) : ($pcolor=$linecolor1); @@ -306,6 +314,10 @@ $template->param( firstname => $borrower->{'firstname'}, surname => $borrower->{'surname'}, categorycode => $borrower->{'categorycode'}, + streetaddress => $borrower->{'streetaddress'}, + city => $borrower->{'city'}, + phone => $borrower->{'phone'}, + cardnumber => $borrower->{'cardnumber'}, question => $question, barcode => $barcode, questionnumber => $questionnumber, @@ -354,6 +366,13 @@ sub fixdate { if (($year eq 0) && ($month eq 0) && ($year eq 0)) { $env{'datedue'}=''; } else { + +# FIXME - Can we set two flags here, one that says 'invalidduedate', so that +# the template can check for it, and then one for a particular message? +# Ex: +# Invalid Due Date Specified. Book was not issued. Never that many days +# in February! + if (($year eq 0) || ($month eq 0) || ($year eq 0)) { $invalidduedate="Invalid Due Date Specified. Book was not issued.

\n"; } else { -- 2.39.5