From 48978a6ac59e916f9cb999436732630336db9406 Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Thu, 12 Dec 2019 20:22:43 -0300 Subject: [PATCH] Bug 23223: Add AllowItemsOnHoldCheckoutSIP preference This patch adds a new systempreference for behavior for AllowItemsOnHoldCheckout may difer between intranet, SCO and SIP To test: 1. apply this patch 2. perl installer/data/mysql/updatedatabase.pl SUCCESS => There is a new syspref called AllowItemsOnHoldCheckoutSIP 3. configure and start SIPServer 4. with misc/sip_cli_emulator.pl try to checkout an item with a hold CHECK => checkout is not allowed 5. set AllowItemsOnHoldCheckoutSIP to Allow 6. restart SIPServer 7. repeat step 4 SUCCESS => checkout is allowed 8. Sign off --- C4/SIP/ILS/Transaction/Checkout.pm | 2 +- .../data/mysql/atomicupdate/bug-23571.perl | 17 +++++++++++++++++ installer/data/mysql/sysprefs.sql | 1 + .../modules/admin/preferences/circulation.pref | 6 ++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug-23571.perl diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm index 91a22be192..e7439742dc 100644 --- a/C4/SIP/ILS/Transaction/Checkout.pm +++ b/C4/SIP/ILS/Transaction/Checkout.pm @@ -57,7 +57,7 @@ sub do_checkout { my $borrower = $patron->unblessed; $debug and warn "do_checkout borrower: . " . Dumper $borrower; my ($issuingimpossible, $needsconfirmation) = _can_we_issue($patron, $barcode, - C4::Context->preference("AllowItemsOnHoldCheckout") + C4::Context->preference("AllowItemsOnHoldCheckoutSIP") ); my $noerror=1; # If set to zero we block the issue diff --git a/installer/data/mysql/atomicupdate/bug-23571.perl b/installer/data/mysql/atomicupdate/bug-23571.perl new file mode 100644 index 0000000000..2d8a5c82b6 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug-23571.perl @@ -0,0 +1,17 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + # you can use $dbh here like: + $dbh->do(qq{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) + VALUES ('AllowItemsOnHoldCheckoutSIP','0','','Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else through SIPServer. This allows self checkouts for those items.','YesNo') + }); + + $dbh->do(qq{ + UPDATE systempreferences new, (select value from systempreferences where variable = 'AllowItemsOnHoldCheckout') old + SET new.value = old.value + WHERE new.variable = 'AllowItemsOnHoldCheckoutSIP' + }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 23571 - Add AllowItemsOnHoldCheckoutSIP preference)\n"; +} \ No newline at end of file diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 9fc3d5821e..c2357afd4c 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -29,6 +29,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('AllowCheckoutNotes', '0', NULL, 'Allow patrons to submit notes about checked out items.','YesNo'), ('AllowItemsOnHoldCheckout','0','','Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else. This allows self checkouts for those items.','YesNo'), ('AllowItemsOnHoldCheckoutSCO','0','','Do not generate RESERVE_WAITING and RESERVED warning in the SCO module when checking out items reserved to someone else. This allows self checkouts for those items.','YesNo'), +('AllowItemsOnHoldCheckoutSIP','0','','Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else through SIPServer. This allows self checkouts for those items.','YesNo'), ('AllowMultipleCovers','0','1','Allow multiple cover images to be attached to each bibliographic record.','YesNo'), ('AllowMultipleIssuesOnABiblio',1,'Allow/Don\'t allow patrons to check out multiple items from one biblio','','YesNo'), ('AllowNotForLoanOverride','0','','If ON, Koha will allow the librarian to loan a not for loan item.','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index e949eac982..5f4414aebf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -213,6 +213,12 @@ Circulation: yes: Allow no: "Don't allow" - checkouts of items reserved to someone else in the SCO module. If allowed do not generate RESERVE_WAITING and RESERVED warning. This allows self checkouts for those items. + - + - pref: AllowItemsOnHoldCheckoutSIP + choices: + yes: Allow + no: "Don't allow" + - checkouts of items reserved to someone else through SIPServer. If allowed do not generate RESERVE_WAITING and RESERVED warning. This allows self checkouts for those items. - - pref: AllFinesNeedOverride choices: -- 2.17.1