Sub renamed and/or GPL Licence added according to the coding guideline.
[koha.git] / serials / lateissues.pl
1 #!/usr/bin/perl
2
3 # Copyright 2000-2002 Katipo Communications
4 #
5 # This file is part of Koha.
6 #
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
10 # version.
11 #
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License along with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA  02111-1307 USA
19
20 # $Id$
21
22 use strict;
23 use CGI;
24 use C4::Auth;
25 use C4::Serials;
26 use C4::Acquisition;
27 use C4::Output;
28 use C4::Interface::CGI::Output;
29 use C4::Context;
30 use HTML::Template;
31
32 my $query = new CGI;
33 # my $title = $query->param('title');
34 # my $ISSN = $query->param('ISSN');
35 # my @subscriptions = GetSubscriptions($title,$ISSN);
36
37 my $supplierid = $query->param('supplierid');
38 my %supplierlist = GetSupplierListWithLateIssues;
39 my @select_supplier;
40 push @select_supplier,"";
41 foreach my $supplierid (keys %supplierlist){
42         push @select_supplier, $supplierid
43 }
44 my $CGIsupplier=CGI::scrolling_list( -name     => 'supplierid',
45                         -values   => \@select_supplier,
46                         -default  => $supplierid,
47                         -labels   => \%supplierlist,
48                         -size     => 1,
49                         -multiple => 0 );
50
51 my @lateissues;
52 @lateissues = GetLateIssues($supplierid) if $supplierid;
53 my @supplierinfo;
54 my $nothing;
55 ($nothing,@supplierinfo)=bookseller($supplierid) if $supplierid;
56
57 my ($template, $loggedinuser, $cookie)
58 = get_template_and_user({template_name => "serials/lateissues.tmpl",
59                                 query => $query,
60                                 type => "intranet",
61                                 authnotrequired => 0,
62                                 flagsrequired => {catalogue => 1},
63                                 debug => 1,
64                                 });
65
66 $template->param(
67         CGIsupplier => $CGIsupplier,
68         lateissues => \@lateissues,
69         phone => $supplierinfo[0]->{phone},
70         booksellerfax => $supplierinfo[0]->{booksellerfax},
71         bookselleremail => $supplierinfo[0]->{bookselleremail},
72         );
73 output_html_with_http_headers $query, $cookie, $template->output;