From 68067f64004f32d172dad59aa3b0164876f437d3 Mon Sep 17 00:00:00 2001 From: rangi Date: Thu, 16 Oct 2003 20:36:25 +0000 Subject: [PATCH] Fix for bug 436, thanks to Pierre --- circ/circulation.pl | 103 ++++++++++-------- .../default/en/circ/circulation.tmpl | 49 ++++++++- 2 files changed, 100 insertions(+), 52 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 320dbf0031..0a898a9262 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -296,6 +296,7 @@ $template->param( author => $iteminformation->{'author'}, firstname => $borrower->{'firstname'}, surname => $borrower->{'surname'}, + categorycode => $borrower->{'categorycode'}, question => $question, barcode => $barcode, questionnumber => $questionnumber, @@ -308,11 +309,8 @@ $template->param( message => $message, CGIselectborrower => $CGIselectborrower, - patrontable => $patrontable, - flaginfotable => $flaginfotable, - CHARGES => $flags->{'CHARGES'}, amountold => $amountold, - todayissues => \@realtodayissues, + todayissues => \@realtodayissues, previssues => \@realprevissues ); @@ -366,61 +364,74 @@ sub patrontable { my ($borrower) = @_; my $flags = $borrower->{'flags'}; my $flaginfotable=''; - my $flaginfotext=''; + my $flaginfotext; + #my $flaginfotext=''; my $flag; my $color=''; foreach $flag (sort keys %$flags) { + warn $flag; + my @itemswaiting=''; ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); $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\n"; - } else { - $flaginfotext.="$flag$flags->{$flag}->{'message'}\n"; - } + $template->param( + noissues => 'true', + color => $color, + ); + if ($flag eq 'CHARGES') { + $template->param( + charges => 'true', + chargesmsg => $flags->{'CHARGES'}->{'message'} + ); + } } else { - if ($flag eq 'CHARGES') { - $flaginfotext.="$flag $flags->{$flag}->{'message'} {'borrowernumber'} onClick=\"openWindow(this, 'Payment', 480,640)\">Payment\n"; - } elsif ($flag eq 'WAITING') { - my $itemswaiting=''; - my $items=$flags->{$flag}->{'itemlist'}; - foreach my $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"; + if ($flag eq 'CHARGES') { + $template->param( + charges => 'true', + chargesmsg => $flags->{'CHARGES'}->{'message'} + ); } - $flaginfotext.="$flag$itemswaiting\n"; - } elsif ($flag eq 'ODUES') { - my $items=$flags->{$flag}->{'itemlist'}; - my $itemswaiting="\n"; - my $currentcolor=$color; - { - my $color=$currentcolor; - foreach my $item (@$items) { - ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); + if ($flag eq 'WAITING') { + my $items=$flags->{$flag}->{'itemlist'}; + foreach my $item (@$items) { my ($iteminformation) = getiteminformation(\%env, $item->{'itemnumber'}, 0); - $itemswaiting.="\n"; - } + $iteminformation->{'branchname'} = $branches->{$iteminformation->{'holdingbranch'}}->{'branchname'}; + push @itemswaiting, $iteminformation; + } + $template->param( + waiting => 'true', + waitingmsg => $flags->{'WAITING'}->{'message'}, + itemswaiting => \@itemswaiting, + ); } - $itemswaiting.="
$iteminformation->{'date_due'}{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$iteminformation->{'barcode'}$iteminformation->{'title'}
\n"; - if ($query->param('module') ne 'returns'){ - $flaginfotext.="$flag$flags->{$flag}->{'message'}, See below\n"; - } else { - $flaginfotext.="$flag$flags->{$flag}->{'message'}\n"; + if ($flag eq 'ODUES') { + $template->param( + odues => 'true', + oduesmsg => $flags->{'ODUES'}->{'message'} + ); + + my $items=$flags->{$flag}->{'itemlist'}; + my $currentcolor=$color; + { + my $color=$currentcolor; + foreach my $item (@$items) { + ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); + 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'} + ); } - } else { - $flaginfotext.="$flag$flags->{$flag}->{'message'}\n"; - } } } - ($flaginfotext) && ($flaginfotext="Flags$flaginfotext\n"); - $flaginfotext.=""; - my $patrontable= << "EOF"; -

- - - -EOF return($patrontable, $flaginfotext); } diff --git a/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl index fbaa562d78..170a765339 100644 --- a/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/circ/circulation.tmpl @@ -163,12 +163,9 @@ - - - - - - +
Patron Information
- {'borrowernumber'} onClick="openWindow(this,'Member', 480, 640)">$borrower->{'cardnumber'} $borrower->{'surname'}, $borrower->{'title'} $borrower->{'firstname'}
$borrower->{'streetaddress'} $borrower->{'city'} Cat: $borrower->{'categorycode'}
+ + +
@@ -221,7 +218,47 @@
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Patron information
+ " onClick="openWindow(this,'Member', 480, 640)"> + +
Catégorie: +
CHARGES> onClick=\"openWindow(this, 'Payment', 480,640)\">Payment
CHARGES onClick=\"openWindow(this, 'Payment', 480,640)\">Payment
WAITING + + &type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">} ()
+
+
ODUESYes, See below
NOTES
+ +



-- 2.39.5