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

(-)a/C4/Reserves.pm (-1 / +25 lines)
Lines 909-914 sub CheckReserves { Link Here
909
909
910
    # Find this item in the reserves
910
    # Find this item in the reserves
911
    my @reserves = _Findgroupreserve( $bibitem, $biblio, $itemnumber, $lookahead_days, $ignore_borrowers);
911
    my @reserves = _Findgroupreserve( $bibitem, $biblio, $itemnumber, $lookahead_days, $ignore_borrowers);
912
    # When IndependentBranchesTransfers remove the reserve make form other branches
913
    @reserves = _Removereserve( @reserves );
912
914
913
    # $priority and $highest are used to find the most important item
915
    # $priority and $highest are used to find the most important item
914
    # in the list returned by &_Findgroupreserve. (The lower $priority,
916
    # in the list returned by &_Findgroupreserve. (The lower $priority,
Lines 1843-1848 sub _Findgroupreserve { Link Here
1843
    return @results;
1845
    return @results;
1844
}
1846
}
1845
1847
1848
=head2 _Removereserve
1849
1850
  @reserves = &_Removereserve( @reserves );
1851
1852
Check transfers is allowed from system preference and remove the reserves made from other branches
1853
1854
C<&_Removereserve> returns :
1855
C<@results> is an array of references-to-hash whose keys are mostly
1856
fields from the reserves table of the Koha database, plus
1857
1858
=cut
1859
1860
sub _Removereserve {
1861
    my ( @reserves) = @_;
1862
    my @results;
1863
    if ( C4::Context->preference("IndependentBranchesTransfers") && !C4::Context->IsSuperLibrarian() && scalar @reserves) {
1864
        foreach my $res (@reserves) {
1865
            push( @results, $res ) if ($res->{branchcode} eq C4::Context->userenv->{'branch'});
1866
        }
1867
    }
1868
    return @results;
1869
}
1870
1846
=head2 _koha_notify_reserve
1871
=head2 _koha_notify_reserve
1847
1872
1848
  _koha_notify_reserve( $hold->reserve_id );
1873
  _koha_notify_reserve( $hold->reserve_id );
1849
- 

Return to bug 33200