[Koha-cvs] koha/C4 Search.pm [rel_2_2]

paul poulain paul at koha-fr.org
Thu Feb 8 12:03:31 CET 2007


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	paul poulain <tipaul>	07/02/08 11:03:31

Modified files:
	C4             : Search.pm 

Log message:
	replace where by LEFT JOIN where appropriate

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Search.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.99.2.16&r2=1.99.2.17

Patches:
Index: Search.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Search.pm,v
retrieving revision 1.99.2.16
retrieving revision 1.99.2.17
diff -u -b -r1.99.2.16 -r1.99.2.17
--- Search.pm	29 Jan 2007 03:18:19 -0000	1.99.2.16
+++ Search.pm	8 Feb 2007 11:03:31 -0000	1.99.2.17
@@ -30,7 +30,7 @@
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 
 # set the version for version checking
-$VERSION = do { my @v = '$Revision: 1.99.2.16 $' =~ /\d+/g;
+$VERSION = do { my @v = '$Revision: 1.99.2.17 $' =~ /\d+/g;
           shift(@v) . "." . join("_", map {sprintf "%03d", $_ } @v); };
 
 =head1 NAME
@@ -1560,7 +1560,9 @@
 sub bibitemdata {
     my ($bibitem) = @_;
     my $dbh   = C4::Context->dbh;
-    my $sth   = $dbh->prepare("Select *,biblioitems.notes as bnotes from biblio, biblioitems,itemtypes where biblio.biblionumber = biblioitems.biblionumber and biblioitemnumber = ? and biblioitems.itemtype = itemtypes.itemtype");
+    my $sth   = $dbh->prepare("Select *,biblioitems.notes as bnotes from biblio, biblioitems
+        LEFT JOIN itemtypes on biblioitems.itemtype = itemtypes.itemtype
+        where biblio.biblionumber = biblioitems.biblionumber and biblioitemnumber = ? ");
     my $data;
 
     $sth->execute($bibitem);
@@ -2353,9 +2355,9 @@
                         itemtypes.*,
                         MIN(items.itemlost)        as itemlost,
                         MIN(items.dateaccessioned) as dateaccessioned
-                          FROM biblioitems, itemtypes, items
+                          FROM biblioitems, items
+                          LEFT JOIN itemtypes ON biblioitems.itemtype = itemtypes.itemtype
                          WHERE biblioitems.biblionumber     = ?
-                           AND biblioitems.itemtype         = itemtypes.itemtype
                            AND biblioitems.biblioitemnumber = items.biblioitemnumber
                       GROUP BY items.biblioitemnumber");
     my $count = 0;





More information about the Koha-cvs mailing list