View | Details | Raw Unified | Return to bug 13636
Collapse All | Expand All

(-)a/C4/Reserves.pm (-9 / +3 lines)
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';
(-)a/C4/Search.pm (-2 / +1 lines)
Lines 2147-2153 sub searchResults { Link Here
2147
                    #        should map transit status to record indexed in Zebra.
2147
                    #        should map transit status to record indexed in Zebra.
2148
                    #
2148
                    #
2149
                    ($transfertwhen, $transfertfrom, $transfertto) = C4::Circulation::GetTransfers($item->{itemnumber});
2149
                    ($transfertwhen, $transfertfrom, $transfertto) = C4::Circulation::GetTransfers($item->{itemnumber});
2150
                    $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber}, $oldbiblio->{biblionumber} );
2150
                    $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} );
2151
                }
2151
                }
2152
2152
2153
                # item is withdrawn, lost, damaged, not for loan, reserved or in transit
2153
                # item is withdrawn, lost, damaged, not for loan, reserved or in transit
2154
- 

Return to bug 13636