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 521-530 Circulation: Link Here
521
                  no: "Don't trap"
521
                  no: "Don't trap"
522
            - items that are not for loan but holdable ( notforloan < 0 ) to fill holds.
522
            - items that are not for loan but holdable ( notforloan < 0 ) to fill holds.
523
        -
523
        -
524
            - Never trap items with a 'not for loan' value of
524
            - Never trap items with 'not for loan' values of
525
            - pref: SkipHoldTrapOnNotForLoanValue
525
            - pref: SkipHoldTrapOnNotForLoanValue
526
              class: integer
526
              class: integer
527
            - to fill holds.
527
            - to fill holds.
528
            - "(list of not for loan values separated with a pipe '|')"
528
        -
529
        -
529
            - pref: HoldsAutoFill
530
            - pref: HoldsAutoFill
530
              choices:
531
              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