adding 'gettext' as this is requred by the translation utility
[koha.git] / labels / label-edit-layout.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 my $dbh       = C4::Context->dbh;
16 my $query     = new CGI;
17 my $layout_id = $query->param('layout_id');
18
19 ### $query;
20
21 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
22     {
23         template_name   => "labels/label-edit-layout.tmpl",
24         query           => $query,
25         type            => "intranet",
26         authnotrequired => 1,
27         flagsrequired   => { catalogue => 1 },
28         debug           => 1,
29     }
30 );
31
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
37
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'};
42
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'} );
54
55 ### @subclass 
56
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
65     tx_title          => \@title,
66     tx_subtitle       => \@subtitle,
67     tx_author         => \@author,
68     tx_isbn           => \@isbn,
69     tx_issn           => \@issn,
70     tx_itemtype       => \@itemtype,
71     tx_dewey          => \@dewey,
72     tx_barcode        => \@barcode,
73     tx_classif        => \@class,
74     tx_subclass       => \@subclass,
75     tx_itemcallnumber => \@itemcallnumber,
76 );
77
78 output_html_with_http_headers $query, $cookie, $template->output;