10 use HTML::Template::Pro;
12 # use Smart::Comments;
15 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
17 template_name => "labels/label-home.tmpl",
21 flagsrequired => { catalogue => 1 },
26 # little block for displaying active layout/template/batch in templates
28 my $batch_id = $query->param('batch_id');
29 my $active_layout = get_active_layout();
30 my $active_template = GetActiveLabelTemplate();
31 my $active_layout_name = $active_layout->{'layoutname'};
32 my $active_template_name = $active_template->{'tmpl_code'};
36 my $data = get_label_options();
37 my $op = $query->param('op');
38 my $layout_id = $query->param('layout_id');
40 my @label_templates = GetAllLabelTemplates();
41 my @printingtypes = get_printingtypes();
42 my @layouts = get_layouts();
43 my @barcode_types = get_barcode_types();
44 my @batches = get_batches();
46 if ($op eq 'delete_layout') { # had been assignment! serious error!
47 delete_layout($layout_id);
52 $template->param( guidebox => 1 ) if ( $data->{'guidebox'} );
53 $template->param( "papertype_$data->{'papertype'}" => 1 );
54 $template->param( "$data->{'barcodetype'}_checked" => 1 );
55 $template->param( "startrow" . $data->{'startrow'} . "_checked" => 1 );
59 active_layout_name => $active_layout_name,
60 active_template_name => $active_template_name,
62 label_templates => \@label_templates,
63 barcode_types => \@barcode_types,
64 printingtypes => \@printingtypes,
65 layout_loop => \@layouts,
69 barcodetype => $data->{'barcodetype'},
70 papertype => $data->{'papertype'},
72 tx_author => $data->{'author'},
73 tx_barcode => $data->{'barcode'},
74 tx_title => $data->{'title'},
75 tx_isbn => $data->{'isbn'},
76 tx_issn => $data->{'issn'},
77 tx_itemtype => $data->{'itemtype'},
78 tx_dewey => $data->{'dewey'},
79 tx_class => $data->{'class'},
80 tx_subclass => $data->{'subclass'},
81 tx_itemcallnumber => $data->{'itemcallnumber'},
83 startlabel => $data->{'startlabel'},
84 fontsize => $active_template->{'fontsize'},
88 output_html_with_http_headers $query, $cookie, $template->output;