Bugzilla – Attachment 131581 Details for
Bug 24221
Convert OPACMySummaryNote system preference to news block
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24221: Move OPACMySummaryNote to HTML customizations in additional-contents
Bug-24221-Move-OPACMySummaryNote-to-HTML-customiza.patch (text/plain), 7.71 KB, created by
Shi Yao Wang
on 2022-03-10 20:50:08 UTC
(
hide
)
Description:
Bug 24221: Move OPACMySummaryNote to HTML customizations in additional-contents
Filename:
MIME Type:
Creator:
Shi Yao Wang
Created:
2022-03-10 20:50:08 UTC
Size:
7.71 KB
patch
obsolete
>From a9596333d0ed50067a528fb5d6bd4bbf1e406bc5 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 1 Mar 2022 17:32:13 +0000 >Subject: [PATCH] Bug 24221: Move OPACMySummaryNote to HTML customizations in > additional-contents > >To test: >1- Before applying the patch add some content to the system preference OPACMySummaryNote >2- Apply patch >3- restart_all and updatedatabase >4. Go to additional-content.pl ( HTML customizations ) >5. You should now see your content from the system preference under OpacMySummaryNote in HTML customizations >6. Try searching for the system preference, OPACMySummaryNote. It has been removed and you should not be able to find it. >7. Try changing/removing/adding content from OpacMySummaryNote in HTML customizations >8. Make sure your edits are reflected when you look at the user summary page > >Note: The system preference was named OPACMySummaryNote but in to be more consitent with how we have named other additional_contents I have renamed this OpacMySummaryNote. >Signed-off-by: shiyao <shiyao@inlibro.com> >--- > ...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 > >diff --git a/installer/data/mysql/atomicupdate/bug_24221_move-opacmysummarynote-to-addtional-contents.pl b/installer/data/mysql/atomicupdate/bug_24221_move-opacmysummarynote-to-addtional-contents.pl >new file mode 100644 >index 0000000000..61ca95d94e >--- /dev/null >+++ b/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"; >+ } >+ } >+} >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index dd83a00fd8..861c05255f 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/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'), >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 a214dae954..82ad87630f 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 >@@ -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 >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 92fcf23cc9..b611e4df73 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 >@@ -429,7 +429,7 @@ > <option value="slip">Slip</option> > [% 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 %] > <option value="[% l | html %]" selected="selected">[% l | html %]</option> > [% ELSE %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index d0a5ce3110..f5c2b7eb91 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/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) %] <!-- 1 => OPAC --> >@@ -162,9 +163,8 @@ > [% END # / IF patron_flagged %] > > <div class="alert alert-info" id="notesaved" style="display:none;"></div> >- >- [% IF Koha.Preference('OPACMySummaryNote') %] >- <div id="opac-my-summary-note">[% Koha.Preference('OPACMySummaryNote') | $raw %]</div> >+ [% IF ( OpacMySummaryNote ) %] >+ <div id="opac-my-summary-note">[% PROCESS koha_news_block news => OpacMySummaryNote %]</div> > [% END %] > > [% IF Koha.Preference('AllowPatronToControlAutorenewal') %] >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24221
:
131204
|
131581
|
132013
|
132014
|
132264