Bugzilla – Attachment 157105 Details for
Bug 35048
Convert SCOMainUserBlock system preference to HTML customization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35048: Convert SCOMainUserBlock system preference to HTML customization
Bug-35048-Convert-SCOMainUserBlock-system-preferen.patch (text/plain), 9.67 KB, created by
Lucas Gass (lukeg)
on 2023-10-13 14:23:34 UTC
(
hide
)
Description:
Bug 35048: Convert SCOMainUserBlock system preference to HTML customization
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-10-13 14:23:34 UTC
Size:
9.67 KB
patch
obsolete
>From e3ea5c2767ab996e167173d74d36d190b32903da Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 12 Oct 2023 18:01:04 +0000 >Subject: [PATCH] Bug 35048: Convert SCOMainUserBlock system preference to HTML > customization > >This patch moves the SCOMainUserBlock system preference into HTML >customizations, making it possible to have language- and >library-specific content. > >The patch also makes a minor fix to CSS in order to get the "Back to >top" link to show up correctly in self-checkout and self-checkin. > >To test you should have some content in the SCOMainUserBlock >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 SCOMainUserBlock is now stored there. >- The HTML customization entry form should offer SCOMainUserBlock > 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 SCOMainUserBlock HTML customization and add unique > content to the "fr-FR" tab. > >- Log into the self checkout system and confirm that the > SCOMainUserBlock 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 > "SCOMainUserBlock." It should return no results. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > ...SCOMainUserBlock-to-additional-contents.pl | 32 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 - > .../admin/preferences/circulation.pref | 6 ---- > .../en/modules/tools/additional-contents.tt | 2 +- > .../opac-tmpl/bootstrap/css/src/_common.scss | 10 ++++++ > .../opac-tmpl/bootstrap/css/src/opac.scss | 10 ------ > .../bootstrap/en/modules/sco/sco-main.tt | 8 ++++- > 7 files changed, 50 insertions(+), 19 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug-35048-move-SCOMainUserBlock-to-additional-contents.pl > >diff --git a/installer/data/mysql/atomicupdate/bug-35048-move-SCOMainUserBlock-to-additional-contents.pl b/installer/data/mysql/atomicupdate/bug-35048-move-SCOMainUserBlock-to-additional-contents.pl >new file mode 100755 >index 00000000000..b3638081e30 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug-35048-move-SCOMainUserBlock-to-additional-contents.pl >@@ -0,0 +1,32 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "35048", >+ description => "Move SCOMainUserBlock to additional contents", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Get any existing value from the SCOMainUserBlock system preference >+ my ($scomainuserblock) = $dbh->selectrow_array( >+ q| >+ SELECT value FROM systempreferences WHERE variable='SCOMainUserBlock'; >+ | >+ ); >+ if ($scomainuserblock) { >+ >+ # 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', 'SCOMainUserBlock', 'SCOMainUserBlock', NULL, ?, ?, ?, CAST(NOW() AS date) )", >+ undef, "SCOMainUserBlock $lang", >+ $scomainuserblock, $lang >+ ); >+ } >+ >+ # Remove old system preference >+ $dbh->do("DELETE FROM systempreferences WHERE variable='SCOMainUserBlock'"); >+ say $out "Bug 35048 update done"; >+ } >+ } >+ } >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 6aed5a753e2..b0e3e1e4057 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -644,7 +644,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'), > ('SavedSearchFilters', '0', NULL, 'Allow staff with permission to create/edit custom search filters', 'YesNo'), > ('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'), >-('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'), > ('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'), > ('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'), > ('SearchEngine','Zebra','Elasticsearch|Zebra','Search Engine','Choice'), >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 6b945891d07..e97f8e561bc 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 >@@ -1113,12 +1113,6 @@ Circulation: > type: textarea > syntax: javascript > class: code >- - >- - "Include the following HTML on the the web-based self checkout screen:" >- - pref: SCOMainUserBlock >- type: textarea >- syntax: text/html >- class: code > - > - "Include the following CSS on all pages in the web-based self checkout:" > - pref: SCOUserCSS >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 e7df348e3b3..8821ef3326f 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 >@@ -496,7 +496,7 @@ > [% END %] > [% END %] > [% ELSE %] >- [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %] >+ [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'SCOMainUserBlock' ] %] > [% FOREACH l IN available_options.sort %] > [% IF l == location %] > <option value="[% l | html %]" selected="selected">[% l | html %]</option> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss >index 6888ba9a298..9e92a67d6ee 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/_common.scss >@@ -847,6 +847,16 @@ button { > } > } > >+#backtotop { >+ bottom: 40px; >+ display: inline-block; >+ font-size: 120%; >+ position: fixed; >+ right: 40px; >+ text-align: center; >+ z-index: 1000; >+} >+ > #logo { > background: transparent url( "../images/koha-green-logo.svg" ) no-repeat scroll 0%; > border: 0; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >index 68412557a79..fee1abc7dec 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >+++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss >@@ -245,16 +245,6 @@ th { > } > } > >-#backtotop { >- bottom: 40px; >- display: inline-block; >- font-size: 120%; >- position: fixed; >- right: 40px; >- text-align: center; >- z-index: 1000; >-} >- > #booleansearch { > width: 80%; > } >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >index 003c792402f..85e7d80915c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >@@ -5,6 +5,8 @@ > [% USE AudioAlerts %] > [% USE To %] > [% USE Price %] >+[% USE AdditionalContents %] >+[% SET SCOMainUserBlock = AdditionalContents.get( location => "SCOMainUserBlock", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Self checkout › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %]</title> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> >@@ -436,7 +438,11 @@ > </div> <!-- / .sco_entry --> > [% END # / IF validuser %] > [% END # / UNLESS ( hide_main %] >- [% IF ( Koha.Preference('SCOMainUserBlock' ) ) %]<div id="scomainuserblock">[% Koha.Preference('SCOMainUserBlock' ) | $raw %]</div>[% END %] >+ [% IF ( SCOMainUserBlock ) %] >+ <div id="scomainuserblock"> >+ [% PROCESS koha_news_block news => SCOMainUserBlock %] >+ </div> >+ [% END %] > </div> <!-- / .span12 --> > </div> <!-- / .row --> > </div> <!-- / .container-fluid --> >-- >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 35048
:
157104
|
157105
|
157559
|
157831
|
157832
|
157918
|
157919
|
158453
|
158454
|
158722
|
158723
|
158724