From bb58004903c1b802767b95f37ac97dbe805ea544 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Wed, 22 Jul 2009 10:23:15 -0500 Subject: [PATCH] Fix POD for GetReservesFromBiblionumber Only one argument is needed, as the name suggests. Also removed unused package variable, added comments. Fix POD for GetReservesFromBiblionumber Only one argument is needed, as the name suggests. Also removed unused package variable, added comments. Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- C4/Reserves.pm | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 6c33a9b947..67c5d9ffa3 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1,6 +1,3 @@ -# -*- tab-width: 8 -*- -# NOTE: This file uses standard 8-character tabs - package C4::Reserves; # Copyright 2000-2002 Katipo Communications @@ -24,6 +21,7 @@ package C4::Reserves; use strict; +# use warnings; # FIXME: someday use C4::Context; use C4::Biblio; use C4::Items; @@ -40,8 +38,6 @@ use List::MoreUtils qw( firstidx ); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); -my $library_name = C4::Context->preference("LibraryName"); - =head1 NAME C4::Reserves - Koha functions for dealing with reservation. @@ -194,16 +190,15 @@ sub AddReserve { =item GetReservesFromBiblionumber -@borrowerreserv=&GetReserves($biblionumber,$itemnumber,$borrowernumber); +($count, $title_reserves) = &GetReserves($biblionumber); -this function get the list of reservation for an C<$biblionumber>, C<$itemnumber> or C<$borrowernumber> -given on input arg. -Only 1 argument has to be passed. +This function gets the list of reservations for one C<$biblionumber>, returning a count +of the reserves and an arrayref pointing to the reserves for C<$biblionumber>. =cut sub GetReservesFromBiblionumber { - my ( $biblionumber, $itemnumber, $borrowernumber ) = @_; + my ($biblionumber) = shift or return (0, []); my $dbh = C4::Context->dbh; # Find the desired items in the reserves @@ -237,9 +232,7 @@ sub GetReservesFromBiblionumber { AND reservedate = ? '; my $csth = $dbh->prepare($query); - $csth->execute( $data->{biblionumber}, $data->{borrowernumber}, - $data->{reservedate}, ); - + $csth->execute($data->{biblionumber}, $data->{borrowernumber}, $data->{reservedate}); my @bibitemno; while ( my $bibitemnos = $csth->fetchrow_array ) { push( @bibitemno, $bibitemnos ); # FIXME: inefficient: use fetchall_arrayref @@ -250,8 +243,8 @@ sub GetReservesFromBiblionumber { # reserved by same person on same day my $bdata; if ( $count > 1 ) { - $bdata = GetBiblioItemData( $bibitemno[$i] ); - $i++; + $bdata = GetBiblioItemData( $bibitemno[$i] ); # FIXME: This doesn't make sense. + $i++; # $i can increase each pass, but the next @bibitemno might be smaller? } else { # Look up the book we just found. -- 2.39.5