rel_3_0 moved to HEAD
[koha.git] / barcodes / label-home.pl
1 #!/usr/bin/perl
2
3 # This file is part of Koha.
4 #
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 2 of the License, or (at your option) any later
8 # version.
9 #
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License along with
15 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16 # Suite 330, Boston, MA  02111-1307 USA
17
18 use strict;
19 use CGI;
20 use C4::Auth;
21 use C4::Output;
22 use C4::Labels;
23 use C4::Interface::CGI::Output;
24 use C4::Context;
25
26
27 my $query = new CGI;
28 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
29     {
30         template_name   => "barcodes/label-home.tmpl",
31         query           => $query,
32         type            => "intranet",
33         authnotrequired => 0,
34         flagsrequired   => { tools => 1 },
35         debug           => 1,
36     }
37 );
38
39 my $data = get_label_options();
40
41 my $active_template = GetActiveLabelTemplate();
42 my @label_templates = GetAllLabelTemplates();
43
44 $template->param( guidebox => 1 ) if ( $data->{'guidebox'} );
45
46 $data->{'printingtype'} = 'both' if ( !$data->{'printingtype'} );
47 $template->param( "printingtype_$data->{'printingtype'}" => 1 );
48 $template->param( "papertype_$data->{'papertype'}"       => 1 );
49
50 $template->param( "$data->{'barcodetype'}_checked" => 1 );
51
52 $template->param( "startrow" . $data->{'startrow'} . "_checked" => 1 );
53 $template->param(
54     itemtype        => $data->{'itemtype'},
55     active_template => $data->{'active_template'},
56     label_templates => \@label_templates,
57
58     papertype      => $data->{'papertype'},
59     author         => $data->{'author'},
60     barcode        => $data->{'barcode'},
61     id             => $data->{'id'},
62     barcodetype    => $data->{'barcodetype'},
63     title          => $data->{'title'},
64     isbn           => $data->{'isbn'},
65     dewey          => $data->{'dewey'},
66     class          => $data->{'class'},
67     startrow       => $data->{'startrow'},
68     subclass       => $data->{'subclass'},
69     itemcallnumber => $data->{'itemcallnumber'},
70     startlabel     => $data->{'startlabel'},
71     fontsize       => $active_template->{'fontsize'},
72
73     intranetcolorstylesheet =>
74       C4::Context->preference("intranetcolorstylesheet"),
75     intranetstylesheet => C4::Context->preference("intranetstylesheet"),
76     IntranetNav        => C4::Context->preference("IntranetNav"),
77 );
78
79 output_html_with_http_headers $query, $cookie, $template->output;