Lines 852-860
sub GetReservesForBranch {
Link Here
|
852 |
|
852 |
|
853 |
=head2 GetReserveStatus |
853 |
=head2 GetReserveStatus |
854 |
|
854 |
|
855 |
$reservestatus = GetReserveStatus($itemnumber, $biblionumber); |
855 |
$reservestatus = GetReserveStatus($itemnumber); |
856 |
|
856 |
|
857 |
Take an itemnumber or a biblionumber and return the status of the reserve places on it. |
857 |
Takes an itemnumber and returns the status of the reserve placed on it. |
858 |
If several reserves exist, the reserve with the lower priority is given. |
858 |
If several reserves exist, the reserve with the lower priority is given. |
859 |
|
859 |
|
860 |
=cut |
860 |
=cut |
Lines 864-870
If several reserves exist, the reserve with the lower priority is given.
Link Here
|
864 |
## multiple reserves for that bib can have the itemnumber set |
864 |
## multiple reserves for that bib can have the itemnumber set |
865 |
## the sub is only used once in the codebase. |
865 |
## the sub is only used once in the codebase. |
866 |
sub GetReserveStatus { |
866 |
sub GetReserveStatus { |
867 |
my ($itemnumber, $biblionumber) = @_; |
867 |
my ($itemnumber) = @_; |
868 |
|
868 |
|
869 |
my $dbh = C4::Context->dbh; |
869 |
my $dbh = C4::Context->dbh; |
870 |
|
870 |
|
Lines 875-886
sub GetReserveStatus {
Link Here
|
875 |
($found, $priority) = $sth->fetchrow_array; |
875 |
($found, $priority) = $sth->fetchrow_array; |
876 |
} |
876 |
} |
877 |
|
877 |
|
878 |
if ( $biblionumber and not defined $found and not defined $priority ) { |
|
|
879 |
$sth = $dbh->prepare("SELECT found, priority FROM reserves WHERE biblionumber = ? order by priority LIMIT 1"); |
880 |
$sth->execute($biblionumber); |
881 |
($found, $priority) = $sth->fetchrow_array; |
882 |
} |
883 |
|
884 |
if(defined $found) { |
878 |
if(defined $found) { |
885 |
return 'Waiting' if $found eq 'W' and $priority == 0; |
879 |
return 'Waiting' if $found eq 'W' and $priority == 0; |
886 |
return 'Finished' if $found eq 'F'; |
880 |
return 'Finished' if $found eq 'F'; |