From ee5ba729f39e7958dd80eda30715c3bb2c774a0e Mon Sep 17 00:00:00 2001 From: tonnesen Date: Fri, 26 Jan 2001 00:17:00 +0000 Subject: [PATCH] Returns module lists recently returned items, cookies used to store branch and printer preferences. --- C4/Circulation/Circ2.pm | 13 ++- circ/circulation.pl | 207 ++++++++++++++++++++++++++++++---------- 2 files changed, 170 insertions(+), 50 deletions(-) diff --git a/C4/Circulation/Circ2.pm b/C4/Circulation/Circ2.pm index 1dc21055c1..0913771a80 100755 --- a/C4/Circulation/Circ2.pm +++ b/C4/Circulation/Circ2.pm @@ -137,8 +137,15 @@ sub getiteminformation { $sth->execute; my $iteminformation=$sth->fetchrow_hashref; $sth->finish; + if ($iteminformation) { + $sth=$dbh->prepare("select date_due from issues where itemnumber=$iteminformation->{'itemnumber'} and isnull(returndate)"); + $sth->execute; + my ($date_due) = $sth->fetchrow; + $iteminformation->{'date_due'}=$date_due; + $sth->finish; + $iteminformation->{'dewey'}=~s/0*$//; + } $dbh->disconnect; - $iteminformation->{'dewey'}=~s/0*$//; return($iteminformation); } @@ -189,6 +196,10 @@ sub issuebook { $rejected=sprintf "Patron owes \$%.02f.", $amount; last SWITCH; } + unless ($iteminformation) { + $rejected="$barcode is not a valid barcode."; + last SWITCH; + } if ($iteminformation->{'notforloan'} == 1) { $rejected="Item not for loan."; last SWITCH; diff --git a/circ/circulation.pl b/circ/circulation.pl index a838c7be75..f66b32d3d6 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -7,16 +7,48 @@ use DBI; my %env; +my $headerbackgroundcolor='#990000'; my $query=new CGI; -print $query->header; -print startpage(); -print startmenu('circulation'); my $branches=getbranches(\%env); my $printers=getprinters(\%env); my $branch=$query->param('branch'); my $printer=$query->param('printer'); +($branch) || ($branch=$query->cookie('branch')); +($printer) || ($printer=$query->cookie('printer')); +my ($oldbranch, $oldprinter); +if ($query->param('selectnewbranchprinter')) { + $oldbranch=$branch; + $oldprinter=$printer; + $branch=''; + $printer=''; +} $env{'branchcode'}=$branch; $env{'printer'}=$printer; +my $branchcount=0; +my $printercount=0; +my $branchoptions; +my $printeroptions; +foreach (keys %$branches) { + (next) unless ($_); + $branchcount++; + my $selected=''; + ($selected='selected') if ($_ eq $oldbranch); + $branchoptions.="