Work on adding patron search to patron card generation feature.
[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 #use Data::Dumper;
12 #use Smart::Comments;
13
14 my $query = new CGI;
15 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
16     {
17         template_name   => "labels/label-create-layout.tmpl",
18         query           => $query,
19         type            => "intranet",
20         authnotrequired => 0,
21         flagsrequired   => { catalogue => 1 },
22         debug           => 1,
23     }
24 );
25
26 my $data = get_label_options();
27 my $op =  $query->param('op');
28
29 my $active_template = GetActiveLabelTemplate();
30 my @label_templates = GetAllLabelTemplates();
31 my @printingtypes = get_printingtypes();
32 my @layouts       = get_layouts();
33 my @barcode_types = get_barcode_types();
34 my @batches = get_batches();
35
36 ###  $data
37
38 $template->param( guidebox => 1 ) if ( $data->{'guidebox'} );
39 $template->param( "papertype_$data->{'papertype'}"       => 1 );
40 $template->param( "$data->{'barcodetype'}_checked" => 1 );
41 $template->param( "startrow" . $data->{'startrow'} . "_checked" => 1 );
42
43 $template->param(
44         op => $op,
45         active_template => $data->{'active_template'},
46         label_templates => \@label_templates,
47         barcode_types   => \@barcode_types,
48         printingtypes   => \@printingtypes,
49         layout_loop     => \@layouts,
50         batches         => \@batches,
51
52         id                => $data->{'id'},
53         barcodetype       => $data->{'barcodetype'},
54         papertype         => $data->{'papertype'},
55         tx_author         => $data->{'author'},
56         tx_barcode        => $data->{'barcode'},
57         tx_title          => $data->{'title'},
58         tx_subtitle       => $data->{'subtitle'},
59         tx_isbn           => $data->{'isbn'},
60         tx_issn           => $data->{'issn'},
61         tx_itemtype       => $data->{'itemtype'},
62         tx_dewey          => $data->{'dewey'},
63         tx_class          => $data->{'class'},
64         tx_subclass       => $data->{'subclass'},
65         tx_itemcallnumber => $data->{'itemcallnumber'},
66         startlabel        => $data->{'startlabel'},
67
68         fontsize => $active_template->{'fontsize'},
69 );
70
71 output_html_with_http_headers $query, $cookie, $template->output;