koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/C4 NewsChannels.pm [rel_3_0]


From: Antoine Farnault
Subject: [Koha-cvs] koha/C4 NewsChannels.pm [rel_3_0]
Date: Wed, 10 Jan 2007 14:20:41 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     Antoine Farnault <toins>        07/01/10 14:20:41

Modified files:
        C4             : NewsChannels.pm 

Log message:
        opac_news.displayed is replaced by opac_news.number.
        This field say how are ordered the news on the template.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/NewsChannels.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.2&r2=1.1.2.3

Patches:
Index: NewsChannels.pm
===================================================================
RCS file: /sources/koha/koha/C4/NewsChannels.pm,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -b -r1.1.2.2 -r1.1.2.3
--- NewsChannels.pm     9 Jan 2007 16:43:04 -0000       1.1.2.2
+++ NewsChannels.pm     10 Jan 2007 14:20:41 -0000      1.1.2.3
@@ -25,7 +25,7 @@
 use vars qw($VERSION @ISA @EXPORT);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.1.2.2 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.1.2.3 $' =~ /\d+/g;
     shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
 };
 
@@ -240,16 +240,16 @@
 }
 
 sub add_opac_new {
-    my ($title, $new, $lang, $expirationdate, $displayed) = @_;
+    my ($title, $new, $lang, $expirationdate, $number) = @_;
     my $dbh = C4::Context->dbh;
-    my $sth = $dbh->prepare("INSERT INTO opac_news (title, new, lang, 
expirationdate, displayed) VALUES (?,?,?,?,?)");
-    $sth->execute($title, $new, $lang, $expirationdate, $displayed);
+    my $sth = $dbh->prepare("INSERT INTO opac_news (title, new, lang, 
expirationdate, number) VALUES (?,?,?,?,?)");
+    $sth->execute($title, $new, $lang, $expirationdate, $number);
     $sth->finish;
     return 1;
 }
 
 sub upd_opac_new {
-    my ($idnew, $title, $new, $lang, $expirationdate, $displayed) = @_;
+    my ($idnew, $title, $new, $lang, $expirationdate, $number) = @_;
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare("
         UPDATE opac_news SET 
@@ -257,10 +257,10 @@
             new = ?,
             lang = ?,
             expirationdate = ?,
-            displayed = ?
+            number = ?
         WHERE idnew = ?
     ");
-    $sth->execute($title, $new, $lang, $expirationdate,$displayed,$idnew);
+    $sth->execute($title, $new, $lang, $expirationdate,$number,$idnew);
     $sth->finish;
     return 1;
 }
@@ -318,7 +318,7 @@
     
     $news = &GetNewsToDisplay($lang);
     C<$news> is a ref to an array which containts
-    all news with displayed = 1 and expirationdate > today.
+    all news with expirationdate > today or expirationdate is null.
     
 =cut
 
@@ -328,13 +328,13 @@
     my $query = "
      SELECT *,DATE_FORMAT(timestamp, '%d/%m/%Y') AS newdate
      FROM   opac_news
-     WHERE  displayed = 1
-      AND   (
+     WHERE   (
         expirationdate > CURRENT_DATE()
         OR    expirationdate IS NULL
         OR    expirationdate = '00-00-0000'
       )
       AND   lang = ?
+      ORDER BY number
     ";
     my $sth = $dbh->prepare($query);
     $sth->execute($lang);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]