@@ -, +, @@ additional-contents OpacMoreSearches OpacMoreSearches in HTML customizations removed and you should not be able to find it. customizations OpacMoreSearch area in the OPAC. --- ...e-opacmoresearches-to-addtional-content.pl | 23 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 - .../en/modules/admin/preferences/opac.pref | 5 ---- .../en/modules/tools/additional-contents.tt | 2 +- .../bootstrap/en/includes/masthead.inc | 3 ++- 5 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_24220_move-opacmoresearches-to-addtional-content.pl --- a/installer/data/mysql/atomicupdate/bug_24220_move-opacmoresearches-to-addtional-content.pl +++ a/installer/data/mysql/atomicupdate/bug_24220_move-opacmoresearches-to-addtional-content.pl @@ -0,0 +1,23 @@ +use Modern::Perl; + +return { + bug_number => "24220", + description => "Move OpacMoreSearches to additional contents", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + # Get any existing value from the OpacMoreSearches system preference + my ( $opacmoresearches ) = $dbh->selectrow_array( q| + SELECT value FROM systempreferences WHERE variable='OpacMoreSearches'; + |); + if( $opacmoresearches ){ + # Insert any values found from system preference into additional_contents + foreach my $lang ( 'default' ) { + $dbh->do( "INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', 'OpacMoreSearches', 'OpacMoreSearches', NULL, ?, ?, ?, CAST(NOW() AS date) )", undef, "OpacMoreSearches $lang", $opacmoresearches, $lang ); + } + # Remove old system preference + $dbh->do("DELETE FROM systempreferences WHERE variable='OpacMoreSearches'"); + say $out "Bug 24220 update done"; + } + } +} --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -438,7 +438,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('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'), -('OpacMoreSearches', '', NULL, 'Add additional elements to the OPAC more searches bar', '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'), ('OPACMySummaryNote','','','Note to display on the patron summary page. This note only appears if the patron is connected.','Free'), ('OpacNewsLibrarySelect','0','','Show selector for branches on OPAC news page','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -232,11 +232,6 @@ OPAC: type: textarea syntax: text/html class: code - - - - 'Add additional elements to the "More Searches" bar on the OPAC, with the following HTML (leave blank to disable):' - - pref: OpacMoreSearches - type: textarea - class: code - - 'Include a "Links" column on the "my summary" and "my checkout history" tabs when a patron is logged in to the OPAC, with the following HTML (leave blank to disable):' - '
Note: The placeholders {BIBLIONUMBER}, {TITLE}, {ISBN} and {AUTHOR} will be replaced with information from the displayed record.' --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt @@ -424,7 +424,7 @@ [% END %] [% ELSE %] - [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText' ] %] + [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches' ] %] [% IF l == location %] [% ELSE %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -8,6 +8,7 @@ [% SET OpacHeader = AdditionalContents.get( location => "opacheader", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %] [% SET OpacCustomSearch = AdditionalContents.get( location => "OpacCustomSearch", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %] [% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %] +[% SET OpacMoreSearches = AdditionalContents.get( location => "OpacMoreSearches", lang => lang, library => branchcode ) %]
@@ -352,7 +353,7 @@ [% END %] - [% Koha.Preference('OpacMoreSearches') | $raw %] + [% PROCESS koha_news_block news => OpacMoreSearches %]
--