Adding id attributes to CGI-generated form inputs so that HTML labels can transfer...
[koha.git] / catalogue-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::Database;
9 use C4::Acquisition;
10 use C4::Biblio;
11 use HTML::Template;
12
13 my $query = new CGI;
14 my ($template, $loggedinuser, $cookie)
15     = get_template_and_user({template_name => "catalogue/catalogue-home.tmpl",
16                              query => $query,
17                              type => "intranet",
18                              authnotrequired => 0,
19                              flagsrequired => {catalogue => 1},
20                              debug => 1,
21                              });
22
23 my ($branchcount,@branches)=branches();
24 my ($itemtypecount,@itemtypes)=getitemtypes();
25
26 my $classlist='';
27 my $dbh=C4::Context->dbh;
28 my $sth=$dbh->prepare("select description,itemtype from itemtypes order by description");
29 $sth->execute;
30 while (my ($description,$itemtype) = $sth->fetchrow) {
31     $classlist.="<option value=\"$itemtype\">$description\n";
32 }
33
34 $template->param(classlist => $classlist,
35                                                 type => 'intranet',
36                  branches=>\@branches,
37                  itemtypes=>\@itemtypes);
38
39 output_html_with_http_headers $query, $cookie, $template->output;