adding 'gettext' as this is requred by the translation utility
[koha.git] / labels / label-save-template.pl
1 #!/usr/bin/perl
2
3 use strict;
4 use CGI;
5 use C4::Auth;
6 use C4::Context;
7 use C4::Output;
8 use C4::Labels;
9 use HTML::Template::Pro;
10 use POSIX;
11
12 #use Data::Dumper;
13 #use Smart::Comments;
14
15
16 my $dbh   = C4::Context->dbh;
17 my $query = new CGI;
18
19 my $tmpl_id      = $query->param('tmpl_id');
20 my $tmpl_code    = $query->param('tmpl_code');
21 my $tmpl_desc    = $query->param('tmpl_desc');
22 my $page_height  = $query->param('page_height');
23 my $page_width   = $query->param('page_width');
24 my $label_height = $query->param('label_height');
25 my $label_width  = $query->param('label_width');
26 my $topmargin    = $query->param('topmargin');
27 my $leftmargin   = $query->param('leftmargin');
28 my $cols         = $query->param('cols');
29 my $rows         = $query->param('rows');
30 my $colgap       = $query->param('colgap');
31 my $rowgap       = $query->param('rowgap');
32 my $font         = $query->param('fonts');
33 my $fontsize     = $query->param('fontsize');
34 my $units        = $query->param('units');
35 my $active       = $query->param('active');
36 my $prof_id      = $query->param('prof_id');
37
38 my $dberror = SaveTemplate(
39
40     $tmpl_id,     $tmpl_code,   $tmpl_desc,    $page_width,
41     $page_height, $label_width, $label_height, $topmargin,
42     $leftmargin,  $cols,        $rows,         $colgap,
43     $rowgap,      $font,        $fontsize,     $units
44
45 );
46
47 SetAssociatedProfile( $prof_id, $tmpl_id ) if $prof_id;
48
49 warn "Database returned the following error: $dberror" if $dberror;
50
51 print $query->redirect("./label-templates.pl");
52
53