Bug 23909: Add syspref values and atomicupdate
AllowItemsOnHoldCheckoutSCO and AllowItemsOnHoldCheckoutSIP become Choice (0|1|2) so libraries can distinguish pending from waiting holds: 0 = Don't allow (unchanged) 1 = Allow pending holds only (new semantics; previously "Allow") 2 = Allow pending and waiting holds (preserves old permissive behaviour) A new AllowHoldCheckoutOverride YesNo preference (default 1) follows the existing Allow*Override family and lets libraries block the "check out anyway" override in the staff interface when an item is on hold for another patron. Note: installations that previously had either Allow*CheckoutSCO/SIP set to 1 will migrate to "Allow pending only". Libraries that relied on the previous behaviour (silently allowing checkout of items already waiting on the hold shelf) need to manually switch to 2. Test plan: - Apply the patch and restart Koha. - Run the web installer / updatedatabase.pl. - Confirm no errors and the log mentions the three sysprefs. - Run it a second time; confirm the "already migrated" / "already exists" skip messages appear. - In Administration > System preferences, search for AllowItemsOnHoldCheckoutSCO and AllowItemsOnHoldCheckoutSIP and confirm the dropdown now has three options. - Confirm AllowHoldCheckoutOverride appears in the same section with the Allow/Don't allow choices and defaults to Allow. Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
dc866af68b
commit
83155b8ffd
|
|
@ -0,0 +1,58 @@
|
|||
use Modern::Perl;
|
||||
use Koha::Installer::Output qw(say_warning say_success say_info);
|
||||
|
||||
return {
|
||||
bug_number => "23909",
|
||||
description => "Distinguish pending and waiting holds at checkout",
|
||||
up => sub {
|
||||
my ($args) = @_;
|
||||
my ( $dbh, $out ) = @$args{qw(dbh out)};
|
||||
|
||||
for my $pref (qw(AllowItemsOnHoldCheckoutSCO AllowItemsOnHoldCheckoutSIP)) {
|
||||
my ($type) = $dbh->selectrow_array(
|
||||
q{SELECT type FROM systempreferences WHERE variable = ?},
|
||||
undef, $pref,
|
||||
);
|
||||
|
||||
if ( $type && $type eq 'Choice' ) {
|
||||
say_warning( $out, "System preference '$pref' already migrated to Choice, skipping" );
|
||||
next;
|
||||
}
|
||||
|
||||
$dbh->do(
|
||||
q{
|
||||
UPDATE systempreferences
|
||||
SET type = 'Choice', options = '0|1|2'
|
||||
WHERE variable = ?
|
||||
},
|
||||
undef, $pref,
|
||||
);
|
||||
say $out "Updated system preference '$pref' to Choice (0|1|2)";
|
||||
say_info(
|
||||
$out,
|
||||
"If '$pref' was previously set to 'Allow' (1) and you want to continue allowing "
|
||||
. "checkout of waiting holds, change it to 'Allow pending and waiting' (2). "
|
||||
. "Value 1 now means 'Allow pending only'."
|
||||
);
|
||||
}
|
||||
|
||||
my $rv = $dbh->do(
|
||||
q{
|
||||
INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
|
||||
VALUES (
|
||||
'AllowHoldCheckoutOverride',
|
||||
'1',
|
||||
NULL,
|
||||
'Allow staff to override and check out items that are on hold for another patron',
|
||||
'YesNo'
|
||||
)
|
||||
}
|
||||
);
|
||||
|
||||
if ( $rv && $rv > 0 ) {
|
||||
say_success( $out, "Added new system preference 'AllowHoldCheckoutOverride'" );
|
||||
} else {
|
||||
say_warning( $out, "System preference 'AllowHoldCheckoutOverride' already exists, skipping" );
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
@ -33,6 +33,7 @@ INSERT INTO systempreferences ( `variable`, `value` ) VALUES
|
|||
('AllowCheckoutNotes', '0'),
|
||||
('AllowFineOverride','0'),
|
||||
('AllowFineOverrideRenewing','0'),
|
||||
('AllowHoldCheckoutOverride','1'),
|
||||
('AllowHoldDateInFuture','0'),
|
||||
('AllowHoldItemTypeSelection','0'),
|
||||
('AllowHoldPolicyOverride','0'),
|
||||
|
|
|
|||
|
|
@ -225,13 +225,20 @@ Circulation:
|
|||
0: "Don't allow"
|
||||
- staff to renew items that are on hold.
|
||||
-
|
||||
- pref: AllowItemsOnHoldCheckoutSIP
|
||||
- pref: AllowHoldCheckoutOverride
|
||||
choices:
|
||||
1: Allow
|
||||
0: "Don't allow"
|
||||
- staff to override and check out items that are on hold for another patron. When not allowed, checkouts of items with a pending or waiting hold are blocked at the staff interface with no override option.
|
||||
-
|
||||
- pref: AllowItemsOnHoldCheckoutSIP
|
||||
choices:
|
||||
0: "Don't allow"
|
||||
1: "Allow pending holds only"
|
||||
2: "Allow pending and waiting holds"
|
||||
- checkouts of items reserved to someone else via SIP checkout messages.
|
||||
- If allowed do not generate 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".
|
||||
- When set to "Allow pending holds only" items with a pending hold (no pickup notification sent yet) can be checked out, but items already waiting on the hold shelf (or in transit/processing for pickup) are blocked.
|
||||
- When set to "Allow pending and waiting holds" all on-hold items can be checked out regardless of hold state. If using the holds queue, items with pending holds will be marked as "unavailable" if this is set to "Don't allow".
|
||||
-
|
||||
- pref: AllowItemsOnLoanCheckoutSIP
|
||||
choices:
|
||||
|
|
@ -243,9 +250,12 @@ Circulation:
|
|||
-
|
||||
- pref: AllowItemsOnHoldCheckoutSCO
|
||||
choices:
|
||||
1: Allow
|
||||
0: "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.
|
||||
1: "Allow pending holds only"
|
||||
2: "Allow pending and waiting holds"
|
||||
- checkouts of items reserved to someone else in the SCO module.
|
||||
- When set to "Allow pending holds only" items with a pending hold (no pickup notification sent yet) can be checked out, but items already waiting on the hold shelf (or in transit/processing for pickup) are blocked.
|
||||
- When set to "Allow pending and waiting holds" all on-hold items can be checked out regardless of hold state.
|
||||
-
|
||||
- pref: AllFinesNeedOverride
|
||||
choices:
|
||||
|
|
|
|||
Loading…
Reference in New Issue