Bugzilla – Attachment 158747 Details for
Bug 35152
Convert RoutingListNote system preference to additional contents
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35152: Convert RoutingListNote system preference to additional contents
Bug-35152-Convert-RoutingListNote-system-preferenc.patch (text/plain), 10.09 KB, created by
Owen Leonard
on 2023-11-09 15:35:55 UTC
(
hide
)
Description:
Bug 35152: Convert RoutingListNote system preference to additional contents
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-11-09 15:35:55 UTC
Size:
10.09 KB
patch
obsolete
>From 037da24c61d4bfd8b785c0542f7a15e7caabf4c4 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 8 Nov 2023 17:37:42 +0000 >Subject: [PATCH] Bug 35152: Convert RoutingListNote system preference to > additional contents > >This patch moves the RoutingListNote system preference into HTML >customizations, making it possible to have language- and >library-specific content. > >To test you should have some content in the RoutingListNote >system preference before applying the patch. Apply the patch and run >the database update process. > >- In the staff client, go to Tools -> HTML customizations and verify > that the content from RoutingListNote is now stored there. >- The HTML customization entry form should offer RoutingListNote > 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. >- Edit the RoutingListNote HTML customization and add unique > content to the "fr-FR" tab. > >- Go to Serials and create a subscription if necessary. >- From the subscription detail page, click "Create routing list" in the > left-hand sidebar. >- Add one or more recipients to the list and click "Save". >- On the "Preview routing list" page click "Save and preview routing > slip". >- In the pop-up window with the routing list preview you should see the > content you added to the RoutingListNote HTML customization. >- 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 > "RoutingListNote." It should return no results. > >NOTE: This patch does not keep the default content which was stored by >the RoutingListNote system preference. Having a default value for that >kind of preference is not standard. Instead I have updated the >description of the RoutingSerials preference to add a mention of the >RoutingListNote HTML customization option. >--- > ...-RoutingListNote-to-additional-contents.pl | 41 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 - > .../en/includes/html-customization-help.inc | 4 ++ > .../en/modules/admin/preferences/serials.pref | 7 +--- > .../modules/serials/routing-preview-slip.tt | 14 ++++++- > .../en/modules/tools/additional-contents.tt | 2 +- > 6 files changed, 60 insertions(+), 9 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug-35152-move-RoutingListNote-to-additional-contents.pl > >diff --git a/installer/data/mysql/atomicupdate/bug-35152-move-RoutingListNote-to-additional-contents.pl b/installer/data/mysql/atomicupdate/bug-35152-move-RoutingListNote-to-additional-contents.pl >new file mode 100755 >index 0000000000..81fe414283 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug-35152-move-RoutingListNote-to-additional-contents.pl >@@ -0,0 +1,41 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "35152", >+ description => "Move RoutingListNote to additional contents", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Get any existing value from the RoutingListNote system preference >+ my ($routinglistnote) = $dbh->selectrow_array( >+ q| >+ SELECT value FROM systempreferences WHERE variable='RoutingListNote'; >+ | >+ ); >+ if ($routinglistnote) { >+ >+ # 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', 'RoutingListNote', 'RoutingListNote', NULL, CAST(NOW() AS date) )" >+ ); >+ >+ my ($insert_id) = $dbh->selectrow_array( >+ "SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'RoutingListNote' AND location = 'RoutingListNote' LIMIT 1", >+ {} >+ ); >+ >+ $dbh->do( >+ "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'RoutingListNote default', ?, 'default' )", >+ undef, $insert_id, $routinglistnote >+ ); >+ >+ say $out "Added 'RoutingListNote' additional content"; >+ } >+ >+ # Remove old system preference >+ $dbh->do("DELETE FROM systempreferences WHERE variable='RoutingListNote'"); >+ say $out "Removed system preference 'RoutingListNote'"; >+ >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 091159c3d2..f5c2365d88 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -651,7 +651,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('RisExportAdditionalFields', '', NULL , 'Define additional RIS tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.', 'textarea'), > ('RoundFinesAtPayment','0', NULL,'If enabled any fines with fractions of a cent will be rounded to the nearest cent when payments are coll ected. e.g. 1.004 will be paid off by a 1.00 payment','YesNo'), > ('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'), >-('RoutingListNote','To change this note edit <a href=\"/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped\">RoutingListNote</a> system preference.','70|10','Define a note to be shown on all routing lists','Textarea'), > ('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'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc >index 9fc3fe5d62..7ffd2c3228 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc >@@ -86,6 +86,10 @@ > Show the following content on the patron self-registration confirmation page. > </div> > >+<div id="RoutingListNote" class="hint customization_note"> >+ Include the following note on all routing list slips. >+</div> >+ > <div id="SCOMainUserBlock_notes" class="hint customization_note"> > Show this content on the web-based self checkout screen. > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref >index e24ea209a6..dc96b9a637 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref >@@ -19,18 +19,13 @@ Serials: > choices: > 1: Use > 0: "Don't use" >- - the routing list feature in the serials module. >+ - the routing list feature in the serials module. A custom message can be shown on routing slips by creating an <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customization</a> in the RoutingListNote region. > - > - pref: RoutingListAddReserves > choices: > 1: Place > 0: "Don't place" > - received serials on hold if they are on a routing list. >- - >- - "Include the following note on all routing lists:" >- - pref: RoutingListNote >- type: textarea >- class: code > - > - Show the > - pref: StaffSerialIssueDisplayCount >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt >index 2d229d0180..a1bf1c2a4c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt >@@ -1,5 +1,6 @@ > [% USE Koha %] > [% USE raw %] >+[% USE AdditionalContents %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Routing slip preview › Serials › Koha</title> >@@ -32,7 +33,18 @@ > </table> > > <div id="routingnotes"> >- <p id="generalroutingnote">[% Koha.Preference('RoutingListNote') | $raw %]</p> >+ [%- SET RoutingListNote = AdditionalContents.get( location => "RoutingListNote", lang => lang, library => logged_in_user.branchcode ) -%] >+ >+ [% IF ( RoutingListNote.content && RoutingListNote.content.count > 0 ) %] >+ <div id="[% RoutingListNote.location | html %]"> >+ [% FOREACH n IN RoutingListNote.content %] >+ <div class="[% n.lang | html %]_item"> >+ <div class="[% n.lang | html %]_body">[% n.content | $raw %]</div> >+ </div> >+ [% END %] >+ </div> >+ [% END %] >+ > <p id="routingnote">[% routingnotes | html %]</p> > </div> > >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 9a686af8d0..e751539749 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 >@@ -534,7 +534,7 @@ > [% END %] > [% END %] > </optgroup> >- [% SET staff_available_options = [ 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %] >+ [% SET staff_available_options = [ 'RoutingListNote', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %] > <optgroup label="Staff"> > [% FOREACH l IN staff_available_options.sort %] > [% IF l == location %] >-- >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 35152
:
158747
|
159718
|
167241
|
168011
|
170713
|
171030
|
176460
|
176644
|
176645