synch'ing 2.2 and head
[wip/koha-chris_n.git] / mainpage.pl
1 #!/usr/bin/perl
2 use HTML::Template;
3 use strict;
4 require Exporter;
5 use C4::Database;
6 use C4::Output;  # contains gettemplate
7 use C4::Interface::CGI::Output;
8 use CGI;
9 use C4::Auth;
10 use C4::AuthoritiesMarc;
11 use C4::Koha;
12
13 my $query = new CGI;
14 my $authtypes = getauthtypes;
15 my @authtypesloop;
16 foreach my $thisauthtype (sort { $authtypes->{$a} <=> $authtypes->{$b} } keys %$authtypes) {
17         my %row =(value => $thisauthtype,
18                                 authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
19                         );
20         push @authtypesloop, \%row;
21 }
22
23 my ($template, $loggedinuser, $cookie)
24     = get_template_and_user({template_name => "intranet-main.tmpl",
25                              query => $query,
26                              type => "intranet",
27                              authnotrequired => 0,
28                              flagsrequired => {catalogue => 1, circulate => 1,
29                                                         parameters => 1, borrowers => 1,
30                                                         permissions =>1, reserveforothers=>1,
31                                                         borrow => 1, reserveforself => 1,
32                                                         editcatalogue => 1, updatecharges => 1, },
33                              debug => 1,
34                              });
35
36 my $marc_p = C4::Context->boolean_preference("marc");
37 $template->param(NOTMARC => !$marc_p);
38 $template->param(authtypesloop => \@authtypesloop);
39
40 output_html_with_http_headers $query, $cookie, $template->output;