[Koha-cvs] CVS: koha/C4 Reserves2.pm,1.11,1.12
Finlay Thompson
finlayt at users.sourceforge.net
Fri Jul 26 03:08:50 CEST 2002
Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv27878/C4
Modified Files:
Reserves2.pm
Log Message:
Fixxing bugs
Index: Reserves2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Reserves2.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** Reserves2.pm 25 Jul 2002 21:41:10 -0000 1.11
--- Reserves2.pm 26 Jul 2002 01:08:48 -0000 1.12
***************
*** 48,51 ****
--- 48,52 ----
}
$query.=" order by priority";
+ warn $query;
my $sth=$dbh->prepare($query);
$sth->execute;
***************
*** 81,84 ****
--- 82,86 ----
sub CheckReserves {
my ($item) = @_;
+ warn "In CheckReserves";
my $dbh=C4Connect;
my $qitem=$dbh->quote($item);
***************
*** 104,108 ****
--- 106,115 ----
}
}
+ warn "highest = $highest";
$highest->{'itemnumber'} = $item;
+ foreach my $key (keys %$highest) {
+ warn "$key : $highest->{$key}\n";
+ }
+
return ("Reserved", $highest);
} else {
***************
*** 354,365 ****
my $dbh = &C4Connect;
my $const = lc substr($constraint,0,1);
! my $query = "select * from borrowers,categories
! where (borrowernumber = '$borrnum')
! and (borrowers.categorycode = categories.categorycode)";
my $sth = $dbh->prepare($query);
! $sth->execute;
my $data = $sth->fetchrow_hashref;
! $sth->finish();
! my $fee = $data->{'reservefee'};
my $cntitems = @->$bibitems;
if ($fee > 0) {
--- 361,372 ----
my $dbh = &C4Connect;
my $const = lc substr($constraint,0,1);
! my $query = "SELECT * FROM borrowers,categories
! WHERE (borrowernumber = ?)
! AND (borrowers.categorycode = categories.categorycode)";
my $sth = $dbh->prepare($query);
! $sth->execute($borrnum);
my $data = $sth->fetchrow_hashref;
! $sth->finish();
! my $fee = $data->{'reservefee'};
my $cntitems = @->$bibitems;
if ($fee > 0) {
***************
*** 367,375 ****
# first find biblioitem records
my @biblioitems;
! my $query1 = "select * from biblio,biblioitems
! where (biblio.biblionumber = '$biblionumber')
! and (biblio.biblionumber = biblioitems.biblionumber)";
my $sth1 = $dbh->prepare($query1);
! $sth1->execute();
while (my $data1=$sth1->fetchrow_hashref) {
if ($const eq "a") {
--- 374,382 ----
# first find biblioitem records
my @biblioitems;
! my $query1 = "SELECT * FROM biblio,biblioitems
! WHERE (biblio.biblionumber = ?)
! AND (biblio.biblionumber = biblioitems.biblionumber)";
my $sth1 = $dbh->prepare($query1);
! $sth1->execute($biblionumber);
while (my $data1=$sth1->fetchrow_hashref) {
if ($const eq "a") {
***************
*** 402,416 ****
while ($x < $cntitemsfound) {
my $bitdata = $biblioitems[$x];
! my $query2 = "select * from items
! where biblioitemnumber = '$bitdata->{'biblioitemnumber'}'";
my $sth2 = $dbh->prepare($query2);
! $sth2->execute;
while (my $itdata=$sth2->fetchrow_hashref) {
! my $query3 = "select * from issues
! where itemnumber = '$itdata->{'itemnumber'}' and
! returndate is null";
my $sth3 = $dbh->prepare($query3);
! $sth3->execute();
if (my $isdata=$sth3->fetchrow_hashref) {
} else {
--- 409,423 ----
while ($x < $cntitemsfound) {
my $bitdata = $biblioitems[$x];
! my $query2 = "SELECT * FROM items
! WHERE biblioitemnumber = ?";
my $sth2 = $dbh->prepare($query2);
! $sth2->execute($bitdata->{'biblioitemnumber'});
while (my $itdata=$sth2->fetchrow_hashref) {
! my $query3 = "SELECT * FROM issues
! WHERE itemnumber = ?
! AND returndate IS NULL";
my $sth3 = $dbh->prepare($query3);
! $sth3->execute($itdata->{'itemnumber'});
if (my $isdata=$sth3->fetchrow_hashref) {
} else {
***************
*** 421,428 ****
}
if ($allissued == 0) {
! my $rquery = "select * from reserves
! where biblionumber = '$biblionumber'";
my $rsth = $dbh->prepare($rquery);
! $rsth->execute();
if (my $rdata = $rsth->fetchrow_hashref) {
} else {
--- 428,434 ----
}
if ($allissued == 0) {
! my $rquery = "SELECT * FROM reserves WHERE biblionumber = ?";
my $rsth = $dbh->prepare($rquery);
! $rsth->execute($biblionumber);
if (my $rdata = $rsth->fetchrow_hashref) {
} else {
More information about the Koha-cvs
mailing list