From 293f570b64abf2875efe0f3d8f676774a154665d Mon Sep 17 00:00:00 2001 From: oleonard Date: Sat, 3 Sep 2005 18:33:15 +0000 Subject: [PATCH] Moving HTML out of the script, passing variables instead to the template. Adding toggle variable for alternating row colors --- reports/reservereport.pl | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/reports/reservereport.pl b/reports/reservereport.pl index 9cf2ba561a..447a03efd1 100755 --- a/reports/reservereport.pl +++ b/reports/reservereport.pl @@ -22,7 +22,7 @@ use strict; use C4::Stats; -use Date::Manip; +use C4::Date; use CGI; use C4::Output; use HTML::Template; @@ -46,16 +46,20 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( my ( $count, $data ) = unfilledreserves(); my @dataloop; +my $toggle; for ( my $i = 0 ; $i < $count ; $i++ ) { - my %line; - $line{name} = "

[$i]->{'borrowernumber'}\">$data->[$i]->{'surname'}\, $data->[$i]->{'firstname'}

"; - $line{'reservedate'} = $data->[$i]->{'reservedate'}; - $line{'title'} = "

[$i]->{'biblionumber'}\">$data->[$i]->{'title'}

"; #manky - $line{'classification'} = "$data->[$i]->{'classification'}$data->[$i]->{'dewey'}"; - $line{'status'} = $data->[$i]->{'found'}; - -warn "status : $line{'status'} \n"; + $toggle = $i%2 ? 0 : 1; + $line{'borrowernumber'} = $data->[$i]->{'borrowernumber'}; + $line{'surname'} = $data->[$i]->{'surname'}; + $line{'firstname'} = $data->[$i]->{'firstname'}; + $line{'reservedate'} = format_date($data->[$i]->{'reservedate'}); + $line{'biblionumber'} = $data->[$i]->{'biblionumber'}; + $line{'title'} = $data->[$i]->{'title'}; + $line{'classification'} = $data->[$i]->{'classification'}; + $line{'dewey'} = $data->[$i]->{'dewey'}; + $line{'status'} = $data->[$i]->{'found'}; + $line{'toggle'} = $toggle; push( @dataloop, \%line ); } -- 2.39.5