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

(-)a/C4/Reserves.pm (-2 / +2 lines)
Lines 794-801 sub CheckReserves { Link Here
794
    # if item is not for loan it cannot be reserved either.....
794
    # if item is not for loan it cannot be reserved either.....
795
    # except where items.notforloan < 0 :  This indicates the item is holdable.
795
    # except where items.notforloan < 0 :  This indicates the item is holdable.
796
796
797
    my $SkipHoldTrapOnNotForLoanValue = C4::Context->preference('SkipHoldTrapOnNotForLoanValue');
797
    my @SkipHoldTrapOnNotForLoanValue = split( '|', C4::Context->preference('SkipHoldTrapOnNotForLoanValue') );
798
    return if $SkipHoldTrapOnNotForLoanValue && $notforloan_per_item eq $SkipHoldTrapOnNotForLoanValue;
798
    return if @SkipHoldTrapOnNotForLoanValue && grep( $notforloan_per_item, @SkipHoldTrapOnNotForLoanValue );
799
799
800
    my $dont_trap = C4::Context->preference('TrapHoldsOnOrder') ? ($notforloan_per_item > 0) : ($notforloan_per_item && 1 );
800
    my $dont_trap = C4::Context->preference('TrapHoldsOnOrder') ? ($notforloan_per_item > 0) : ($notforloan_per_item && 1 );
801
    return if $dont_trap or $notforloan_per_itemtype;
801
    return if $dont_trap or $notforloan_per_itemtype;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +2 lines)
Lines 527-536 Circulation: Link Here
527
                  no: "Don't trap"
527
                  no: "Don't trap"
528
            - items that are not for loan but holdable ( notforloan < 0 ) to fill holds.
528
            - items that are not for loan but holdable ( notforloan < 0 ) to fill holds.
529
        -
529
        -
530
            - Never trap items with a 'not for loan' value of
530
            - Never trap items with 'not for loan' values of
531
            - pref: SkipHoldTrapOnNotForLoanValue
531
            - pref: SkipHoldTrapOnNotForLoanValue
532
              class: integer
532
              class: integer
533
            - to fill holds.
533
            - to fill holds.
534
            - "(list of not for loan values separated with a pipe '|')"
534
        -
535
        -
535
            - pref: HoldsAutoFill
536
            - pref: HoldsAutoFill
536
              choices:
537
              choices:
(-)a/t/db_dependent/Holds.t (-2 / +3 lines)
Lines 7-13 use t::lib::TestBuilder; Link Here
7
7
8
use C4::Context;
8
use C4::Context;
9
9
10
use Test::More tests => 65;
10
use Test::More tests => 66;
11
use MARC::Record;
11
use MARC::Record;
12
12
13
use C4::Biblio;
13
use C4::Biblio;
Lines 365-370 t::lib::Mocks::mock_preference( 'TrapHoldsOnOrder', 1 ); Link Here
365
ok( defined( ( CheckReserves($itemnumber) )[1] ), "Hold is trapped for item that is not for loan but holdable ( notforloan < 0 )" );
365
ok( defined( ( CheckReserves($itemnumber) )[1] ), "Hold is trapped for item that is not for loan but holdable ( notforloan < 0 )" );
366
t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '-1' );
366
t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '-1' );
367
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" );
367
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" );
368
t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '-1|1' );
369
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" );
368
$hold->delete();
370
$hold->delete();
369
371
370
# Regression test for bug 9532
372
# Regression test for bug 9532
371
- 

Return to bug 25232