use Bull; changed by use Serials;
[koha.git] / barcodes / label-home.pl
1 #!/usr/bin/perl
2
3 use strict;
4 use CGI;
5 use C4::Auth;
6 use C4::Output;
7 use C4::Interface::CGI::Output;
8 use C4::Context;
9 use HTML::Template;
10
11 #use Data::Dumper;
12
13 my $query = new CGI;
14 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
15     {
16         template_name   => "barcodes/label-home.tmpl",
17         query           => $query,
18         type            => "intranet",
19         authnotrequired => 0,
20         flagsrequired   => { catalogue => 1 },
21         debug           => 1,
22     }
23 );
24
25 my $dbh    = C4::Context->dbh;
26 my $query2 = "SELECT * FROM labels_conf LIMIT 1";
27 my $sth    = $dbh->prepare($query2);
28 $sth->execute();
29
30 my $data = $sth->fetchrow_hashref;
31 $sth->finish;
32
33 $template->param( guidebox => 1 ) if ( $data->{'guidebox'} );
34
35 $data->{'printingtype'} = 'both' if ( !$data->{'printingtype'} );
36 $template->param( "printingtype_$data->{'printingtype'}" => 1 );
37
38 $template->param( "$data->{'barcodetype'}_checked"              => 1 );
39 $template->param( "startrow" . $data->{'startrow'} . "_checked" => 1 );
40 $template->param(
41     itemtype    => $data->{'itemtype'},
42     papertype   => $data->{'papertype'},
43     author      => $data->{'author'},
44     barcode     => $data->{'barcode'},
45     id          => $data->{'id'},
46     barcodetype => $data->{'barcodetype'},
47     title       => $data->{'title'},
48     isbn        => $data->{'isbn'},
49     dewey       => $data->{'dewey'},
50     class       => $data->{'class'},
51     startrow    => $data->{'startrow'},
52
53     intranetcolorstylesheet =>
54       C4::Context->preference("intranetcolorstylesheet"),
55     intranetstylesheet => C4::Context->preference("intranetstylesheet"),
56     IntranetNav        => C4::Context->preference("IntranetNav"),
57 );
58
59 output_html_with_http_headers $query, $cookie, $template->output;