Koha/installer/data/mysql/db_revs/220600047.pl
Tomas Cohen Arazi 244f68b1e0
Bug 30025: DBRev 22.06.00.047
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-09-16 16:52:16 -03:00

21 lines
1 KiB
Perl
Executable file

use Modern::Perl;
return {
bug_number => "30025",
description => "Split and rename BiblioAddsAuthorities system preference",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
my $biblio_adds_authorities = C4::Context->preference('BiblioAddsAuthorities');
# Do you stuffs here
$dbh->do(q{
INSERT IGNORE INTO systempreferences
( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
('RequireChoosingExistingAuthority',?,NULL,'Require selecting existing authority entry in controlled fields during cataloging.','YesNo'),
('AutoLinkBiblios',?,NULL,'If enabled, link biblio to authorities on creation and edit','YesNo')
},undef,($biblio_adds_authorities eq '1' ? '0' : '1', $biblio_adds_authorities));
say $out "Added RequireChoosingExistingAuthority and AutoLinkBiblios";
$dbh->do(q{DELETE FROM systempreferences WHERE variable="BiblioAddsAuthorities";});
say $out "BiblioAddsAuthorities removed";
},
};