@@ -, +, @@ additional contents - In the staff client, go to Tools -> HTML customizations and verify that the content from IntranetmainUserblock is now stored there. - The HTML customization entry form should offer IntranetmainUserblock 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 IntranetmainUserblock HTML customization and add unique content to the "fr-FR" tab. - Go to the staff client home page. You should see the content you added to the IntranetmainUserblock 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 "IntranetmainUserblock." It should return no results. --- ...netmainUserblock-to-additional-contents.pl | 40 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 - .../en/includes/html-customization-help.inc | 4 ++ .../admin/preferences/staff_interface.pref | 6 --- .../prog/en/modules/intranet-main.tt | 23 ++++++----- .../en/modules/tools/additional-contents.tt | 2 +- 6 files changed, 59 insertions(+), 17 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug-35153-move-IntranetmainUserblock-to-additional-contents.pl --- a/installer/data/mysql/atomicupdate/bug-35153-move-IntranetmainUserblock-to-additional-contents.pl +++ a/installer/data/mysql/atomicupdate/bug-35153-move-IntranetmainUserblock-to-additional-contents.pl @@ -0,0 +1,40 @@ +use Modern::Perl; + +return { + bug_number => "35153", + description => "Move IntranetmainUserblock to additional contents", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Get any existing value from the IntranetmainUserblock system preference + my ($intranetmainuserblock) = $dbh->selectrow_array( + q| + SELECT value FROM systempreferences WHERE variable='IntranetmainUserblock'; + | + ); + if ($intranetmainuserblock) { + + $dbh->do( + "INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'IntranetmainUserblock', 'IntranetmainUserblock', NULL, CAST(NOW() AS date) )" + ); + + my ($insert_id) = $dbh->selectrow_array( + "SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'IntranetmainUserblock' AND location = 'IntranetmainUserblock' LIMIT 1", + {} + ); + + $dbh->do( + "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'IntranetmainUserblock default', ?, 'default' )", + undef, $insert_id, $intranetmainuserblock + ); + + say $out "Added 'IntranetmainUserblock' HTML customization"; + } + + # Remove old system preference + $dbh->do("DELETE FROM systempreferences WHERE variable='IntranetmainUserblock'"); + say $out "Removed system preference 'IntranetmainUserblock'"; + + }, +}; --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -328,7 +328,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('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'), -('IntranetmainUserblock','','70|10','Add a block of HTML that will display on the intranet home page','Textarea'), ('IntranetNav','','70|10','Use HTML tabs to add navigational links to the top-hand navigational bar in the staff interface','Textarea'), ('IntranetNumbersPreferPhrase','0',NULL,'Control the use of phr operator in callnumber and standard number staff interface searches','YesNo'), ('intranetreadinghistory','1','','If ON, Checkout history is enabled for all patrons','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc @@ -18,6 +18,10 @@ Include this content in the popup message which is displayed in the OPAC when the CookieConsent system preference is enabled and the user clicks the "Your cookies" menu item in the header. +
+ Include this content in its own section on the main page of the staff interface +
+
Include this content in the footer of all pages in the OPAC.
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref @@ -49,12 +49,6 @@ Staff interface: - pref: intranet_includes class: file - directory in the template directory, instead of includes/. (Leave blank to disable) - - - - "Show the following HTML in its own column on the main page of the staff interface:" - - pref: IntranetmainUserblock - type: textarea - syntax: text/html - class: code - - "Show the following HTML to the left of the More menu at the top of each page on the staff interface (should be a list of links or blank):" - pref: IntranetNav --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -3,6 +3,7 @@ [% USE Koha %] [% USE Branches %] [% USE KohaDates %] +[% USE AdditionalContents %] [% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] @@ -277,17 +278,21 @@ - [% IF ( IntranetmainUserblock ) %] + [% SET IntranetmainUserblock = AdditionalContents.get( location => "IntranetmainUserblock", lang => lang, library => logged_in_user.branchcode || default_branch ) %] + + [% IF ( IntranetmainUserblock.content && IntranetmainUserblock.content.count > 0 ) %]
-
- -
-
-
- [% END %] +
+ [% FOREACH n IN IntranetmainUserblock.content %] +
+
[% n.content | $raw %]
+
+ [% END %] +
+ + + [% END # /IF IntranetmainUserblock %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt @@ -534,7 +534,7 @@ [% END %] [% END %] - [% SET staff_available_options = [ 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %] + [% SET staff_available_options = [ 'IntranetmainUserblock', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %] [% FOREACH l IN staff_available_options.sort %] [% IF l == location %] --