Koha/installer/data/mysql/db_revs/220600064.pl
Tomas Cohen Arazi 7a413f8015
Bug 32191: Tidy upgrade scripts output
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-11-14 15:08:10 -03:00

30 lines
1.1 KiB
Perl
Executable file

use Modern::Perl;
return {
bug_number => "14783",
description => "Allow patrons to change pickup location for non-waiting holds",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do(q{
INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
VALUES ('OPACAllowUserToChangeBranch','','Pending, In-Transit, Suspended','Allow users to change the library to pick up a hold for these statuses:','multiple');
});
say $out "Added new system preference 'OPACAllowUserToChangeBranch'";
$dbh->do(q{
UPDATE systempreferences
SET value=(SELECT CASE WHEN value=1 THEN 'intransit' ELSE '' END FROM systempreferences WHERE variable='OPACInTransitHoldPickupLocationChange')
WHERE variable='OPACAllowUserToChangeBranch'
});
$dbh->do(q{
DELETE FROM systempreferences
WHERE variable = 'OPACInTransitHoldPickupLocationChange'
});
say $out "Removed system preference 'OPACInTransitHoldPickupLocationChange'";
},
};