Bugzilla – Attachment 157926 Details for
Bug 35065
Convert SelfCheckHelpMessage system preference to HTML customization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35065: Convert SelfCheckHelpMessage system preference to HTML customization
Bug-35065-Convert-SelfCheckHelpMessage-system-pref.patch (text/plain), 8.99 KB, created by
Owen Leonard
on 2023-10-26 14:05:58 UTC
(
hide
)
Description:
Bug 35065: Convert SelfCheckHelpMessage system preference to HTML customization
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-10-26 14:05:58 UTC
Size:
8.99 KB
patch
obsolete
>From 6703b82de3b9e1145305c99b71ee83cb345cbe0a Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 16 Oct 2023 16:16:13 +0000 >Subject: [PATCH] Bug 35065: Convert SelfCheckHelpMessage system preference to > HTML customization > >This patch moves the SelfCheckHelpMessage system preference into HTML >customizations, making it possible to have language- and >library-specific content. > >To test you should have some content in the SelfCheckHelpMessage >system preference before applying the patch. Apply the patch, run the >database update process, and rebuild the OPAC CSS. > >- In the staff client, go to Tools -> HTML customizations and verify > that the content from SelfCheckHelpMessage is now stored there. >- The HTML customization entry form should offer SelfCheckHelpMessage > as a choice under "Display location." >- Update and reinstall active translations (for instance fr-FR): > - perl misc/translator/translate update fr-FR > - perl misc/translator/translate install fr-FR >- Enable the translation if necessary under Administration -> System > preferences -> language. >- Enable the "opaclanguagesdisplay" preference if necessary. >- Edit the SelfCheckHelpMessage HTML customization and add unique > content to the "fr-FR" tab. > >- Log into the self checkout system and click the "Help" link at the > top. >- On the help page, confirm that the SelfCheckHelpMessage content is > shown there. >- Switch to your updated translation and confirm that the content you > added for your translation shows up correctly. >- Go to Administration -> System preferences and search for > "SelfCheckHelpMessage." It should return no results. > >Signed-off-by: David Nind <david@davidnind.com> >--- > ...CheckHelpMessage-to-additional-contents.pl | 38 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 - > .../admin/preferences/circulation.pref | 6 --- > .../en/modules/tools/additional-contents.tt | 2 +- > .../bootstrap/en/modules/sco/help.tt | 4 +- > 5 files changed, 42 insertions(+), 9 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug-35065-move-SelfCheckHelpMessage-to-additional-contents.pl > >diff --git a/installer/data/mysql/atomicupdate/bug-35065-move-SelfCheckHelpMessage-to-additional-contents.pl b/installer/data/mysql/atomicupdate/bug-35065-move-SelfCheckHelpMessage-to-additional-contents.pl >new file mode 100755 >index 0000000000..6642a668ce >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug-35065-move-SelfCheckHelpMessage-to-additional-contents.pl >@@ -0,0 +1,38 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "35065", >+ description => "Move SelfCheckHelpMessage to additional contents", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Get any existing value from the SelfCheckHelpMessage system preference >+ my ($selfcheckhelpmessage) = $dbh->selectrow_array( >+ q| >+ SELECT value FROM systempreferences WHERE variable='SelfCheckHelpMessage'; >+ | >+ ); >+ if ($selfcheckhelpmessage) { >+ >+ # Insert any values found from system preference into additional_contents >+ $dbh->do( >+ "INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'SelfCheckHelpMessage', 'SelfCheckHelpMessage', NULL, CAST(NOW() AS date) )" >+ ); >+ >+ my ($insert_id) = $dbh->selectrow_array( >+ "SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'SelfCheckHelpMessage' AND location = 'SelfCheckHelpMessage' LIMIT 1", >+ {} >+ ); >+ >+ $dbh->do( >+ "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'SelfCheckHelpMessage default', ?, 'default' )", >+ undef, $insert_id, $selfcheckhelpmessage >+ ); >+ >+ # Remove old system preference >+ $dbh->do("DELETE FROM systempreferences WHERE variable='SelfCheckHelpMessage'"); >+ say $out "Bug 35065 update done"; >+ } >+ } >+ } >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 85f3e5968f..100033ec21 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -656,7 +656,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('SearchWithISBNVariations','0',NULL,'If enabled, search on all variations of the ISBN','YesNo'), > ('SearchWithISSNVariations','0',NULL,'If enabled, search on all variations of the ISSN','YesNo'), > ('SelfCheckAllowByIPRanges','',NULL,'(Leave blank if not used. Use ranges or simple ip addresses separated by spaces, like <code>192.168.1.1 192.168.0.0/24</code>.)','Short'), >-('SelfCheckHelpMessage','','70|10','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','Textarea'), > ('SelfCheckInModule', 0, NULL, 'Enable the standalone self-checkin module.', 'YesNo'), > ('SelfCheckInTimeout','120','','Define the number of seconds before the self check-in module times out.','Integer'), > ('SelfCheckInUserCSS','',NULL,'Add CSS to be included in the self check-in module in an embedded <style> tag.','free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index c752bf661a..d9126d513a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -1157,12 +1157,6 @@ Circulation: > 1: Allow > 0: "Don't allow" > - patrons to return items through web-based self checkout system. >- - >- - "Include the following HTML in the Help page of the web-based self checkout system:" >- - pref: SelfCheckHelpMessage >- type: textarea >- syntax: text/html >- class: code > - > - pref: AutoSelfCheckAllowed > choices: >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 7815e0af2d..cf372332c3 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', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions' ] %] >+ [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock', 'SelfCheckHelpMessage', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions' ] %] > <optgroup label="OPAC"> > [% FOREACH l IN opac_available_options.sort %] > [% IF l == location %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt >index 44aca3ec2c..6cac354725 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/help.tt >@@ -2,8 +2,10 @@ > [% USE Koha %] > [% USE Asset %] > [% USE KohaDates %] >+[% USE AdditionalContents %] > [% PROCESS 'i18n.inc' %] > [% INCLUDE 'doc-head-open.inc' %] >+[% SET SelfCheckHelpMessage = AdditionalContents.get( location => "SelfCheckHelpMessage", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > <title>Self checkout help › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %]</title> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> > <meta name="generator" content="Koha [% Version | html %]" /> <!-- leave this for stats --> >@@ -40,7 +42,7 @@ > > [% IF ( SelfCheckHelpMessage ) %] > <div id="selfcheckhelpmessage"> >- [% SelfCheckHelpMessage | $raw %] >+ [% PROCESS koha_news_block news => SelfCheckHelpMessage %] > </div> > [% END %] > >-- >2.30.2
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 35065
:
157204
|
157560
|
157583
|
157844
|
157845
|
157926
|
157927
|
158457
|
158458
|
158738
|
158739
|
158740