diff --git a/installer/data/mysql/atomicupdate/bug_23909.pl b/installer/data/mysql/atomicupdate/bug_23909.pl new file mode 100755 index 0000000000..f4d7489d34 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23909.pl @@ -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" ); + } + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index c3036df4b6..67e2f42d71 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -33,6 +33,7 @@ INSERT INTO systempreferences ( `variable`, `value` ) VALUES ('AllowCheckoutNotes', '0'), ('AllowFineOverride','0'), ('AllowFineOverrideRenewing','0'), +('AllowHoldCheckoutOverride','1'), ('AllowHoldDateInFuture','0'), ('AllowHoldItemTypeSelection','0'), ('AllowHoldPolicyOverride','0'), 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 3f38417438..704dc73e33 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 @@ -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: