X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=labels%2Flabel-create-template.pl;h=1b7e5261ef210e4b1d1449ef9c93600a1b35b2ea;hb=c234ec4c2d32b8c2c0fa562da6c24ad6bd427dea;hp=fa7262f5cf7f3668ee8e11c6773256ffbfb1bb41;hpb=388c60bff74c21ca0830dd4a5804b2b37a3cb0d9;p=koha_fer diff --git a/labels/label-create-template.pl b/labels/label-create-template.pl index fa7262f5cf..1b7e5261ef 100755 --- a/labels/label-create-template.pl +++ b/labels/label-create-template.pl @@ -6,7 +6,7 @@ use C4::Auth; use C4::Context; use C4::Output; use C4::Labels; -use HTML::Template; +use HTML::Template::Pro; use POSIX; #use Data::Dumper; @@ -29,6 +29,7 @@ my $rows = $query->param('rows'); my $colgap = $query->param('colgap'); my $rowgap = $query->param('rowgap'); my $units = $query->param('units'); +my $font = $query->param('fonts'); my $fontsize = $query->param('fontsize'); my $batch_id = $query->param('batch_id'); @@ -48,6 +49,21 @@ if ( $op eq 'blank' ) { { unit => 'POINT', desc => 'Postscript Points' }, ); + 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... + { font => 'TR', name => 'Times Roman' }, + { font => 'TB', name => 'Times Bold' }, + { font => 'TI', name => 'Times Italic' }, + { font => 'TBI', name => 'Times Bold Italic' }, + { font => 'C', name => 'Courier' }, + { font => 'CB', name => 'Courier Bold' }, + { font => 'CO', name => 'Courier Oblique' }, + { font => 'CBO', name => 'Courier Bold Oblique' }, + { font => 'H', name => 'Helvetica' }, + { font => 'HB', name => 'Helvetica Bold' }, + { font => 'HO', name => 'Helvetica Oblique' }, + { font => 'HBO', name => 'Helvetica Bold Oblique' }, + ); + ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "labels/label-create-template.tmpl", @@ -60,22 +76,28 @@ if ( $op eq 'blank' ) { ); $template->param( - units => \@units, + units => \@units, + fonts => \@fonts, ); } -elsif ( $op eq 'create' ) { +elsif ( $op eq 'Create' ) { CreateTemplate( - $tmpl_code, $tmpl_desc, $page_width, + $tmpl_code, $tmpl_desc, $page_width, $page_height, $label_width, $label_height, $topmargin, $leftmargin, $cols, $rows, $colgap, - $rowgap, $fontsize, $units ); + $rowgap, $font, $fontsize, $units ); print $query->redirect("./label-templates.pl"); exit; } +elsif ( $op eq 'Cancel' ) { + print $query->redirect("./label-home.pl"); + exit; +} + output_html_with_http_headers $query, $cookie, $template->output;