[Koha-cvs] koha overdue.pl [rel_2_2]

paul poulain paul at koha-fr.org
Tue Apr 4 15:13:47 CEST 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch: 	rel_2_2
Changes by:	paul poulain <tipaul at savannah.gnu.org>	06/04/04 13:13:47

Modified files:
	.              : overdue.pl 

Log message:
	* using a left join to avoid missing some lines.
	* fixing a bug when a parameter is empty.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha/overdue.pl.diff?only_with_tag=rel_2_2&tr1=1.9.2.10&tr2=1.9.2.11&r1=text&r2=text

Patches:
Index: koha/overdue.pl
diff -u koha/overdue.pl:1.9.2.10 koha/overdue.pl:1.9.2.11
--- koha/overdue.pl:1.9.2.10	Tue Feb  7 23:19:09 2006
+++ koha/overdue.pl	Tue Apr  4 13:13:47 2006
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: overdue.pl,v 1.9.2.10 2006/02/07 23:19:09 kados Exp $
+# $Id: overdue.pl,v 1.9.2.11 2006/04/04 13:13:47 tipaul Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -34,7 +34,7 @@
 my $bornamefilter=$input->param('borname');
 my $borcatfilter=$input->param('borcat');
 my $itemtypefilter=$input->param('itemtype');
-my $borflagsfilter=$input->param('borflags');
+my $borflagsfilter=$input->param('borflags') || " ";
 my $branchfilter=$input->param('branch');
 my $showall=$input->param('showall');
 my $theme = $input->param('theme'); # only used if allowthemeoverride is set
@@ -121,9 +121,13 @@
 $bornamefilter =~s/\*/\%/g;
 $bornamefilter =~s/\?/\_/g;
 
-my $strsth="select date_due,concat(firstname,' ',surname) as borrower, borrowers.phone, borrowers.emailaddress,issues.itemnumber, biblio.title, biblio.author from issues, borrowers,items,biblioitems, biblio where isnull(returndate) ";
+my $strsth="select date_due,concat(surname,' ', firstname) as borrower, borrowers.phone, borrowers.emailaddress,issues.itemnumber, biblio.title, biblio.author from issues
+LEFT JOIN borrowers ON issues.borrowernumber=borrowers.borrowernumber 
+LEFT JOIN items ON issues.itemnumber=items.itemnumber
+LEFT JOIN biblioitems ON biblioitems.biblioitemnumber=items.biblioitemnumber
+LEFT JOIN biblio ON biblio.biblionumber=items.biblionumber 
+where isnull(returndate) ";
 $strsth.= " && date_due<'".$todaysdate."' " unless ($showall);
-$strsth.= " && issues.borrowernumber=borrowers.borrowernumber && issues.itemnumber=items.itemnumber && biblioitems.biblioitemnumber=items.biblioitemnumber && biblio.biblionumber=items.biblionumber ";
 $strsth.=" && (borrowers.firstname like '".$bornamefilter."%' or borrowers.surname like '".$bornamefilter."%' or borrowers.cardnumber like '".$bornamefilter."%')" if($bornamefilter) ;
 $strsth.=" && borrowers.categorycode = '".$borcatfilter."' " if($borcatfilter) ;
 $strsth.=" && biblioitems.itemtype = '".$itemtypefilter."' " if($itemtypefilter) ;





More information about the Koha-cvs mailing list