14 my $dbh = C4::Context->dbh;
16 my $op = $query->param('op');
17 my $tmpl_code = $query->param('tmpl_code');
18 my $tmpl_id = $query->param('tmpl_id');
21 my $width = $query->param('width');
22 my $height = $query->param('height');
23 my $topmargin = $query->param('topmargin');
24 my $leftmargin = $query->param('leftmargin');
25 my $columns = $query->param('columns');
26 my $rows = $query->param('rows');
27 my $colgap = $query->param('colgap');
28 my $rowgap = $query->param('rowgap');
30 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
32 template_name => "labels/label-templates.tmpl",
36 flagsrequired => { catalogue => 1 },
45 if ( $op eq 'set_active_template' ) {
46 SetActiveTemplate($tmpl_id);
49 elsif ( $op eq 'delete' ) {
50 DeleteTemplate($tmpl_id);
53 elsif ( $op eq 'save' ) {
54 SaveTemplate($tmpl_code);
57 @resultsloop = GetAllLabelTemplates();
59 # little block for displaying active layout/template/batch in templates
61 my $batch_id = $query->param('batch_id');
62 my $active_layout = get_active_layout();
63 my $active_template = GetActiveLabelTemplate();
64 my $active_layout_name = $active_layout->{'layoutname'};
65 my $active_template_name = $active_template->{'tmpl_code'};
70 batch_id => $batch_id,
71 active_layout_name => $active_layout_name,
72 active_template_name => $active_template_name,
74 resultsloop => \@resultsloop,
77 output_html_with_http_headers $query, $cookie, $template->output;