this file replace C4/Bull.pm
[koha.git] / mainpage.pl
bloba2d845f0cac1d5f4f210f4262db7dea333fb3523
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 use C4::NewsChannels;
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'},
20 push @authtypesloop, \%row;
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 });
36 my $marc_p = C4::Context->boolean_preference("marc");
37 $template->param(NOTMARC => !$marc_p);
38 $template->param(authtypesloop => \@authtypesloop);
40 my ($koha_news_count, $all_koha_news) = &get_opac_news(undef, 'koha');
41 $template->param(koha_news => $all_koha_news);
42 $template->param(koha_news_count => $koha_news_count);
44 output_html_with_http_headers $query, $cookie, $template->output;