koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 Serials.pm


From: Henri-Damien LAURENT
Subject: [Koha-cvs] koha/C4 Serials.pm
Date: Thu, 12 Jul 2007 17:38:05 +0000

CVSROOT:        /cvsroot/koha
Module name:    koha
Changes by:     Henri-Damien LAURENT <hdl>      07/07/12 17:38:05

Modified files:
        C4             : Serials.pm 

Log message:
        In Serials-home.pl
        librarians can now search titles with lists of words.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Serials.pm?cvsroot=koha&r1=1.26&r2=1.27

Patches:
Index: Serials.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Serials.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- Serials.pm  12 Jul 2007 10:01:20 -0000      1.26
+++ Serials.pm  12 Jul 2007 17:38:05 -0000      1.27
@@ -17,7 +17,7 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id: Serials.pm,v 1.26 2007/07/12 10:01:20 hdl Exp $
+# $Id: Serials.pm,v 1.27 2007/07/12 17:38:05 hdl Exp $
 
 use strict;
 use C4::Date;
@@ -35,7 +35,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.26 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.27 $' =~ /\d+/g;
     shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
 };
 
@@ -646,8 +646,8 @@
                 FROM   subscription,biblio,biblioitems
                 WHERE  biblio.biblionumber = biblioitems.biblionumber
                     AND biblio.biblionumber= subscription.biblionumber
-                    AND (biblio.title LIKE ? or biblioitems.issn = ?)
-            |;
+                    AND (biblioitems.issn = ? or|. join('and 
',map{"biblio.title LIKE \"%$_%\""}split (" ",$title))." )";
+            
             if (C4::Context->preference('IndependantBranches') && 
                 C4::Context->userenv && 
                 C4::Context->userenv->{'flags'} != 1){
@@ -655,7 +655,7 @@
             }
             $query.=" ORDER BY title";
             $sth = $dbh->prepare($query);
-            $sth->execute( "%$title%", $ISSN );
+            $sth->execute( $ISSN );
         }
         else {
             if ($ISSN) {
@@ -682,8 +682,9 @@
                     FROM   subscription,biblio,biblioitems
                     WHERE  biblio.biblionumber = biblioitems.biblionumber
                         AND biblio.biblionumber=subscription.biblionumber
-                        AND biblio.title LIKE ?
-                );
+                        ).($title?" and ":""). join('and ',map{"biblio.title 
LIKE \"%$_%\""} split (" ",$title) );
+                
+                warn $query;       
                 if (C4::Context->preference('IndependantBranches') && 
                     C4::Context->userenv && 
                     C4::Context->userenv->{'flags'} != 1){
@@ -691,7 +692,7 @@
                 }
                 $query.=" ORDER BY title";
                 $sth = $dbh->prepare($query);
-                $sth->execute( "%" . $title . "%" );
+                $sth->execute;
             }
         }
     }
@@ -739,7 +740,7 @@
       "SELECT serialid,serialseq, status, publisheddate, planneddate,notes 
                         FROM   serial
                         WHERE  subscriptionid = ? AND status NOT IN (2,4,5) 
-                        ORDER BY publisheddate,serialid DESC";
+                        ORDER BY 
IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC";
     my $sth = $dbh->prepare($query);
     $sth->execute($subscriptionid);
     while ( my $line = $sth->fetchrow_hashref ) {
@@ -755,7 +756,7 @@
        FROM     serial
        WHERE    subscriptionid = ?
        AND      (status in (2,4,5))
-       ORDER BY publisheddate,serialid DESC
+       ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC
       ";
     $sth = $dbh->prepare($query);
     $sth->execute($subscriptionid);




reply via email to

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