Finalized XML version for intranet
[wip/koha-chris_n.git] / mainpage.pl
1 #!/usr/bin/perl 
2 use strict;
3 use C4::Interface::CGI::Output;
4 use CGI;
5 use C4::Auth;
6 use C4::Suggestions;
7 use C4::Koha;
8 use C4::BookShelves;
9 use C4::NewsChannels;
10
11 my $query = new CGI;
12 my ($template, $loggedinuser, $cookie)
13     = get_template_and_user({template_name => "intranet-main.tmpl",
14                              query => $query,
15                              type => "intranet",
16                              authnotrequired => 0,
17                              flagsrequired => {catalogue => 1, circulate => 1,
18                                                         parameters => 1, borrowers => 1,
19                                                         permissions =>1, reserveforothers=>1,
20                                                         editcatalogue => 1, updatecharges => 1, },
21                              debug => 1,
22                              });
23
24 my $lang = "koha";
25 my $error=$query->param('error');
26 $template->param(error        =>$error);
27 my ($opac_news_count, $all_opac_news) = &get_opac_news(undef, $lang);
28 # if ($opac_news_count > 4) {$template->param(more_opac_news => 1);}
29 $template->param(opac_news        => $all_opac_news);
30 $template->param(opac_news_count  => $opac_news_count);
31
32 my $marc_p = C4::Context->boolean_preference("marc");
33 $template->param(NOTMARC => !$marc_p);
34 my $new_suggestions = &CountSuggestion("ASKED");
35 $template->param(new_suggestions => $new_suggestions);
36
37
38 my $count_pending_request = CountShelfRequest(undef, "PENDING");
39 $template->param(count_pending_request => $count_pending_request);
40 output_html_with_http_headers $query, $cookie, $template->output();
41