[Koha-cvs] koha mainpage.pl opac/opac-main.pl [rel_3_0]

Antoine Farnault antoine at koha-fr.org
Tue Jan 9 17:45:11 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	07/01/09 16:45:11

Modified files:
	.              : mainpage.pl 
	opac           : opac-main.pl 

Log message:
	call GetNewsToDisplay instead of get_koha_news.
	GetNewsToDisplay returns only news avaible. (with displayed=1 and expirationdate > currentdate)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/mainpage.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.11.2.3&r2=1.11.2.4
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-main.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.23.2.6&r2=1.23.2.7

Patches:
Index: mainpage.pl
===================================================================
RCS file: /sources/koha/koha/mainpage.pl,v
retrieving revision 1.11.2.3
retrieving revision 1.11.2.4
diff -u -b -r1.11.2.3 -r1.11.2.4
--- mainpage.pl	22 Dec 2006 15:02:56 -0000	1.11.2.3
+++ mainpage.pl	9 Jan 2007 16:45:11 -0000	1.11.2.4
@@ -63,11 +63,18 @@
 );
 
 my $marc_p = C4::Context->boolean_preference("marc");
-$template->param( NOTMARC       => !$marc_p );
-$template->param( authtypesloop => \@authtypesloop );
 
-my ( $koha_news_count, $all_koha_news ) = &get_opac_news( undef, 'koha' );
-$template->param( koha_news       => $all_koha_news );
-$template->param( koha_news_count => $koha_news_count );
+$template->param(
+    NOTMARC       => !$marc_p,
+    authtypesloop => \@authtypesloop
+);
+
+my $all_koha_news = &GetNewsToDisplay("koha");
+my $koha_news_count = scalar @$all_koha_news;
+
+$template->param(
+    koha_news       => $all_koha_news,
+    koha_news_count => $koha_news_count
+);
 
 output_html_with_http_headers $query, $cookie, $template->output;

Index: opac/opac-main.pl
===================================================================
RCS file: /sources/koha/koha/opac/opac-main.pl,v
retrieving revision 1.23.2.6
retrieving revision 1.23.2.7
diff -u -b -r1.23.2.6 -r1.23.2.7
--- opac/opac-main.pl	14 Dec 2006 15:48:57 -0000	1.23.2.6
+++ opac/opac-main.pl	9 Jan 2007 16:45:11 -0000	1.23.2.7
@@ -15,7 +15,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: opac-main.pl,v 1.23.2.6 2006/12/14 15:48:57 toins Exp $
+# $Id: opac-main.pl,v 1.23.2.7 2007/01/09 16:45:11 toins Exp $
 
 use strict;
 require Exporter;
@@ -88,9 +88,13 @@
 );
 
 # display news
-my ( $koha_news_count, $all_koha_news ) = &get_opac_news( undef, GetLanguages("opac") );
-$template->param( koha_news       => $all_koha_news );
-$template->param( koha_news_count => $koha_news_count );
+my  $all_koha_news  = &GetNewsToDisplay( &GetLanguages("opac") );
+my $koha_news_count = scalar @$all_koha_news;
+
+$template->param(
+    koha_news       => $all_koha_news,
+    koha_news_count => $koha_news_count
+);
 
 $template->param(
     'Disable_Dictionary' => C4::Context->preference("Disable_Dictionary") )





More information about the Koha-cvs mailing list