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

(-)a/C4/Circulation.pm (-16 / +14 lines)
Lines 2677-2700 sub CanBookBeRenewed { Link Here
2677
            # can be filled with available items. We can get the union of the sets simply
2677
            # can be filled with available items. We can get the union of the sets simply
2678
            # by pushing all the elements onto an array and removing the duplicates.
2678
            # by pushing all the elements onto an array and removing the duplicates.
2679
            my @reservable;
2679
            my @reservable;
2680
            foreach my $b (@borrowernumbers) {
2680
            my %borrowers;
2681
                my ($borr) = C4::Members::GetMember( borrowernumber => $b);
2681
            ITEM: foreach my $i (@itemnumbers) {
2682
                foreach my $i (@itemnumbers) {
2682
                my $item = GetItem($i);
2683
                    my $item = GetItem($i);
2683
                next if IsItemOnHoldAndFound($i);
2684
                    if (  !IsItemOnHoldAndFound($i)
2684
                for my $b (@borrowernumbers) {
2685
                        && IsAvailableForItemLevelRequest( $item, $borr )
2685
                    my $borr = $borrowers{$b}//= C4::Members::GetMember(borrowernumber => $b);
2686
                        && CanItemBeReserved( $b, $i ) )
2686
                    next unless IsAvailableForItemLevelRequest($item, $borr);
2687
                    {
2687
                    next unless CanItemBeReserved($b,$i);
2688
                        push( @reservable, $i );
2688
2689
                    push @reservable, $i;
2690
                    if (@reservable >= @borrowernumbers) {
2691
                        $resfound = 0;
2692
                        last ITEM;
2689
                    }
2693
                    }
2694
                    last;
2690
                }
2695
                }
2691
            }
2696
            }
2692
2693
            @reservable = uniq(@reservable);
2694
2695
            if ( @reservable >= @borrowernumbers ) {
2696
                $resfound = 0;
2697
            }
2698
        }
2697
        }
2699
    }
2698
    }
2700
    return ( 0, "on_reserve" ) if $resfound;    # '' when no hold was found
2699
    return ( 0, "on_reserve" ) if $resfound;    # '' when no hold was found
2701
- 

Return to bug 17941