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

(-)a/C4/Reserves.pm (-4 / +3 lines)
Lines 1548-1556 sub IsAvailableForItemLevelRequest { Link Here
1548
1548
1549
    my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } );
1549
    my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } );
1550
1550
1551
    if ( $on_shelf_holds == 1 ) {
1551
    if ( $on_shelf_holds == 1 ) {    # Allow
1552
        return 1;
1552
        return 1;
1553
    } elsif ( $on_shelf_holds == 2 ) {
1553
    } elsif ( $on_shelf_holds == 2 ) {    # If all unavailable
1554
1554
1555
        # These calculations work at the biblio level, and can be expensive
1555
        # These calculations work at the biblio level, and can be expensive
1556
        # we use the in-memory cache to avoid calling once per item when looping items on a biblio
1556
        # we use the in-memory cache to avoid calling once per item when looping items on a biblio
Lines 1566-1572 sub IsAvailableForItemLevelRequest { Link Here
1566
        $memory_cache->set_in_cache( $cache_key, $any_available );
1566
        $memory_cache->set_in_cache( $cache_key, $any_available );
1567
        return $any_available ? 0 : 1;
1567
        return $any_available ? 0 : 1;
1568
1568
1569
    } else {  # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved)
1569
    } else {    # on_shelf_holds == 0 [If any unavailable]
1570
        return $item->notforloan < 0 || $item->onloan || $item->holds->filter_by_found->count;
1570
        return $item->notforloan < 0 || $item->onloan || $item->holds->filter_by_found->count;
1571
    }
1571
    }
1572
}
1572
}
1573
- 

Return to bug 19690