Bugzilla – Attachment 183142 Details for
Bug 34563
Move IntranetCirculationHomeHTML to HTML customizations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34563: Move IntranetCirculationHomeHTML to HTML customizations
Bug-34563-Move-IntranetCirculationHomeHTML-to-HTML.patch (text/plain), 10.31 KB, created by
Lucas Gass (lukeg)
on 2025-06-10 16:21:52 UTC
(
hide
)
Description:
Bug 34563: Move IntranetCirculationHomeHTML to HTML customizations
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-06-10 16:21:52 UTC
Size:
10.31 KB
patch
obsolete
>From 49d30b109c04781830696f06f9bb9d3c7b8f8298 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 10 Jun 2025 14:08:24 +0000 >Subject: [PATCH] Bug 34563: Move IntranetCirculationHomeHTML to HTML > customizations > >This patch moves the IntranetCirculationHomeHTML system preference into >HTML customizations, making it possible to have language- and >library-specific content. > >To test you should have some content in the IntranetCirculationHomeHTML >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 IntranetCirculationHomeHTML is now stored there. >- The HTML customization entry form should offer > IntranetCirculationHomeHTML 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 IntranetCirculationHomeHTML HTML customization and add unique > content to the "fr-FR" tab. > >- Go to the circulation home page. You should see the > content you added to the IntranetCirculationHomeHTML 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 > "IntranetCirculationHomeHTML." It should return no results. > >Sponsored-by: Athens County Public Libraries >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > ...tCirculationHome-to-additional-contents.pl | 40 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 - > .../en/includes/html-customization-help.inc | 2 + > .../admin/preferences/staff_interface.pref | 6 --- > .../prog/en/modules/circ/circulation-home.tt | 24 +++++++++-- > .../en/modules/tools/additional-contents.tt | 2 +- > 6 files changed, 64 insertions(+), 11 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug-34563-move-IntranetCirculationHome-to-additional-contents.pl > >diff --git a/installer/data/mysql/atomicupdate/bug-34563-move-IntranetCirculationHome-to-additional-contents.pl b/installer/data/mysql/atomicupdate/bug-34563-move-IntranetCirculationHome-to-additional-contents.pl >new file mode 100755 >index 00000000000..0e9a6d8b0f0 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug-34563-move-IntranetCirculationHome-to-additional-contents.pl >@@ -0,0 +1,40 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "34563", >+ description => "Move IntranetCirculationHomeHTML to HTML customizations", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Get any existing value from the IntranetCirculationHomeHTML system preference >+ my ($intranetcirculationhomehtml) = $dbh->selectrow_array( >+ q| >+ SELECT value FROM systempreferences WHERE variable='IntranetCirculationHomeHTML'; >+ | >+ ); >+ if ($intranetcirculationhomehtml) { >+ >+ $dbh->do( >+ "INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'IntranetCirculationHomeHTML', 'IntranetCirculationHomeHTML', NULL, CAST(NOW() AS date) )" >+ ); >+ >+ my ($insert_id) = $dbh->selectrow_array( >+ "SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'IntranetCirculationHomeHTML' AND location = 'IntranetCirculationHomeHTML' LIMIT 1", >+ {} >+ ); >+ >+ $dbh->do( >+ "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'IntranetCirculationHomeHTML default', ?, 'default' )", >+ undef, $insert_id, $intranetcirculationhomehtml >+ ); >+ >+ say $out "Added 'IntranetCirculationHomeHTML' HTML customization"; >+ } >+ >+ # Remove old system preference >+ $dbh->do("DELETE FROM systempreferences WHERE variable='IntranetCirculationHomeHTML'"); >+ say $out "Removed system preference 'IntranetCirculationHomeHTML'"; >+ >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 09b8afd6fd8..169518d38cb 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -349,7 +349,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('IntranetBiblioDefaultView','normal','normal|marc|isbd|labeled_marc','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','Choice'), > ('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'), > ('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'), >-('IntranetCirculationHomeHTML', '', NULL, 'Show the following HTML in a div on the bottom of the reports home page', 'Free'), > ('IntranetCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the staff interface', 'YesNo'), > ('intranetcolorstylesheet','','50','Define the color stylesheet to use in the staff interface','free'), > ('IntranetFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the staff interface','free'), >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 bc0bfabe7c3..6a999d3059d 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 >@@ -14,6 +14,8 @@ > Adding content to this region will enable the copyright clearance stage in request creation. The content will appear on the OPAC during the process of placing an ILL request. > </div> > >+<div id="IntranetCirculationHomeHTML_notes" class="hint customization_note"> Include this content in its own section on the circulation home page</div> >+ > <div id="IntranetmainUserblock_notes" class="hint customization_note"> Include this content in its own section on the main page of the staff interface </div> > > <div id="opaccredits_notes" class="hint customization_note"> Include this content in the footer of all pages in the OPAC. </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >index 8da36fceb14..1be7aa47704 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >@@ -107,12 +107,6 @@ Staff interface: > - pref: SlipCSS > class: url > - on Issue and Hold Slips. (This should be a complete URL, starting with <code>http://</code>.) >- - >- - "Show the following HTML in its own div on the bottom of the home page of the circulation module:" >- - pref: IntranetCirculationHomeHTML >- type: textarea >- syntax: text/html >- class: code > - > - "Show the following HTML in its own div on the bottom of the home page of the reports module:" > - pref: IntranetReportsHomeHTML >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >index ee5dbc7c765..e20c00cc126 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >@@ -1,6 +1,7 @@ > [% USE raw %] > [% USE Koha %] > [% USE Branches %] >+[% USE AdditionalContents %] > [% PROCESS 'i18n.inc' %] > [% INCLUDE 'doc-head-open.inc' %] > <title >@@ -179,9 +180,26 @@ > [% END %] > </div> > </div> >- <div class="row" id="intranet-circulation-home-html"> >- <div class="col-md-12"> [% Koha.Preference('IntranetCirculationHomeHTML') | $raw %] </div> >- </div> >+ >+ [% SET IntranetCirculationHomeHTML = AdditionalContents.get( location => "IntranetCirculationHomeHTML", lang => lang, library => Branches.GetLoggedInBranchcode || default_branch ) %] >+ >+ [% IF ( IntranetCirculationHomeHTML.content && IntranetCirculationHomeHTML.content.count > 0 ) %] >+ <div class="row"> >+ <div class="col-sm-12"> >+ <div id="[% IntranetCirculationHomeHTML.location | html %]" class="page-section"> >+ [% FOREACH n IN IntranetCirculationHomeHTML.content %] >+ <div class="[% n.lang | html %]_item"> >+ <div class="[% n.lang | html %]_body">[% n.content | $raw %]</div> >+ </div> >+ [% END %] >+ </div> >+ <!-- /#IntranetCirculationHomeHTML --> >+ </div> >+ <!-- /.col-sm-12 --> >+ </div> >+ <!-- /.row --> >+ [% END # /IF IntranetCirculationHomeHTML %] >+ > <div class="row" id="offline-circulation"> > <div class="col-md-12"> > <h4>Offline circulation</h4> >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 330b5522acb..732432bc921 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 >@@ -542,7 +542,7 @@ > [% END %] > [% END %] > </optgroup> >- [% SET staff_available_options = [ 'IntranetmainUserblock', 'RoutingListNote', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffLoginInstructions', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %] >+ [% SET staff_available_options = [ 'IntranetCirculationHomeHTML', 'IntranetmainUserblock', 'RoutingListNote', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffLoginInstructions', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %] > <optgroup label="Staff interface"> > [% FOREACH l IN staff_available_options.sort %] > [% IF l == location %] >-- >2.39.5
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 34563
:
183134
| 183142 |
183150