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

(-)a/C4/Reserves.pm (+3 lines)
Lines 794-799 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');
798
    return if $SkipHoldTrapOnNotForLoanValue && $notforloan_per_item eq $SkipHoldTrapOnNotForLoanValue;
799
797
    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 );
798
    return if $dont_trap or $notforloan_per_itemtype;
801
    return if $dont_trap or $notforloan_per_itemtype;
799
802
(-)a/installer/data/mysql/atomicupdate/bug_25232.perl (+11 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" );
4
    $dbh->do(q{
5
        INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
6
        ('SkipHoldTrapOnNotForLoanValue','',NULL,'If set, Koha will never trap items for hold with this notforloan value','Integer')
7
    });
8
9
    # Always end with this (adjust the bug info)
10
    NewVersion( $DBversion, 25184, "Items with a negative notforloan status should not be captured for holds");
11
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 587-592 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
587
('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'),
587
('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'),
588
('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'),
588
('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'),
589
('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'),
589
('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'),
590
('SkipHoldTrapOnNotForLoanValue','',NULL,'If set, Koha will never trap items for hold with this notforloan value','Integer'),
590
('SlipCSS','',NULL,'Slips CSS url.','free'),
591
('SlipCSS','',NULL,'Slips CSS url.','free'),
591
('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free'),
592
('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free'),
592
('SMSSendPassword', '', '', 'Password used to send SMS messages', 'free'),
593
('SMSSendPassword', '', '', 'Password used to send SMS messages', 'free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+5 lines)
Lines 526-531 Circulation: Link Here
526
                  yes: Trap
526
                  yes: Trap
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
        -
530
            - Never trap items with a 'not for loan' value of
531
            - pref: SkipHoldTrapOnNotForLoanValue
532
              class: integer
533
            - to fill holds.
529
        -
534
        -
530
            - pref: HoldsAutoFill
535
            - pref: HoldsAutoFill
531
              choices:
536
              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 => 64;
10
use Test::More tests => 65;
11
use MARC::Record;
11
use MARC::Record;
12
12
13
use C4::Biblio;
13
use C4::Biblio;
Lines 363-368 $hold = Koha::Hold->new( Link Here
363
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item that is not for loan but holdable ( notforloan < 0 )" );
363
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item that is not for loan but holdable ( notforloan < 0 )" );
364
t::lib::Mocks::mock_preference( 'TrapHoldsOnOrder', 1 );
364
t::lib::Mocks::mock_preference( 'TrapHoldsOnOrder', 1 );
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' );
367
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" );
366
$hold->delete();
368
$hold->delete();
367
369
368
# Regression test for bug 9532
370
# Regression test for bug 9532
369
- 

Return to bug 25232