Bugzilla – Attachment 157203 Details for
Bug 35063
Convert SelfCheckInMainUserBlock system preference to HTML customization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35063: Convert SelfCheckInMainUserBlock system preference to HTML customization
Bug-35063-Convert-SelfCheckInMainUserBlock-system-.patch (text/plain), 8.82 KB, created by
Owen Leonard
on 2023-10-16 15:55:08 UTC
(
hide
)
Description:
Bug 35063: Convert SelfCheckInMainUserBlock system preference to HTML customization
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-10-16 15:55:08 UTC
Size:
8.82 KB
patch
obsolete
>From c92224305752fe7ea8e6d0b4e05635271a1204ff Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 16 Oct 2023 15:16:22 +0000 >Subject: [PATCH] Bug 35063: Convert SelfCheckInMainUserBlock system preference > to HTML customization > >This patch moves the SelfCheckInMainUserBlock system preference into >HTML customizations, making it possible to have language- and >library-specific content. > >To test you should have some content in the SelfCheckInMainUserBlock >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 SelfCheckInMainUserBlock is now stored there. >- The HTML customization entry form should offer > SelfCheckInMainUserBlock 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 SelfCheckInMainUserBlock HTML customization and add unique > content to the "fr-FR" tab. > >- Log into the self check-in system and confirm that the > SelfCheckInMainUserBlock 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 > "SelfCheckInMainUserBlock." It should return no results. >--- > ...kInMainUserBlock-to-additional-contents.pl | 32 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 - > .../admin/preferences/circulation.pref | 6 ---- > .../en/modules/tools/additional-contents.tt | 2 +- > .../bootstrap/en/modules/sci/sci-main.tt | 10 ++++-- > 5 files changed, 40 insertions(+), 11 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug-35063-move-SelfCheckInMainUserBlock-to-additional-contents.pl > >diff --git a/installer/data/mysql/atomicupdate/bug-35063-move-SelfCheckInMainUserBlock-to-additional-contents.pl b/installer/data/mysql/atomicupdate/bug-35063-move-SelfCheckInMainUserBlock-to-additional-contents.pl >new file mode 100755 >index 0000000000..8cf3d62aa2 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug-35063-move-SelfCheckInMainUserBlock-to-additional-contents.pl >@@ -0,0 +1,32 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "35063", >+ description => "Move SelfCheckInMainUserBlock to additional contents", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Get any existing value from the SelfCheckInMainUserBlock system preference >+ my ($scimainuserblock) = $dbh->selectrow_array( >+ q| >+ SELECT value FROM systempreferences WHERE variable='SelfCheckInMainUserBlock'; >+ | >+ ); >+ if ($scimainuserblock) { >+ >+ # 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', 'SelfCheckInMainUserBlock', 'SelfCheckInMainUserBlock', NULL, ?, ?, ?, CAST(NOW() AS date) )", >+ undef, "SelfCheckInMainUserBlock $lang", >+ $scimainuserblock, $lang >+ ); >+ } >+ >+ # Remove old system preference >+ $dbh->do("DELETE FROM systempreferences WHERE variable='SelfCheckInMainUserBlock'"); >+ say $out "Bug 35063 update done"; >+ } >+ } >+ } >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 156238bb27..b28fb14c1a 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -655,7 +655,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('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'), >-('SelfCheckInMainUserBlock','','70|10','Add a block of HTML that will display on the self check-in screen.','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 9fa83f7246..475021f4f7 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 >@@ -1084,12 +1084,6 @@ Circulation: > type: textarea > class: code > Self check-in module: >- - >- - "Include the following HTML on the self check-in screen:" >- - pref: SelfCheckInMainUserBlock >- type: textarea >- syntax: text/html >- class: code > - > - pref: SelfCheckInModule > 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 b41e2f2e9d..58a1867f07 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 >@@ -523,7 +523,7 @@ > [% END %] > [% END %] > [% ELSE %] >- [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'SCOMainUserBlock' ] %] >+ [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock' ] %] > [% 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/en/modules/sci/sci-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt >index 50649956c0..1e27ff3cad 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt >@@ -22,6 +22,7 @@ > [% END %] > [% PROCESS 'html_helpers.inc' %] > [% SET OpacHeader = AdditionalContents.get( location => "opacheader", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] >+[% SET SelfCheckInMainUserBlock = AdditionalContents.get( location => "SelfCheckInMainUserBlock", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% INCLUDE 'doc-head-open.inc' %] > [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %] > <title>Self check-in › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %]</title> >@@ -158,13 +159,16 @@ > </form> <!-- /#scan_form --> > </div> <!-- / #new_checkins --> > [% END # /IF ( nopermission ) %] >+ >+ [% IF ( SelfCheckInMainUserBlock ) %] >+ <div id="scimainuserblock"> >+ [% PROCESS koha_news_block news => SelfCheckInMainUserBlock %] >+ </div> >+ [% END %] > </div> <!-- / #masthead --> > </div> <!-- / .row --> > </div> <!-- / .container-fluid --> > >- [% IF ( Koha.Preference('SelfCheckInMainUserBlock') ) %] >- <div id="SelfCheckInMainUserBlock">[% Koha.Preference('SelfCheckInMainUserBlock' ) | $raw %]</div> >- [% END %] > </div> <!-- / .main --> > > [% # Help modal %] >-- >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 35063
:
157203
|
157833
|
157834
|
157835
|
157920
|
157921
|
158000
|
158001
|
158455
|
158456
|
158735
|
158736
|
158737