@@ -, +, @@ additional-contents --- ...opacmysummarynote-to-addtional-contents.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/modules/opac-user.tt | 6 ++--- 5 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_24221_move-opacmysummarynote-to-addtional-contents.pl --- a/installer/data/mysql/atomicupdate/bug_24221_move-opacmysummarynote-to-addtional-contents.pl +++ a/installer/data/mysql/atomicupdate/bug_24221_move-opacmysummarynote-to-addtional-contents.pl @@ -0,0 +1,23 @@ +use Modern::Perl; + +return { + bug_number => "24221", + description => "Move OpacMySummaryNote to additional contents", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + # Get any existing value from the OpacMySummaryNote system preference + my ( $opacmysummarynote ) = $dbh->selectrow_array( q| + SELECT value FROM systempreferences WHERE variable='OPACMySummaryNote'; + |); + if( $opacmysummarynote ){ + # 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', 'OpacMySummaryNote', 'OpacMySummaryNote', NULL, ?, ?, ?, CAST(NOW() AS date) )", undef, "OpacMySummaryNote $lang", $opacmysummarynote, $lang ); + } + # Remove old system preference + $dbh->do("DELETE FROM systempreferences WHERE variable='OPACMySummaryNote'"); + say $out "Bug 24221 update done"; + } + } +} --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -439,7 +439,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('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'), -('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'), ('OpacNoItemTypeImages','0',NULL,'If ON, disables itemtype images in the OPAC','YesNo'), ('OPACNoResultsFound','','70|10','Display this HTML when no results are found for a search in the OPAC','Textarea'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -239,11 +239,6 @@ OPAC: type: textarea syntax: text/html class: code - - - - "Note to display on the patron summary page. This note only appears if the patron is logged in:" - - pref: OPACMySummaryNote - type: textarea - syntax: text/html - - "Include the following HTML under the facets in OPAC search results:" - pref: OPACResultsSidebar --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt @@ -429,7 +429,7 @@ [% END %] [% ELSE %] - [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches' ] %] + [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote' ] %] [% IF l == location %] [% ELSE %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -9,6 +9,7 @@ [% USE AdditionalContents %] [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] +[% SET OpacMySummaryNote = AdditionalContents.get( location => "OpacMySummaryNote", lang => lang, library => branchcode ) %] [% SET borrower_club_enrollments = logged_in_user.get_club_enrollments %] [% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1) %] @@ -162,9 +163,8 @@ [% END # / IF patron_flagged %] - - [% IF Koha.Preference('OPACMySummaryNote') %] -
[% Koha.Preference('OPACMySummaryNote') | $raw %]
+ [% IF ( OpacMySummaryNote ) %] +
[% PROCESS koha_news_block news => OpacMySummaryNote %]
[% END %] [% IF Koha.Preference('AllowPatronToControlAutorenewal') %] --