From 98687d85adc45127c54d93064cb8d1aad1e8a9bf Mon Sep 17 00:00:00 2001 From: oleonard Date: Tue, 19 Jul 2005 18:52:37 +0000 Subject: [PATCH] Synch with rel_2_2: Fixing section that was supposed to allow for alternating table row colors --- circ/circulation.pl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index b471371ea2..63d668eddc 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -195,6 +195,7 @@ if ($borrower) { } } my $od; # overdues + my $i = 0; my $togglecolor; # parses today & build Template array foreach my $book (sort {$b->{'timestamp'} <=> $a->{'timestamp'}} @todaysissues){ @@ -207,21 +208,23 @@ if ($borrower) { } else { $od=0; } - $book->{'od'}=$od; - $book->{'dd'}=$dd; - $book->{'tcolor'}=$togglecolor; - if ($togglecolor) { + if ($i%2) { $togglecolor=0; } else { $togglecolor=1; } + $book->{'togglecolor'} = $togglecolor; + $book->{'od'}=$od; + $book->{'dd'}=$dd; if ($book->{'author'} eq ''){ $book->{'author'}=' '; } push @realtodayissues,$book; + $i++; } # parses previous & build Template array + $i = 0; foreach my $book (sort {$a->{'date_due'} cmp $b->{'date_due'}} @previousissues){ my $dd = $book->{'date_due'}; my $datedue = $book->{'date_due'}; @@ -234,19 +237,19 @@ if ($borrower) { } else { $od = 0; } - $book->{'tcolor'}=$togglecolor; - if ($togglecolor) { + if ($i%2) { $togglecolor=0; } else { $togglecolor=1; } + $book->{'togglecolor'} = $togglecolor; $book->{'dd'}=$dd; $book->{'od'}=$od; - $book->{'tcolor'}=$pcolor; if ($book->{'author'} eq ''){ $book->{'author'}=' '; } - push @realprevissues,$book + push @realprevissues,$book; + $i++; } } -- 2.39.5