diff --git a/installer/data/mysql/atomicupdate/bug-35154-move-StaffLoginInstructions-to-additional-contents.pl b/installer/data/mysql/atomicupdate/bug-35154-move-StaffLoginInstructions-to-additional-contents.pl new file mode 100755 index 0000000000..b87c3e6ee5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug-35154-move-StaffLoginInstructions-to-additional-contents.pl @@ -0,0 +1,40 @@ +use Modern::Perl; + +return { + bug_number => "35154", + description => "Move StaffLoginInstructions to additional contents", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Get any existing value from the StaffLoginInstructions system preference + my ($stafflogininstructions) = $dbh->selectrow_array( + q| + SELECT value FROM systempreferences WHERE variable='StaffLoginInstructions'; + | + ); + if ($stafflogininstructions) { + + $dbh->do( + "INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'StaffLoginInstructions', 'StaffLoginInstructions', NULL, CAST(NOW() AS date) )" + ); + + my ($insert_id) = $dbh->selectrow_array( + "SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'StaffLoginInstructions' AND location = 'StaffLoginInstructions' LIMIT 1", + {} + ); + + $dbh->do( + "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'StaffLoginInstructions default', ?, 'default' )", + undef, $insert_id, $stafflogininstructions + ); + + say $out "Added 'StaffLoginInstructions' HTML customization"; + } + + # Remove old system preference + $dbh->do("DELETE FROM systempreferences WHERE variable='StaffLoginInstructions'"); + say $out "Removed system preference 'StaffLoginInstructions'"; + + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index ede2d4d275..523bbedb3d 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -754,7 +754,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'), ('StaffInterfaceLanguages','en',NULL,'Set the default language in the staff interface.','Languages'), ('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'), -('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'), ('StaffLoginLibraryBasedOnIP', '1','', 'Set the logged in library for the user based on their current IP','YesNo'), ('StaffLoginRestrictLibraryByIP','0',NULL,'If ON, IP authentication is enabled, blocking access to the staff interface from unauthorized IP addresses based on branch','YesNo'), ('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc index d33c36cc8d..da53ce8ee6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc @@ -118,6 +118,10 @@ Show this content on the lists home page in the staff interface. +