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 <galen.charlton@liblime.com>
This commit is contained in:
Joe Atzberger 2009-07-22 10:23:15 -05:00 committed by Galen Charlton
parent 3dac018ccf
commit 232aa85009

View file

@ -1,6 +1,3 @@
# -*- tab-width: 8 -*-
# NOTE: This file uses standard 8-character tabs
package C4::Reserves; package C4::Reserves;
# Copyright 2000-2002 Katipo Communications # Copyright 2000-2002 Katipo Communications
@ -24,6 +21,7 @@ package C4::Reserves;
use strict; use strict;
# use warnings; # FIXME: someday
use C4::Context; use C4::Context;
use C4::Biblio; use C4::Biblio;
use C4::Items; use C4::Items;
@ -40,8 +38,6 @@ use List::MoreUtils qw( firstidx );
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
my $library_name = C4::Context->preference("LibraryName");
=head1 NAME =head1 NAME
C4::Reserves - Koha functions for dealing with reservation. C4::Reserves - Koha functions for dealing with reservation.
@ -194,16 +190,15 @@ sub AddReserve {
=item GetReservesFromBiblionumber =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> This function gets the list of reservations for one C<$biblionumber>, returning a count
given on input arg. of the reserves and an arrayref pointing to the reserves for C<$biblionumber>.
Only 1 argument has to be passed.
=cut =cut
sub GetReservesFromBiblionumber { sub GetReservesFromBiblionumber {
my ( $biblionumber, $itemnumber, $borrowernumber ) = @_; my ($biblionumber) = shift or return (0, []);
my $dbh = C4::Context->dbh; my $dbh = C4::Context->dbh;
# Find the desired items in the reserves # Find the desired items in the reserves
@ -237,9 +232,7 @@ sub GetReservesFromBiblionumber {
AND reservedate = ? AND reservedate = ?
'; ';
my $csth = $dbh->prepare($query); my $csth = $dbh->prepare($query);
$csth->execute( $data->{biblionumber}, $data->{borrowernumber}, $csth->execute($data->{biblionumber}, $data->{borrowernumber}, $data->{reservedate});
$data->{reservedate}, );
my @bibitemno; my @bibitemno;
while ( my $bibitemnos = $csth->fetchrow_array ) { while ( my $bibitemnos = $csth->fetchrow_array ) {
push( @bibitemno, $bibitemnos ); # FIXME: inefficient: use fetchall_arrayref push( @bibitemno, $bibitemnos ); # FIXME: inefficient: use fetchall_arrayref
@ -250,8 +243,8 @@ sub GetReservesFromBiblionumber {
# reserved by same person on same day # reserved by same person on same day
my $bdata; my $bdata;
if ( $count > 1 ) { if ( $count > 1 ) {
$bdata = GetBiblioItemData( $bibitemno[$i] ); $bdata = GetBiblioItemData( $bibitemno[$i] ); # FIXME: This doesn't make sense.
$i++; $i++; # $i can increase each pass, but the next @bibitemno might be smaller?
} }
else { else {
# Look up the book we just found. # Look up the book we just found.