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

(-)a/C4/Reserves.pm (-1 / +26 lines)
Lines 876-881 sub CheckReserves { Link Here
876
876
877
    # Find this item in the reserves
877
    # Find this item in the reserves
878
    my @reserves = _Findgroupreserve( $item->biblionumber, $item->itemnumber, $lookahead_days, $ignore_borrowers);
878
    my @reserves = _Findgroupreserve( $item->biblionumber, $item->itemnumber, $lookahead_days, $ignore_borrowers);
879
    # When IndependentBranchesTransfers is activate remove the reserve made from other branches
880
    @reserves = _FilterHoldsForIndependentBranches( @reserves );
879
881
880
    # $priority and $highest are used to find the most important item
882
    # $priority and $highest are used to find the most important item
881
    # in the list returned by &_Findgroupreserve. (The lower $priority,
883
    # in the list returned by &_Findgroupreserve. (The lower $priority,
Lines 1807-1812 sub _Findgroupreserve { Link Here
1807
    return @results;
1809
    return @results;
1808
}
1810
}
1809
1811
1812
=head2 _Removereserve
1813
1814
  @reserves = &_Removereserve( @reserves );
1815
1816
Check transfers is allowed from system preference and remove the reserves made from other branches
1817
1818
C<&_Removereserve> returns :
1819
C<@results> is an array of references-to-hash whose keys are mostly
1820
fields from the reserves table of the Koha database, plus
1821
1822
=cut
1823
1824
sub _Removereserve {
1825
    my ( @reserves) = @_;
1826
    if ( C4::Context->preference("IndependentBranchesTransfers") && !C4::Context->IsSuperLibrarian() && scalar @reserves) {
1827
        my @results;
1828
        foreach my $res (@reserves) {
1829
            push( @results, $res ) if ($res->{branchcode} eq C4::Context->userenv->{'branch'});
1830
        }
1831
        return @results;
1832
    }
1833
    return @reserves;
1834
}
1835
1810
=head2 _koha_notify_reserve
1836
=head2 _koha_notify_reserve
1811
1837
1812
  _koha_notify_reserve( $hold->reserve_id );
1838
  _koha_notify_reserve( $hold->reserve_id );
1813
- 

Return to bug 33200