diff --git a/installer/data/mysql/atomicupdate/bug-23798-move-OpacMaintenanceNotice-to-additional-contents.pl b/installer/data/mysql/atomicupdate/bug-23798-move-OpacMaintenanceNotice-to-additional-contents.pl new file mode 100755 index 0000000000..3b3a151f0f --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug-23798-move-OpacMaintenanceNotice-to-additional-contents.pl @@ -0,0 +1,29 @@ +use Modern::Perl; + +return { + bug_number => "23798", + description => "Convert OpacMaintenanceNotice system preference to additional contents", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Get any existing value from the OpacMaintenanceNotice system preference + my ($opacmaintenancenotice) = $dbh->selectrow_array( + q| + SELECT value FROM systempreferences WHERE variable='OpacMaintenanceNotice'; + | + ); + if ($opacmaintenancenotice) { + + # Insert any values found from system preference into additional_contents + $dbh->do( + "INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', 'OpacMaintenanceNotice', 'OpacMaintenanceNotice', NULL, 'OpacMaintenanceNotice default', ?, 'default', CAST(NOW() AS date) )", + undef, $opacmaintenancenotice + ); + + # Remove old system preference + $dbh->do("DELETE FROM systempreferences WHERE variable='OpacMaintenanceNotice'"); + say $out "Bug 23798 update done"; + } + } + } diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 075e732923..b599a6569d 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -487,7 +487,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OpacLocationOnDetail','holding','holding|home|both|column','In the OPAC detail, display the shelving location on its own column or under a library columns.', 'Choice'), ('OPACMandatoryHoldDates', '', '|start|end|both', 'Define which hold dates are required on OPAC reserve form', 'Choice'), ('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'), -('OpacMaintenanceNotice','','','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea'), ('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'), ('OpacMetaDescription','','','This description will show in search engine results (160 characters).','Textarea'), ('OPACMySummaryHTML','','70|10','Enter the HTML that will appear in a column on the \'my summary\' and \'my checkout history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','Textarea'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index b7d049f18e..e61ef57c42 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -55,13 +55,7 @@ OPAC: choices: 1: Show 0: "Don't show" - - "a warning that the OPAC is under maintenance, instead of the OPAC itself. Note: this shows the same warning as when the database needs to be upgraded, but unconditionally." - - - - 'Show the following HTML when OpacMaintenance is enabled:' - - pref: OpacMaintenanceNotice - type: textarea - syntax: text/html - class: code + - "a warning that the OPAC is under maintenance, instead of the OPAC itself. Note: this shows the same warning as when the database needs to be upgraded, but unconditionally. A custom message can be shown on OPAC maintenance page by creating an HTML customization in the OpacMaintenanceNotice region." - - "This description will show in search engine results (160 characters)." - pref: OpacMetaDescription diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt index 2e713d5d5b..ab5fbad1a4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt @@ -524,7 +524,7 @@ [% END %] [% END %] [% ELSE %] - [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %] + [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %] [% FOREACH l IN opac_available_options.sort %] [% IF l == location %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc index c7ff522e02..943c862eab 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -55,8 +55,8 @@ [% IF OpacLangSelectorMode == 'both' || OpacLangSelectorMode == 'footer' %] - [% IF ( opaclanguagesdisplay ) %] - [% IF ( languages_loop && opaclanguagesdisplay ) %] + [% IF ( Koha.Preference('opaclanguagesdisplay') ) %] + [% IF ( languages_loop ) %] [% UNLESS ( one_language_enabled ) %]