From 3d22e58550ac94de58b97a65033456aa186768ff Mon Sep 17 00:00:00 2001 From: arensb Date: Sat, 5 Oct 2002 23:59:40 +0000 Subject: [PATCH] Fixed some bogosity. Added some FIXMEs. --- C4/Search.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 6330454853..273b8958e2 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -88,14 +88,14 @@ sub findguarantees{ guarantor='$bornum'"; my $sth=$dbh->prepare($query); $sth->execute; + my @dat; - my $i=0; - while (my $data=$sth->fetchrow_hashref){ - $dat[$i]=$data; - $i++; + while (my $data = $sth->fetchrow_hashref) + { + push @dat, $data; } $sth->finish; - return($i,\@dat); + return (scalar(@dat), \@dat); } =item findguarantor @@ -141,6 +141,9 @@ dump of the C database table. =cut #' +# FIXME - This function is no longer used; in cases where you just +# care about one preference (which is true for most scripts), use +# C4::Context->preference. sub systemprefs { my %systemprefs; my $dbh = C4::Context->dbh; @@ -161,6 +164,9 @@ Allocates a new, unused borrower number, and returns it. =cut #' +# FIXME - This is identical to C4::Circulation::Borrower::NewBorrowerNumber. +# Pick one and stick with it. Preferably use the other one. This function +# doesn't belong in C4::Search. sub NewBorrowerNumber { my $dbh = C4::Context->dbh; my $sth=$dbh->prepare("Select max(borrowernumber) from borrowers"); -- 2.39.5