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

(-)a/C4/Search.pm (-13 / +3 lines)
Lines 1957-1962 sub searchResults { Link Here
1957
                # is item a waiting recall?
1957
                # is item a waiting recall?
1958
                my $recallstatus = '';
1958
                my $recallstatus = '';
1959
1959
1960
                # Check some statuses before checking transfer info, respect MaxSearchResultsItemsPerRecordStatusCheck
1960
                unless (
1961
                unless (
1961
                       $item->{withdrawn}
1962
                       $item->{withdrawn}
1962
                    || $item->{itemlost}
1963
                    || $item->{itemlost}
Lines 1967-1984 sub searchResults { Link Here
1967
                    )
1968
                    )
1968
                {
1969
                {
1969
1970
1970
                    # A couple heuristics to limit how many times
1971
                    # NOTE: We are bypassing an expected Koha::Item->get_transfer call here for speed.
1971
                    # we query the database for item transfer information, sacrificing
1972
                    # TODO: Could we index the transfer status ?
1972
                    # accuracy in some cases for speed;
1973
                    #
1974
                    # 1. don't query if item has one of the other statuses
1975
                    # 2. don't check transit status if the bib has
1976
                    #    more than 20 items
1977
                    #
1978
                    # FIXME: to avoid having the query the database like this, and to make
1979
                    #        the in transit status count as unavailable for search limiting,
1980
                    #        should map transit status to record indexed in Zebra.
1981
1982
                    my $transfer = Koha::Item::Transfers->search(
1973
                    my $transfer = Koha::Item::Transfers->search(
1983
                        { itemnumber => $item->{itemnumber}, datearrived => undef, datecancelled => undef },
1974
                        { itemnumber => $item->{itemnumber}, datearrived => undef, datecancelled => undef },
1984
                        { order_by   => [ { '-desc' => 'datesent' }, { '-asc' => 'daterequested' } ] }
1975
                        { order_by   => [ { '-desc' => 'datesent' }, { '-asc' => 'daterequested' } ] }
1985
- 

Return to bug 41444