-
Notifications
You must be signed in to change notification settings - Fork 54
/
catalogue-home.pl
executable file
·39 lines (33 loc) · 1019 Bytes
/
catalogue-home.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl
use strict;
use CGI;
use C4::Auth;
use C4::Output;
use C4::Interface::CGI::Output;
use C4::Database;
use C4::Acquisition;
use C4::Biblio;
use HTML::Template;
my $query = new CGI;
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "catalogue/catalogue-home.tmpl",
query => $query,
type => "intranet",
authnotrequired => 0,
flagsrequired => {catalogue => 1},
debug => 1,
});
my ($branchcount,@branches)=branches();
my ($itemtypecount,@itemtypes)=getitemtypes();
my $classlist='';
my $dbh=C4::Context->dbh;
my $sth=$dbh->prepare("select description,itemtype from itemtypes order by description");
$sth->execute;
while (my ($description,$itemtype) = $sth->fetchrow) {
$classlist.="<option value=\"$itemtype\">$description\n";
}
$template->param(classlist => $classlist,
type => 'intranet',
branches=>\@branches,
itemtypes=>\@itemtypes);
output_html_with_http_headers $query, $cookie, $template->output;