9 use HTML::Template::Pro;
14 my $dbh = C4::Context->dbh;
17 my $tmpl_id = $query->param('tmpl_id');
19 my $width = $query->param('width');
20 my $height = $query->param('height');
21 my $topmargin = $query->param('topmargin');
22 my $leftmargin = $query->param('leftmargin');
23 my $columns = $query->param('columns');
24 my $rows = $query->param('rows');
25 my $colgap = $query->param('colgap');
26 my $rowgap = $query->param('rowgap');
27 my $prof_id = $query->param('prof_id');
29 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
31 template_name => "labels/label-edit-template.tmpl",
35 flagsrequired => { catalogue => 1 },
40 my $tmpl = GetSingleLabelTemplate($tmpl_id);
41 my $curprof = GetAssociatedProfile($tmpl_id);
42 my @prof = GetAllPrinterProfiles();
45 # Generate an array of hashes containing possible profiles for given template and mark the currently associated one...
47 foreach my $prof (@prof) {
48 if ( $prof->{'tmpl_id'} eq $tmpl->{'tmpl_id'} && $prof->{'prof_id'} eq $curprof->{'prof_id'} ) {
49 push ( @proflist, {prof_id => $prof->{'prof_id'},
50 printername => $prof->{'printername'},
51 paper_bin => $prof->{'paper_bin'},
55 elsif ( $prof->{'tmpl_id'} eq $tmpl->{'tmpl_id'} ) {
56 push ( @proflist, {prof_id => $prof->{'prof_id'},
57 printername => $prof->{'printername'},
58 paper_bin => $prof->{'paper_bin'}} );
63 { unit => 'INCH', desc => 'Inches' },
64 { unit => 'CM', desc => 'Centimeters' },
65 { unit => 'MM', desc => 'Millimeters' },
66 { unit => 'POINT', desc => 'Postscript Points' },
69 foreach my $unit (@units) {
70 if ( $unit->{'unit'} eq $tmpl->{'units'} ) {
71 $unit->{'selected'} = 1;
77 proflist => \@proflist,
80 tmpl_id => $tmpl->{'tmpl_id'},
81 tmpl_code => $tmpl->{'tmpl_code'},
82 tmpl_desc => $tmpl->{'tmpl_desc'},
83 page_width => $tmpl->{'page_width'},
84 page_height => $tmpl->{'page_height'},
85 label_width => $tmpl->{'label_width'},
86 label_height => $tmpl->{'label_height'},
87 topmargin => $tmpl->{'topmargin'},
88 leftmargin => $tmpl->{'leftmargin'},
89 cols => $tmpl->{'cols'},
90 rows => $tmpl->{'rows'},
91 colgap => $tmpl->{'colgap'},
92 rowgap => $tmpl->{'rowgap'},
93 fontsize => $tmpl->{'fontsize'},
94 active => $tmpl->{'active'},
97 output_html_with_http_headers $query, $cookie, $template->output;