From e371a7114f9b4fb1b01f8875548b89dcb20938d2 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Wed, 31 Jan 2001 18:14:34 +0000 Subject: [PATCH] Mostly just look changes, got rid of table borders, alternating colors on table rows. Some fixes to returned items in returns module. --- circ/circulation.pl | 279 +++++++++++++++++++++++++++++++++----------- 1 file changed, 214 insertions(+), 65 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index f66b32d3d6..5a6d8f8554 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -8,6 +8,10 @@ use DBI; my %env; my $headerbackgroundcolor='#990000'; +my $circbackgroundcolor='#555555'; +my $circbackgroundcolor='#550000'; +my $linecolor1='#bbbbbb'; +my $linecolor2='#dddddd'; my $query=new CGI; my $branches=getbranches(\%env); my $printers=getprinters(\%env); @@ -30,6 +34,7 @@ my $branchoptions; my $printeroptions; foreach (keys %$branches) { (next) unless ($_); + (next) if (/^TR$/); $branchcount++; my $selected=''; ($selected='selected') if ($_ eq $oldbranch); @@ -69,21 +74,25 @@ print startmenu('circulation'); print << "EOF";

- +
- - - - + + + + + + +
$branchname
- - -
-Set Branch/Printer -
-
$printername
-
$branchname + + + Branch/Printer + + +$printername
+ +
EOF @@ -99,7 +108,7 @@ if ($printer && $branch) { my ($printerform, $branchform); if ($printercount>1) { $printerform=<<"EOF"; - +
\n"; } else { - $flaginfotext.="\n"; + $flaginfotext.="\n"; } } } - ($flaginfotext) && ($flaginfotext="
Choose a Printer
+
\n"; - $previssues.="\n"; + $previssues.="\n"; } my $todaysissues=''; + $color=''; foreach (sort keys %$today) { + ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); my $bookissue=$today->{$_}; - $todaysissues.="\n"; + $todaysissues.="\n"; } for ($i=1; $i<32; $i++) { my $selected=''; @@ -461,16 +576,24 @@ EOF my ($patrontable, $flaginfotable) = patrontable($borrower); print << "EOF"; -
Choose a Branch
Circulation - Returns
+EOF foreach ($query->param) { (next) unless (/ri-(\d*)/); my $counter=$1; (next) if ($counter>20); my $barcode=$query->param("ri-$counter"); + my $duedate=$query->param("dd-$counter"); + my $borrowernumber=$query->param("bn-$counter"); $counter++; $returneditems{$counter}=$barcode; + $riduedate{$counter}=$duedate; + $riborrowernumber{$counter}=$borrowernumber; $ritext.="\n"; + $ritext.="\n"; + $ritext.="\n"; } if (my $barcode=$query->param('barcode')) { $ritext.="\n"; $returneditems{0}=$barcode; } - print << "EOF"; + my $barcodeentrytext= << "EOF";
- - +
Returns
Enter Book Barcode
+
Enter Book Barcode
Item Barcode:
$ritext -
EOF - if (my $barcode=$query->param('barcode')) { + if ((my $barcode=$query->param('barcode')) || (%returneditems)) { my ($iteminformation, $borrower, $messages, $overduecharge) = returnbook(\%env, $barcode); + (my $nosuchitem=1) unless ($iteminformation); + $riborrowernumber{0}=$borrower->{'borrowernumber'}; + $riduedate{0}=$iteminformation->{'date_due'}; + $barcodeentrytext.= "{'date_due'}>\n"; + $barcodeentrytext.= "{'borrowernumber'}>\n"; + my @datearr = localtime(time()); + my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); my $itemtable=<<"EOF"; - - +
Item Information
+
Returned Item Information
Title: $iteminformation->{'title'}
Author: $iteminformation->{'author'}
@@ -195,9 +219,30 @@ Date Due: $iteminformation->{'date_due'}
EOF - if ($nosuchitem) { + if ($messages) { + my $messagetext=''; + foreach (@$messages) { + $messagetext.="$_

\n"; + } print << "EOF"; - +
+ + +
Messages
+$messagetext +
+

+EOF + } + if (($nosuchitem) && ($barcode)) { + print << "EOF"; + + + + + +
+ $barcodeentrytext + +
Error
@@ -207,14 +252,58 @@ EOF
+
+EOF + } elsif ($nosuchitem) { + print << "EOF"; + + + + +
+ $barcodeentrytext +
EOF } else { - if ($borrower) { + if ($borrower->{'borrowernumber'}) { my ($patrontable, $flaginfotext) = patrontable($borrower); - print "


$patrontable$flaginfotext
$itemtable

\n"; + print << "EOF"; + + + + + + + + +
+ $barcodeentrytext + + $itemtable +
+ + + + +
+ $patrontable + + $flaginfotext +
+
+
+EOF } else { print << "EOF"; - +
+ + + +
+ $barcodeentrytext + + +
Error
@@ -224,27 +313,49 @@ EOF
+
EOF } } print << "EOF";

-


-

- - - +
Returned Items
Bar CodeTitleAuthorClass
+ + EOF + my $color=''; foreach (sort {$a <=> $b} keys %returneditems) { + ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); my $barcode=$returneditems{$_}; - my ($iteminformation) = getiteminformation(\$env, 0, $barcode); - print "\n"; + my $duedate=$riduedate{$_}; + my @datearr = localtime(time()); + my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); + my $overduetext="$duedate"; + ($overduetext="$duedate") if ($duedate lt $todaysdate); + ($duedate) || ($overduetext=""); + my $borrowernumber=$riborrowernumber{$_}; + my ($borrower) = getpatroninformation(\%env,$borrowernumber,0); + my ($iteminformation) = getiteminformation(\%env, 0, $barcode); + print "\n"; } print "
Returned Items
Due DateBar CodeTitleAuthorClassBorrower
{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$barcode$iteminformation->{'title'}$iteminformation->{'author'}$iteminformation->{'dewey'} $iteminformation->{'subclass'}
$overduetext{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$barcode$iteminformation->{'title'}$iteminformation->{'author'}$iteminformation->{'dewey'} $iteminformation->{'subclass'}{'borrowernumber'} onClick=\"openWindow(this,'Member', 480, 640)\">$borrower->{'cardnumber'} $borrower->{'firstname'} $borrower->{'surname'}
\n"; + } else { + print $barcodeentrytext; } + print "\n"; + print "

\n"; } sub issues { + my ($noheader) = shift; + + unless ($noheader) { + print << "EOF"; + +
Circulation - Issues
+EOF + } if (my $borrnumber=$query->param('borrnumber')) { my ($borrower, $flags) = getpatroninformation(\%env,$borrnumber,0); my ($borrower, $flags) = getpatroninformation(\%env,$borrnumber,0); @@ -262,13 +373,13 @@ sub issues { $invalidduedate=1; } else { if (($day>30) && (($month==4) || ($month==6) || ($month==9) || ($month==11))) { - print "Invalid Due Date Specified. Book was not issued.

\n"; + print "Invalid Due Date Specified. Book was not issued. Only 30 days in $month month.

\n"; $invalidduedate=1; } elsif (($day>29) && ($month==2)) { - print "Invalid Due Date Specified. Book was not issued.

\n"; + print "Invalid Due Date Specified. Book was not issued. Never that many days in February!

\n"; $invalidduedate=1; - } elsif (($day>28) && (($year%4) && ((!($year%100) || ($year%400))))) { - print "Invalid Due Date Specified. Book was not issued.

\n"; + } elsif (($month==2) && ($day>28) && (($year%4) && ((!($year%100) || ($year%400))))) { + print "Invalid Due Date Specified. Book was not issued. $year is not a leap year.

\n"; $invalidduedate=1; } else { $env{'datedue'}="$year-$month-$day"; @@ -288,7 +399,7 @@ sub issues { my ($iteminformation, $duedate, $rejected, $question, $questionnumber, $defaultanswer, $message) = issuebook(\%env, $borrower, $barcode, \%responses); unless ($iteminformation) { print << "EOF"; - +
-
Error
@@ -296,15 +407,13 @@ sub issues { $barcode is not a valid barcode.
-
EOF } if ($rejected) { if ($rejected == -1) { } else { print << "EOF" - +
Error Issuing Book
$rejected
@@ -319,7 +428,7 @@ EOF if ($question) { my $stickyduedate=$query->param('stickyduedate'); print << "EOF"; - +
Issuing Question
@@ -371,12 +480,14 @@ EOF
+

EOF return; } if ($message) { print << "EOF"; - +
Message
$message
@@ -404,7 +515,7 @@ EOF } } if ($flaginfotext) { - $flaginfotext="$flaginfotext
Patron Flags
\n"; + $flaginfotext="$flaginfotext
Patron Flags
\n"; } $env{'nottodaysissues'}=1; my ($borrowerissues) = currentissues(\%env, $borrower); @@ -415,21 +526,25 @@ EOF my $previssues=''; my @datearr = localtime(time()); my $todaysdate = (1900+$datearr[5]).sprintf ("%0.2d", ($datearr[4]+1)).sprintf ("%0.2d", $datearr[3]); + my $color=''; foreach (sort keys %$borrowerissues) { + ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); my $bookissue=$borrowerissues->{$_}; my $bgcolor=''; my $datedue=$bookissue->{'date_due'}; + my $dd=$bookissue->{'date_due'}; $datedue=~s/-//g; if ($datedue < $todaysdate) { - $bgcolor="bgcolor=red"; + $dd="$dd\n"; } - #$previssues.="
$bookissue->{'date_due'}$bookissue->{'barcode'}$bookissue->{'title'}$bookissue->{'author'}$bookissue->{'dewey'} $bookissue->{'subclass'}
$bookissue->{'date_due'}{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$bookissue->{'barcode'}$bookissue->{'title'}$bookissue->{'author'}$bookissue->{'dewey'} $bookissue->{'subclass'}
$dd{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$bookissue->{'barcode'}$bookissue->{'title'}$bookissue->{'author'}$bookissue->{'dewey'} $bookissue->{'subclass'}
$bookissue->{'date_due'}{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$bookissue->{'barcode'}$bookissue->{'title'}$bookissue->{'author'}$bookissue->{'dewey'} $bookissue->{'subclass'}
$bookissue->{'date_due'}{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$bookissue->{'barcode'}$bookissue->{'title'}$bookissue->{'author'}$bookissue->{'dewey'} $bookissue->{'subclass'}
+
\n"; + $flaginfotext.="\n"; } else { - $flaginfotext.="\n"; + $flaginfotext.="\n"; } } else { if ($flag eq 'CHARGES') { - $flaginfotext.="\n"; + $flaginfotext.="\n"; + } elsif ($flag eq 'WAITING') { + my $itemswaiting=''; + my $items=$flags->{$flag}->{'itemlist'}; + foreach $item (@$items) { + my ($iteminformation) = getiteminformation($env, $item->{'itemnumber'}, 0); + $itemswaiting.="{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$iteminformation->{'barcode'} $iteminformation->{'title'} ($branches->{$iteminformation->{'holdingbranch'}}->{'branchname'})
\n"; + } + $flaginfotext.="\n"; + } elsif ($flag eq 'ODUES') { + my $items=$flags->{$flag}->{'itemlist'}; + my $itemswaiting="
- +
Enter Book Barcode
@@ -491,7 +614,7 @@ EOF
Item Barcode:
- + + +
+ + + + + +

Sticky Due Date
- +
$todaysissues @@ -500,7 +623,7 @@ EOF
Issues Today
Due DateBar CodeTitleAuthorClass
- +
$previssues @@ -508,6 +631,7 @@ EOF
Previous Issues
Due DateBar CodeTitleAuthorClass
+

EOF } else { @@ -517,20 +641,20 @@ EOF if ($#borrowers == -1) { $query->param('findborrower', ''); print "No borrower matched '$findborrower'

\n"; - issues(); + issues(1); return; } if ($#borrowers == 0) { $query->param('borrnumber', $borrowers[0]->{'borrowernumber'}); - issues(); + issues(1); return; } else { print "\n"; print "\n"; print "\n"; print "\n"; - print ""; - print "\n"; + print "
Issues
Select a borrower
"; + print "\n"; print "
Select a borrower
\n"; print "
"; print "\n"; print "
\n"; + print "

\n"; } } else { print << "EOF"; - - +
Issues
Enter borrower card number
or partial last name
+
Enter borrower card number
or partial last name
+
EOF } } @@ -565,6 +691,7 @@ sub patrontable { my $flaginfotext=''; my $flag; foreach $flag (sort keys %$flags) { + ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); if ($flags->{$flag}->{'noissues'}) { $flagtext.="$flag "; } else { @@ -573,21 +700,43 @@ sub patrontable { $flags->{$flag}->{'message'}=~s/\n/
/g; if ($flags->{$flag}->{'noissues'}) { if ($flag eq 'CHARGES') { - $flaginfotext.="
$flag$flags->{$flag}->{'message'} {'borrowernumber'} onClick=\"openWindow(this, 'Payment', 480,640)\">Payment
$flag$flags->{$flag}->{'message'} {'borrowernumber'} onClick=\"openWindow(this, 'Payment', 480,640)\">Payment
$flag$flags->{$flag}->{'message'}
$flag$flags->{$flag}->{'message'}
$flag$flags->{$flag}->{'message'} {'borrowernumber'} onClick=\"openWindow(this, 'Payment', 480,640)\">Payment
$flag$flags->{$flag}->{'message'} {'borrowernumber'} onClick=\"openWindow(this, 'Payment', 480,640)\">Payment
$flag$flags->{$flag}->{'message'}
$itemswaiting
\n"; + my $currentcolor=$color; + { + my $color=$currentcolor; + foreach $item (@$items) { + ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); + my ($iteminformation) = getiteminformation($env, $item->{'itemnumber'}, 0); + $itemswaiting.="\n"; + } + } + $itemswaiting.="
$iteminformation->{'date_due'}{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$iteminformation->{'barcode'}$iteminformation->{'title'}
\n"; + $flaginfotext.="
$flag$flags->{$flag}->{'message'}
Overdue items can be seen in the Previous Issues table below
$flag$flags->{$flag}->{'message'}
$flag$flags->{$flag}->{'message'}
$flaginfotext
Patron Flags
\n"); + ($flaginfotext) && ($flaginfotext="$flaginfotext
Patron Flags
\n"); my $patrontable= << "EOF"; - +
Patron Information
{'borrowernumber'} onClick="openWindow(this,'Member', 480, 640)">$borrower->{'cardnumber'} $borrower->{'surname'}, $borrower->{'title'} $borrower->{'firstname'}
-- 2.39.5