Bug 25232: Add ability to skip trapping items with a given notforloan value
This is a companion/alternative to bug 25184, in that it allows an
explicit workflow for placing returned books into temporary storage for
a few days for decontamination purposes.
The idea here is to create a specific notforloan value for "In
Decontamination" or something along along those lines. This notforloan
value would never be trappable. At the end of decon,
UpdateNotForLoanStatusOnCheckin could be used to remove the
notforloan status and allow checkins to be trapped to fill holds.
Test Plan:
1) Apply this patch
2) Restart all the things!
3) Give an item a negative notforloan value
4) Place a hold on the item
5) Check the item in
6) Note the item is trapped for hold
7) Set SkipHoldTrapOnNotForLoanValue to the same notforloan value
you used in step 3
8) Check the item in again
9) Note Koha did not ask you to trap the item for hold!
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 465e5562fc)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
a0673794eb
commit
b326c76cab
|
|
@ -794,6 +794,9 @@ sub CheckReserves {
|
|||
# if item is not for loan it cannot be reserved either.....
|
||||
# except where items.notforloan < 0 : This indicates the item is holdable.
|
||||
|
||||
my $SkipHoldTrapOnNotForLoanValue = C4::Context->preference('SkipHoldTrapOnNotForLoanValue');
|
||||
return if $SkipHoldTrapOnNotForLoanValue && $notforloan_per_item eq $SkipHoldTrapOnNotForLoanValue;
|
||||
|
||||
my $dont_trap = C4::Context->preference('TrapHoldsOnOrder') ? ($notforloan_per_item > 0) : ($notforloan_per_item && 1 );
|
||||
return if $dont_trap or $notforloan_per_itemtype;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
$DBversion = 'XXX'; # will be replaced by the RM
|
||||
if( CheckVersion( $DBversion ) ) {
|
||||
# $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" );
|
||||
$dbh->do(q{
|
||||
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
|
||||
('SkipHoldTrapOnNotForLoanValue','',NULL,'If set, Koha will never trap items for hold with this notforloan value','Integer')
|
||||
});
|
||||
|
||||
# Always end with this (adjust the bug info)
|
||||
NewVersion( $DBversion, 25184, "Items with a negative notforloan status should not be captured for holds");
|
||||
}
|
||||
|
|
@ -587,6 +587,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
|
|||
('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'),
|
||||
('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'),
|
||||
('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'),
|
||||
('SkipHoldTrapOnNotForLoanValue','',NULL,'If set, Koha will never trap items for hold with this notforloan value','Integer'),
|
||||
('SlipCSS','',NULL,'Slips CSS url.','free'),
|
||||
('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free'),
|
||||
('SMSSendPassword', '', '', 'Password used to send SMS messages', 'free'),
|
||||
|
|
|
|||
|
|
@ -526,6 +526,11 @@ Circulation:
|
|||
yes: Trap
|
||||
no: "Don't trap"
|
||||
- items that are not for loan but holdable ( notforloan < 0 ) to fill holds.
|
||||
-
|
||||
- Never trap items with a 'not for loan' value of
|
||||
- pref: SkipHoldTrapOnNotForLoanValue
|
||||
class: integer
|
||||
- to fill holds.
|
||||
-
|
||||
- pref: HoldsAutoFill
|
||||
choices:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use t::lib::TestBuilder;
|
|||
|
||||
use C4::Context;
|
||||
|
||||
use Test::More tests => 64;
|
||||
use Test::More tests => 65;
|
||||
use MARC::Record;
|
||||
|
||||
use C4::Biblio;
|
||||
|
|
@ -363,6 +363,8 @@ $hold = Koha::Hold->new(
|
|||
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item that is not for loan but holdable ( notforloan < 0 )" );
|
||||
t::lib::Mocks::mock_preference( 'TrapHoldsOnOrder', 1 );
|
||||
ok( defined( ( CheckReserves($itemnumber) )[1] ), "Hold is trapped for item that is not for loan but holdable ( notforloan < 0 )" );
|
||||
t::lib::Mocks::mock_preference( 'SkipHoldTrapOnNotForLoanValue', '-1' );
|
||||
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for item with notforloan value matching SkipHoldTrapOnNotForLoanValue" );
|
||||
$hold->delete();
|
||||
|
||||
# Regression test for bug 9532
|
||||
|
|
|
|||
Loading…
Reference in New Issue