Set 'authnotrequired' to 0
[koha.git] / reports / reservereport.pl
1 #!/usr/bin/perl
2
3 #written 26/4/2000
4 #script to display reports
5
6 # Copyright 2000-2002 Katipo Communications
7 #
8 # This file is part of Koha.
9 #
10 # Koha is free software; you can redistribute it and/or modify it under the
11 # terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at your option) any later
13 # version.
14 #
15 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License along with
20 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
21 # Suite 330, Boston, MA  02111-1307 USA
22
23 use strict;
24 use C4::Stats;
25 use Date::Manip;
26 use CGI;
27 use C4::Output;
28 use HTML::Template;
29 use C4::Auth;
30 use C4::Interface::CGI::Output;
31 use Data::Dumper;
32
33 my $input = new CGI;
34 my $time  = $input->param('time');
35
36 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
37     {
38         template_name   => "reports/reservereport.tmpl",
39         query           => $input,
40         type            => "intranet",
41         authnotrequired => 0,
42         flagsrequired   => { editcatalogue => 1 },
43         debug           => 1,
44     }
45 );
46
47 my ( $count, $data ) = unfilledreserves();
48
49
50 #print Dumper($count, $data);
51
52 my @dataloop;
53 for ( my $i = 0 ; $i < $count ; $i++ ) {
54
55     my %line;
56 #    $line{name}             = "$data->[$i]->{'surname'}\, $data->[$i]->{'firstname'}";
57     $line{name}             = "<p><a href=\"/cgi-bin/koha/members/moremember.pl?bornum=$data->[$i]->{'borrowernumber'}\">$data->[$i]->{'surname'}\, $data->[$i]->{'firstname'}</a></p>";
58     $line{'reservedate'}    = $data->[$i]->{'reservedate'};
59     $line{'title'}          = "<p><a href=\"/cgi-bin/koha/request.pl?bib=$data->[$i]->{'biblionumber'}\">$data->[$i]->{'title'}</a></p>"; #manky
60     $line{'classification'} = "$data->[$i]->{'classification'}$data->[$i]->{'dewey'}";
61     $line{'status'}         = $data->[$i]->{'found'};
62
63 warn "status : $line{'status'} \n";
64
65     push( @dataloop, \%line );
66 }
67
68 #= "<p><a href=\"/cgi-bin/koha/request.pl?bib=$data->[$i]->{'biblionumber'}\">$data->[$i]->{'title'}</a></p>"; #manky
69 #= "<p><a href=\"/cgi-bin/koha/members/moremember.pl?bornum=$data->[$i]->{'borrowernumber'}\">$data->[$i]->{'surname'}\, $data->[$i]->{'firstname'}</a></p>";
70
71
72
73
74 $template->param(
75     count    => $count,
76     dataloop => \@dataloop
77 );
78
79 output_html_with_http_headers $input, $cookie, $template->output;