diff --git a/installer/data/mysql/db_revs/bug_20747-updatelocalholdspriority_syspref.pl b/installer/data/mysql/db_revs/bug_20747-updatelocalholdspriority_syspref.pl new file mode 100644 index 0000000000..517f554697 --- /dev/null +++ b/installer/data/mysql/db_revs/bug_20747-updatelocalholdspriority_syspref.pl @@ -0,0 +1,25 @@ +use Modern::Perl; + +return { + bug_number => "20747", + description => "Allow LocalHoldsPriority to fill by hierarchical groups system rather than individual library ", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + my $local_holds_priority = C4::Context->preference('LocalHoldsPriority'); + + # Do you stuffs here + $dbh->do( + q{ + UPDATE systempreferences + SET options='GiveLibrary|None|GiveLibraryGroup|GiveLibraryAndGroup', + value=CASE value WHEN '1' THEN 'GiveLibrary' ELSE 'None' END, + type="Choice" + WHERE variable="LocalHoldsPriority" + 'Enables the LocalHoldsPriority feature', 'None' 'Choice'), + }, + ); + + say $out "Updated system preference 'LocalHoldsPriority'"; + }, +};