[Koha-cvs] koha/C4 Reserves2.pm

Mason James szrj1m at yahoo.com
Wed Jun 7 04:04:48 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Changes by:	Mason James <sushi>	06/06/07 02:04:48

Modified files:
	C4             : Reserves2.pm 

Log message:
	Merging Katipo changes.
	Added a bit to display the correct item type for a person who has 2 or more
	reserve this type only reserves on the same day, ie - reserved a dvd and a book with same biblio.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Reserves2.pm?cvsroot=koha&r1=1.45&r2=1.46

Patches:
Index: Reserves2.pm
===================================================================
RCS file: /sources/koha/koha/C4/Reserves2.pm,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- Reserves2.pm	7 Jun 2006 00:36:22 -0000	1.45
+++ Reserves2.pm	7 Jun 2006 02:04:48 -0000	1.46
@@ -3,7 +3,7 @@
 
 package C4::Reserves2;
 
-# $Id: Reserves2.pm,v 1.45 2006/06/07 00:36:22 sushi Exp $
+# $Id: Reserves2.pm,v 1.46 2006/06/07 02:04:48 sushi Exp $
 
 # Copyright 2000-2002 Katipo Communications
 #
@@ -283,6 +283,7 @@
     my $sth=$dbh->prepare($query);
     $sth->execute(@bind);
     my @results;
+    my $i = 0;
     while (my $data = $sth->fetchrow_hashref){
         # FIXME - What is this if-statement doing? How do constraints work?
         if ($data->{constrainttype} eq 'o') {
@@ -299,10 +300,25 @@
                 $data->{borrowernumber},
                 $data->{reservedate},
             );
-            my ($bibitemno) = $csth->fetchrow_array;
-            $csth->finish;
+
+  	   my @bibitemno;
+           while (my $bibitemnos = $csth->fetchrow_array){
+           	push (@bibitemno,$bibitemnos);
+	   }
+           my $count = @bibitemno;
+
+           # if we have two or more different specific itemtypes
+           # reserved by same person on same day
+           my $bdata;
+           if($count > 1){
+    	        warn "bibitemno $bibitemno[$i]";
+    	        $bdata = C4::Search::bibitemdata($bibitemno[$i]);
+    	        $i++;
+	   } else {
             # Look up the book we just found.
-            my $bdata = bibitemdata($bibitemno);
+                $bdata = C4::Search::bibitemdata($bibitemno[0]);
+	   }
+           $csth->finish;
             # Add the results of this latest search to the current
             # results.
             # FIXME - An 'each' would probably be more efficient.





More information about the Koha-cvs mailing list