This is a language commit. I've gone through most of the templates and
[koha.git] / serials / serial-issues.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 =head1 NAME
23
24 serial-issue.pl
25
26 =head1 DESCRIPTION
27
28 this script give more information about a susbcription given on input arg.
29
30 =head1 PARAMETERS
31
32 =over 4
33
34 =item selectview
35 can be equal to "full" or not.
36
37 =item biblionumber
38 the biblionumber this script has to give more infos.
39
40 =back
41
42
43 =cut
44
45 use strict;
46 use CGI;
47 use C4::Auth;
48 use C4::Koha;
49 use C4::Date;
50 use C4::Serials;
51 use C4::Output;
52 use C4::Context;
53
54
55 my $query = new CGI;
56 my $dbh = C4::Context->dbh;
57 my $selectview = $query->param('selectview');
58 $selectview = C4::Context->preference("SubscriptionHistory") unless $selectview;
59
60 my $sth;
61 # my $id;
62 my ($template, $loggedinuser, $cookie);
63 my $biblionumber = $query->param('biblionumber');
64 if ($selectview eq "full"){
65     my $subscriptions = GetFullSubscriptionsFromBiblionumber($biblionumber);
66
67     my $title = $subscriptions->[0]{bibliotitle};
68     my $yearmin=$subscriptions->[0]{year};
69     my $yearmax=$subscriptions->[scalar(@$subscriptions)-1]{year};
70
71     ($template, $loggedinuser, $cookie)
72      = get_template_and_user({template_name => "serials/serial-issues-full.tmpl",
73      query => $query,
74      type => "intranet",
75      authnotrequired => 0,
76          flagsrequired => {serials => 1},
77      debug => 1,
78      });
79  
80  # replace CR by <br> in librarian note
81  # $subscription->{opacnote} =~ s/\n/\<br\/\>/g;
82  
83     $template->param(
84         biblionumber => $query->param('biblionumber'),
85         years => $subscriptions,
86         yearmin => $yearmin,
87         yearmax =>$yearmax,
88         bibliotitle => $title,
89         suggestion => C4::Context->preference("suggestion"),
90         virtualshelves => C4::Context->preference("virtualshelves"),
91     );
92
93 } else {
94     my $subscriptions = GetSubscriptionsFromBiblionumber($biblionumber);
95     ($template, $loggedinuser, $cookie)
96     = get_template_and_user({template_name => "serials/serial-issues.tmpl",
97         query => $query,
98         type => "intranet",
99         authnotrequired => 1,
100         debug => 1,
101      });
102
103  # replace CR by <br> in librarian note
104  # $subscription->{opacnote} =~ s/\n/\<br\/\>/g;
105
106     $template->param(
107         biblionumber => "".$query->param('biblionumber'),
108         subscription_LOOP => $subscriptions,
109         suggestion => "".C4::Context->preference("suggestion"),
110         virtualshelves => "".C4::Context->preference("virtualshelves"),
111     );
112 }
113 output_html_with_http_headers $query, $cookie, $template->output;