From 719ed44fe6821cf02cb830116930db00a7c858b8 Mon Sep 17 00:00:00 2001 From: rangi Date: Thu, 25 Aug 2005 23:17:26 +0000 Subject: [PATCH] Fixed reserve report script --- reports/reservereport.pl | 50 ++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/reports/reservereport.pl b/reports/reservereport.pl index 35903f1d12..6b84ea7faa 100755 --- a/reports/reservereport.pl +++ b/reports/reservereport.pl @@ -3,7 +3,6 @@ #written 26/4/2000 #script to display reports - # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -27,29 +26,40 @@ use Date::Manip; use CGI; use C4::Output; use HTML::Template; +use C4::Auth; +use C4::Interface::CGI::Output; +my $input = new CGI; +my $time = $input->param('time'); -my $input=new CGI; -my $time=$input->param('time'); +my ( $template, $borrowernumber, $cookie ) = get_template_and_user( + { + template_name => "reports/reservereport.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { editcatalogue => 1 }, + debug => 1, + } +); -#print $input->header; -#print startpage; -#print startmenu('report'); -my $template = gettemplate("reservereport.tmpl"); -#print center; -#print mktablehdr(); -my ($count,$data)=unfilledreserves(); +my ( $count, $data ) = unfilledreserves(); my @dataloop; -for (my $i=0;$i<$count;$i++){ - my %line; - $line{name}="$data->[$i]->{'surname'}\, $data->[$i]->{'firstname'}"; - $line{'reservedate'}=$data->[$i]->{'reservedate'}; - $line{'title'}=$data->[$i]->{'title'}; - $line{'classification'}="$data->[$i]->{'classification'}$data->[$i]->{'dewey'}"; - push(@dataloop,\%line); +for ( my $i = 0 ; $i < $count ; $i++ ) { + warn "here"; + my %line; + $line{name} = "$data->[$i]->{'surname'}\, $data->[$i]->{'firstname'}"; + $line{'reservedate'} = $data->[$i]->{'reservedate'}; + $line{'title'} = $data->[$i]->{'title'}; + $line{'classification'} = + "$data->[$i]->{'classification'}$data->[$i]->{'dewey'}"; + push( @dataloop, \%line ); } -$template->param( count => $count, - dataloop => \@dataloop); -print "Content-Type: text/html\n\n", $template->output; +$template->param( + count => $count, + dataloop => \@dataloop +); + +output_html_with_http_headers $input, $cookie, $template->output; -- 2.20.1