Bug 17600: Standardize our EXPORT_OK
[srvgit] / opac / opac-news-rss.pl
index ff00cdf..a969424 100755 (executable)
@@ -20,9 +20,8 @@
 
 use Modern::Perl;
 use CGI;
-use C4::Auth;    # get_template_and_user
-use C4::Output;
-use C4::Languages qw(getTranslatedLanguages accept_language);
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
 use Koha::News;
 
 my $input = CGI->new;
@@ -43,15 +42,10 @@ my ($theme, $news_lang, $availablethemes) = C4::Templates::themelanguage(C4::Con
 
 my $branchcode = $input->param('branchcode');
 
-my $params;
-$params->{lang} = [ $news_lang, '' ];
-$params->{branchcode} = [ $branchcode, undef ] if $branchcode;
-$params->{-or} = [ expirationdate => { '>=' => \'NOW()' },
-                   expirationdate => undef ];
-my $koha_news = Koha::News->search(
-    $params,
-    {
-        order_by => 'number'
+my $koha_news = Koha::News->search_for_display({
+        location => 'opac',
+        lang => $news_lang,
+        library_id => $branchcode,
     });
 
 $template->param( koha_news => $koha_news );