From 6eae239bb291f0f74b1ba09eb56bb014b4bce916 Mon Sep 17 00:00:00 2001 From: finlayt Date: Thu, 25 Jul 2002 21:41:10 +0000 Subject: [PATCH] Changed FindReserves so that it gets biblioitem data if the reserve has a reserve constraint. --- C4/Reserves2.pm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/C4/Reserves2.pm b/C4/Reserves2.pm index 24a3f611e6..2c1ed38456 100755 --- a/C4/Reserves2.pm +++ b/C4/Reserves2.pm @@ -4,6 +4,7 @@ use strict; require Exporter; use DBI; use C4::Database; +use C4::Search; #use C4::Accounts; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -51,8 +52,25 @@ sub FindReserves { my $i=0; my @results; while (my $data=$sth->fetchrow_hashref){ - $results[$i]=$data; - $i++; + if ($data->{'constrainttype'} eq 'o') { + my $conquery = "SELECT biblioitemnumber FROM reserveconstraints + WHERE biblionumber = ? + AND borrowernumber = ? + AND reservedate = ?"; + my $csth=$dbh->prepare($conquery); + my $bibn = $data->{'biblionumber'}; + my $born = $data->{'borrowernumber'}; + my $resd = $data->{'reservedate'}; + $csth->execute($bibn, $born, $resd); + my ($bibitemno) = $csth->fetchrow_array; + $csth->finish; + my $bdata = C4::Search::bibitemdata($bibitemno); + foreach my $key (keys %$bdata) { + $data->{$key} = $bdata->{$key}; + } + } + $results[$i]=$data; + $i++; } # print $query; $sth->finish; -- 2.39.5