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

(-)a/C4/Reserves.pm (-1 / +26 lines)
Lines 847-852 sub CheckReserves { Link Here
847
847
848
    # Find this item in the reserves
848
    # Find this item in the reserves
849
    my @reserves = _Findgroupreserve( $item->biblionumber, $item->itemnumber, $lookahead_days, $ignore_borrowers);
849
    my @reserves = _Findgroupreserve( $item->biblionumber, $item->itemnumber, $lookahead_days, $ignore_borrowers);
850
    # When IndependentBranchesTransfers is activate remove the reserve made from other branches
851
    @reserves = _FilterHoldsForIndependentBranches( @reserves );
850
852
851
    # $priority and $highest are used to find the most important item
853
    # $priority and $highest are used to find the most important item
852
    # in the list returned by &_Findgroupreserve. (The lower $priority,
854
    # in the list returned by &_Findgroupreserve. (The lower $priority,
Lines 1755-1760 sub _Findgroupreserve { Link Here
1755
    return @results;
1757
    return @results;
1756
}
1758
}
1757
1759
1760
=head2 _Removereserve
1761
1762
  @reserves = &_Removereserve( @reserves );
1763
1764
Check transfers is allowed from system preference and remove the reserves made from other branches
1765
1766
C<&_Removereserve> returns :
1767
C<@results> is an array of references-to-hash whose keys are mostly
1768
fields from the reserves table of the Koha database, plus
1769
1770
=cut
1771
1772
sub _Removereserve {
1773
    my ( @reserves) = @_;
1774
    if ( C4::Context->preference("IndependentBranchesTransfers") && !C4::Context->IsSuperLibrarian() && scalar @reserves) {
1775
        my @results;
1776
        foreach my $res (@reserves) {
1777
            push( @results, $res ) if ($res->{branchcode} eq C4::Context->userenv->{'branch'});
1778
        }
1779
        return @results;
1780
    }
1781
    return @reserves;
1782
}
1783
1758
=head2 _koha_notify_reserve
1784
=head2 _koha_notify_reserve
1759
1785
1760
  _koha_notify_reserve( $hold->reserve_id );
1786
  _koha_notify_reserve( $hold->reserve_id );
1761
- 

Return to bug 33200