9 use HTML::Template::Pro;
15 my $dbh = C4::Context->dbh;
19 my $tmpl_code = $query->param('tmpl_code');
20 my $tmpl_desc = $query->param('tmpl_desc');
21 my $page_height = $query->param('page_height');
22 my $page_width = $query->param('page_width');
23 my $label_height = $query->param('label_height');
24 my $label_width = $query->param('label_width');
25 my $topmargin = $query->param('topmargin');
26 my $leftmargin = $query->param('leftmargin');
27 my $cols = $query->param('cols');
28 my $rows = $query->param('rows');
29 my $colgap = $query->param('colgap');
30 my $rowgap = $query->param('rowgap');
31 my $units = $query->param('units');
32 my $font = $query->param('fonts');
33 my $fontsize = $query->param('fontsize');
35 my $batch_id = $query->param('batch_id');
38 my $op = $query->param('op');
41 my ( $template, $loggedinuser, $cookie );
43 if ( $op eq 'blank' ) {
46 { unit => 'INCH', desc => 'Inches' },
47 { unit => 'CM', desc => 'Centimeters' },
48 { unit => 'MM', desc => 'Millimeters' },
49 { unit => 'POINT', desc => 'Postscript Points' },
52 my @fonts = ( #FIXME: There is probably a way to discover what additional fonts are installed on a user's system and generate this list dynamically...
53 { font => 'TR', name => 'Times Roman' },
54 { font => 'TB', name => 'Times Bold' },
55 { font => 'TI', name => 'Times Italic' },
56 { font => 'TBI', name => 'Times Bold Italic' },
57 { font => 'C', name => 'Courier' },
58 { font => 'CB', name => 'Courier Bold' },
59 { font => 'CO', name => 'Courier Oblique' },
60 { font => 'CBO', name => 'Courier Bold Oblique' },
61 { font => 'H', name => 'Helvetica' },
62 { font => 'HB', name => 'Helvetica Bold' },
63 { font => 'HO', name => 'Helvetica Oblique' },
64 { font => 'HBO', name => 'Helvetica Bold Oblique' },
67 ( $template, $loggedinuser, $cookie ) = get_template_and_user(
69 template_name => "labels/label-create-template.tmpl",
73 flagsrequired => { catalogue => 1 },
85 elsif ( $op eq 'Create' ) {
88 $tmpl_code, $tmpl_desc, $page_width,
89 $page_height, $label_width, $label_height, $topmargin,
90 $leftmargin, $cols, $rows, $colgap,
91 $rowgap, $font, $fontsize, $units );
93 print $query->redirect("./label-templates.pl");
98 elsif ( $op eq 'Cancel' ) {
99 print $query->redirect("./label-home.pl");
103 output_html_with_http_headers $query, $cookie, $template->output;