bug-2923: replaces 'renew/not renew' text with nice 'renew/return 'yui buttons.
[koha.git] / labels / label-edit-layout.pl
blob17ecd7244e743bb1f765ac93c992301c89b5b4fd
1 #!/usr/bin/perl
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;
12 #use Data::Dumper;
13 #use Smart::Comments;
15 my $dbh = C4::Context->dbh;
16 my $query = new CGI;
17 my $layout_id = $query->param('layout_id');
19 ### $query;
21 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
23 template_name => "labels/label-edit-layout.tmpl",
24 query => $query,
25 type => "intranet",
26 authnotrequired => 1,
27 flagsrequired => { catalogue => 1 },
28 debug => 1,
32 my $layout = get_layout($layout_id);
33 my @barcode_types = get_barcode_types($layout_id);
34 my @printingtypes = get_printingtypes($layout_id);
35 ### @printingtypes
36 ### $layout
38 $layout_id = $layout->{'id'}; # has it changed since we set it above? --joe
39 my $layoutname = $layout->{'layoutname'};
40 my $guidebox = $layout->{'guidebox'};
41 my $startlabel = $layout->{'startlabel'};
43 my @title = build_text_dropbox( $layout->{'title'} );
44 my @subtitle = build_text_dropbox( $layout->{'subtitle'} );
45 my @author = build_text_dropbox( $layout->{'author'} );
46 my @barcode = build_text_dropbox( $layout->{'barcode'} );
47 my @isbn = build_text_dropbox( $layout->{'isbn'} );
48 my @issn = build_text_dropbox( $layout->{'issn'} );
49 my @itemtype = build_text_dropbox( $layout->{'itemtype'} );
50 my @dewey = build_text_dropbox( $layout->{'dewey'} );
51 my @class = build_text_dropbox( $layout->{'class'} );
52 my @subclass = build_text_dropbox( $layout->{'subclass'} );
53 my @itemcallnumber = build_text_dropbox( $layout->{'itemcallnumber'} );
55 ### @subclass
57 $template->param(
58 barcode_types => \@barcode_types,
59 printingtypes => \@printingtypes,
60 layoutname => $layoutname,
61 layout_id => $layout_id,
62 guidebox => $guidebox,
63 startlabel => $startlabel,
64 formatstring => $layout->{'formatstring'},
65 callnum_split => $layout->{'callnum_split'},
66 'justify_' . $layout->{'text_justify'} => 1,
67 tx_title => \@title,
68 tx_subtitle => \@subtitle,
69 tx_author => \@author,
70 tx_isbn => \@isbn,
71 tx_issn => \@issn,
72 tx_itemtype => \@itemtype,
73 tx_dewey => \@dewey,
74 tx_barcode => \@barcode,
75 tx_classif => \@class,
76 tx_subclass => \@subclass,
77 tx_itemcallnumber => \@itemcallnumber,
80 output_html_with_http_headers $query, $cookie, $template->output;