Bug 23233: AllowItemsOnHoldCheckout is misnamed and does not indicate it is for SIP-based checkouts only

The system preference AllowItemsOnHoldCheckout only affects SIP based checkouts. I believe we should rename it AllowItemsOnHoldCheckoutSIP so it matches AllowItemsOnHoldCheckoutSCO. We should also update the description as well.

As far as I know AllowItemsOnHoldCheckout has never affected anything except SIP traffic. That does not preclude the addition of another AllowItemsOnHoldCheckout syspref that would affect the staff interface, but that would be an enhancement and is outside the scope of this bug report.

Test Plan:
1) Test AllowItemsOnHoldCheckout via SIP
2) Apply this patch
3) Test AllowItemsOnHoldCheckoutSIP via SIP
4) Note there is no difference!
5) Note the syspref description has been update to mention SIP

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 5476e77021)
This commit is contained in:
Kyle M Hall 2019-06-28 14:07:39 -04:00 committed by Lucas Gass
parent 38c2a26e0e
commit 366a80fb5b
7 changed files with 22 additions and 8 deletions

View File

@ -944,7 +944,7 @@ sub GetItemsInfo {
holding.opac_info as holding_branch_opac_info,
home.opac_info as home_branch_opac_info
";
$query .= ",IF(tmp_holdsqueue.itemnumber,1,0) AS has_pending_hold" if !C4::Context->preference('AllowItemsOnHoldCheckout');
$query .= ",IF(tmp_holdsqueue.itemnumber,1,0) AS has_pending_hold" if !C4::Context->preference('AllowItemsOnHoldCheckoutSIP');
$query .= "
FROM items
LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode
@ -958,7 +958,7 @@ sub GetItemsInfo {
LEFT JOIN itemtypes ON itemtypes.itemtype = "
. (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype');
$query .= "
LEFT JOIN tmp_holdsqueue USING (itemnumber)" if !C4::Context->preference('AllowItemsOnHoldCheckout');
LEFT JOIN tmp_holdsqueue USING (itemnumber)" if !C4::Context->preference('AllowItemsOnHoldCheckoutSIP');
$query .= q|
LEFT JOIN localization ON itemtypes.itemtype = localization.code
AND localization.entity = 'itemtypes'

View File

@ -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

View File

@ -134,7 +134,7 @@ sub BuildReport {
AgeRestrictionOverride
AllFinesNeedOverride
AllowFineOverride
AllowItemsOnHoldCheckout
AllowItemsOnHoldCheckoutSIP
AllowItemsOnHoldCheckoutSCO
AllowNotForLoanOverride
AllowRenewalLimitOverride

View File

@ -365,7 +365,7 @@ This method checks the tmp_holdsqueue to see if this item has been selected for
sub has_pending_hold {
my ( $self ) = @_;
my $pending_hold = $self->_result->tmp_holdsqueues;
return !C4::Context->preference('AllowItemsOnHoldCheckout') && $pending_hold->count ? 1: 0;
return !C4::Context->preference('AllowItemsOnHoldCheckoutSIP') && $pending_hold->count ? 1: 0;
}
=head2 Internal methods

View File

@ -0,0 +1,12 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do(q{
UPDATE systempreferences SET
variable = 'AllowItemsOnHoldCheckoutSIP',
explanation = 'Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else via SIP. This allows self checkouts for those items.'
WHERE variable = 'AllowItemsOnHoldCheckout'
});
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug XXXXX - description)\n";
}

View File

@ -27,7 +27,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('AllowHoldsOnDamagedItems','1','','Allow hold requests to be placed on damaged items','YesNo'),
('AllowHoldsOnPatronsPossessions','1',NULL,'Allow holds on records that patron have items of it','YesNo'),
('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'),
('AllowItemsOnHoldCheckoutSIP','0','','Do not generate RESERVE_WAITING and RESERVED warning when checking out items reserved to someone else via SIP. 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'),
('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'),

View File

@ -204,11 +204,13 @@ Circulation:
no: "Don't allow"
- staff to renew items that are on hold by manually specifying a due date.
-
- pref: AllowItemsOnHoldCheckout
- pref: AllowItemsOnHoldCheckoutSIP
choices:
yes: Allow
no: "Don't allow"
- checkouts of items reserved to someone else. If allowed do not generate RESERVE_WAITING and RESERVED warning. This allows self checkouts for those items. If using the holds queue items with pending holds will be marked as "unavailable" if this set to "Don't Allow".
- checkouts of items reserved to someone else via SIP checkout messages.
- If allowed do not generate RESERVE_WAITING and RESERVED warning.
- This allows self checkouts for those items. If using the holds queue items with pending holds will be marked as "unavailable" if this set to "Don't Allow".
-
- pref: AllowItemsOnHoldCheckoutSCO
choices: