X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-main.pl;h=ff71006d4dea432f4057f31223c141adec8600e1;hb=d7a51d83c16f5617ee975bfedd055eddde0c8c9f;hp=5a56db03875c93a498765163354ff93f12ac4d6c;hpb=fccf91832e9d794de463757bff231cce84889699;p=koha_gimpoz diff --git a/opac/opac-main.pl b/opac/opac-main.pl index 5a56db0387..ff71006d4d 100755 --- a/opac/opac-main.pl +++ b/opac/opac-main.pl @@ -26,6 +26,7 @@ use C4::Branch; # GetBranches use C4::Members; # GetMember use C4::NewsChannels; # get_opac_news use C4::Acquisition; # GetRecentAcqui +use C4::Languages qw(getTranslatedLanguages accept_language); my $input = new CGI; my $dbh = C4::Context->dbh; @@ -35,19 +36,26 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( template_name => "opac-main.tmpl", type => "opac", query => $input, - authnotrequired => 1, + authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), flagsrequired => { borrow => 1 }, } ); -my $borrower = GetMember( $borrowernumber, 'borrowernumber' ); +my $casAuthentication = C4::Context->preference('casAuthentication'); $template->param( - textmessaging => $borrower->{textmessaging}, + casAuthentication => $casAuthentication, ); + +my $borrower = GetMember( borrowernumber=>$borrowernumber ); +$template->param( + textmessaging => $borrower->{textmessaging}, +) if (ref($borrower) eq "HASH"); + # display news # use cookie setting for language, bug default to syspref if it's not set -my $news_lang = $input->cookie('KohaOpacLanguage') || 'en'; +my ($theme, $news_lang) = C4::Templates::themelanguage(C4::Context->config('opachtdocs'),'opac-main.tt','opac',$input); + my $all_koha_news = &GetNewsToDisplay($news_lang); my $koha_news_count = scalar @$all_koha_news; @@ -56,4 +64,9 @@ $template->param( koha_news_count => $koha_news_count ); +# If GoogleIndicTransliteration system preference is On Set paramter to load Google's javascript in OPAC search screens +if (C4::Context->preference('GoogleIndicTransliteration')) { + $template->param('GoogleIndicTransliteration' => 1); +} + output_html_with_http_headers $input, $cookie, $template->output;