Add a new Debian package and GoogleJacket on OPAC detail page
[koha.git] / labels / label-create-layout.pl
1 #!/usr/bin/perl
2
3 use strict;
4 use CGI;
5 use C4::Auth;
6 use C4::Output;
7 use C4::Labels;
8 use C4::Context;
9 use HTML::Template::Pro;
10
11 my $dbh =  = C4::Context->dbh;
12 my $query = new CGI;
13 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
14     {
15         template_name   => "labels/label-create-layout.tmpl",
16         query           => $query,
17         type            => "intranet",
18         authnotrequired => 0,
19         flagsrequired   => { catalogue => 1 },
20         debug           => 1,
21     }
22 );
23
24 my $data = get_label_options();
25 my $op =  $query->param('op');
26 my $layout_id = $query->param('layout_id');
27
28 my $active_template = GetActiveLabelTemplate();
29 my @label_templates = GetAllLabelTemplates();
30 my @printingtypes = get_printingtypes();
31 my @layouts       = get_layouts();
32 my @barcode_types = get_barcode_types();
33 my @batches = get_batches();
34
35 my @barcode_types = get_barcode_types($layout_id);
36 my @printingtypes = get_printingtypes($layout_id);
37 my $layout;
38 $layout = get_layout($layout_id) if($layout_id);
39
40 $template->param( guidebox => 1 ) if ( $data->{'guidebox'} );
41 $template->param( "papertype_$data->{'papertype'}"       => 1 );
42 $template->param( "$data->{'barcodetype'}_checked" => 1 );
43 $template->param( "startrow" . $data->{'startrow'} . "_checked" => 1 );
44
45 $template->param(
46         op => $op,
47         active_template => $data->{'active_template'},
48         label_templates => \@label_templates,
49         barcode_types   => \@barcode_types,
50         printingtypes   => \@printingtypes,
51         layout_loop     => \@layouts,
52         batches         => \@batches,
53
54         id                => $data->{'id'},
55         barcodetype       => $data->{'barcodetype'},
56         papertype         => $data->{'papertype'},
57         tx_author         => $data->{'author'},
58         tx_barcode        => $data->{'barcode'},
59         tx_title          => $data->{'title'},
60         tx_subtitle       => $data->{'subtitle'},
61         tx_isbn           => $data->{'isbn'},
62         tx_issn           => $data->{'issn'},
63         tx_itemtype       => $data->{'itemtype'},
64         tx_dewey          => $data->{'dewey'},
65         tx_class          => $data->{'class'},
66         tx_subclass       => $data->{'subclass'},
67         tx_itemcallnumber => $data->{'itemcallnumber'},
68         startlabel        => $data->{'startlabel'},
69
70         fontsize => $active_template->{'fontsize'},
71 );
72
73 output_html_with_http_headers $query, $cookie, $template->output;