New basic page structure implemented for circ pages: global main menu in the header...
[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 C4::Interface::CGI::Output;
10 use HTML::Template;
11 use POSIX;
12
13 #use Data::Dumper;
14 #use Smart::Comments;
15
16 my $dbh       = C4::Context->dbh;
17 my $query     = new CGI;
18 my $layout_id = $query->param('layout_id');
19
20 ### $query;
21
22 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
23     {
24         template_name   => "barcodes/label-edit-layout.tmpl",
25         query           => $query,
26         type            => "intranet",
27         authnotrequired => 1,
28         flagsrequired   => { catalogue => 1 },
29         debug           => 1,
30     }
31 );
32
33 my $layout = get_layout($layout_id);
34  my @barcode_types = get_barcode_types($layout_id);
35 my @printingtypes       = get_printingtypes($layout_id);
36 ### @printingtypes 
37 ### $layout
38
39 my $layoutname =  $layout->{'layoutname'};
40 my $layout_id =  $layout->{'id'};
41 my $guidebox =  $layout->{'guidebox'};
42 my $startlabel  =  $layout->{'startlabel'};
43
44 my @title          = build_text_dropbox( $layout->{'title'} );
45 my @subtitle          = build_text_dropbox( $layout->{'subtitle'} );
46 my @author         = build_text_dropbox( $layout->{'author'} );
47 my @barcode        = build_text_dropbox( $layout->{'barcode'} );
48 my @isbn           = build_text_dropbox( $layout->{'isbn'} );
49 my @issn           = build_text_dropbox( $layout->{'issn'} );
50 my @itemtype       = build_text_dropbox( $layout->{'itemtype'} );
51 my @dewey          = build_text_dropbox( $layout->{'dewey'} );
52 my @class          = build_text_dropbox( $layout->{'class'} );
53 my @subclass       = build_text_dropbox( $layout->{'subclass'} );
54 my @itemcallnumber = build_text_dropbox( $layout->{'itemcallnumber'} );
55
56
57 ### @subclass 
58
59 $template->param(
60     barcode_types => \@barcode_types,
61     printingtypes => \@printingtypes,
62
63     layoutname => $layoutname,
64     layout_id => $layout_id,
65
66 guidebox => $guidebox,
67 startlabel => $startlabel,
68
69     tx_title          => \@title,
70     tx_subtitle          => \@subtitle,
71     tx_author         => \@author,
72     tx_isbn           => \@isbn,
73     tx_issn           => \@issn,
74     tx_itemtype       => \@itemtype,
75     tx_dewey          => \@dewey,
76     tx_barcode        => \@barcode,
77     tx_classif        => \@class,
78     tx_subclass       => \@subclass,
79     tx_itemcallnumber => \@itemcallnumber,
80
81     intranetcolorstylesheet =>
82       C4::Context->preference("intranetcolorstylesheet"),
83     intranetstylesheet => C4::Context->preference("intranetstylesheet"),
84     IntranetNav        => C4::Context->preference("IntranetNav"),
85 );
86
87 output_html_with_http_headers $query, $cookie, $template->output;