From 935db49ba8a61d8f34485f657816ad0cd3390398 Mon Sep 17 00:00:00 2001 From: oleonard Date: Wed, 3 Nov 2004 22:40:14 +0000 Subject: [PATCH] Re-adding patrontable subroutine so that borrower flags and waiting item information can be displayed --- circ/circulation.pl | 89 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/circ/circulation.pl b/circ/circulation.pl index 07787f7c0d..fa4553149e 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -74,6 +74,7 @@ if ($query->param('setcookies')) { } my %env; # FIXME env is used as an "environment" variable. Could be dropped probably... + $env{'branchcode'}=$branch; $env{'printer'}=$printer; $env{'queue'}=$printer; @@ -260,6 +261,7 @@ if ($borrowerslist) { } #title +my ($patrontable, $flaginfotable) = patrontable($borrower); my $amountold=$borrower->{flags}->{'CHARGES'}->{'message'}; my @temp=split(/\$/,$amountold); $amountold=$temp[1]; @@ -308,6 +310,93 @@ output_html_with_http_headers $query, $cookie, $template->output; #################################################################### # Extra subroutines,,, +sub patrontable { + my ($borrower) = @_; + my $flags = $borrower->{'flags'}; + my $flaginfotable=''; + my $flaginfotext; + #my $flaginfotext=''; + my $flag; + my $color=''; + foreach $flag (sort keys %$flags) { + warn $flag; +# my @itemswaiting=''; + $flags->{$flag}->{'message'}=~s/\n/
/g; + if ($flags->{$flag}->{'noissues'}) { + $template->param( + noissues => 'true', + ); + if ($flag eq 'GNA'){ + $template->param( + gna => 'true' + ); + } + if ($flag eq 'LOST'){ + $template->param( + lost => 'true' + ); + } + if ($flag eq 'DBARRED'){ + $template->param( + dbarred => 'true' + ); + } + if ($flag eq 'CHARGES') { + $template->param( + charges => 'true', + chargesmsg => $flags->{'CHARGES'}->{'message'} + ); + } + } else { + if ($flag eq 'CHARGES') { + $template->param( + charges => 'true', + chargesmsg => $flags->{'CHARGES'}->{'message'} + ); + } + if ($flag eq 'WAITING') { + my $items=$flags->{$flag}->{'itemlist'}; + my @itemswaiting; + foreach my $item (@$items) { + my ($iteminformation) = getiteminformation(\%env, $item->{'itemnumber'}, 0); + $iteminformation->{'branchname'} = $branches->{$iteminformation->{'holdingbranch'}}->{'branchname'}; + push @itemswaiting, $iteminformation; + } + $template->param( + waiting => 'true', + waitingmsg => $flags->{'WAITING'}->{'message'}, + itemswaiting => \@itemswaiting, + ); + } + if ($flag eq 'ODUES') { + $template->param( + odues => 'true', + oduesmsg => $flags->{'ODUES'}->{'message'} + ); + + my $items=$flags->{$flag}->{'itemlist'}; + { + my @itemswaiting; + foreach my $item (@$items) { + my ($iteminformation) = getiteminformation(\%env, $item->{'itemnumber'}, 0); + push @itemswaiting, $iteminformation; + } + } + if ($query->param('module') ne 'returns'){ + $template->param( nonreturns => 'true' ); + } + } + if ($flag eq 'NOTES') { + $template->param( + notes => 'true', + notesmsg => $flags->{'NOTES'}->{'message'} + ); + } + } + } + return($patrontable, $flaginfotext); +} + sub cuecatbarcodedecode { my ($barcode) = @_; chomp($barcode); -- 2.39.5