From b29b5cb5fde7b54a23ac316b6e009371e72d2c93 Mon Sep 17 00:00:00 2001 From: Brendan Lawlor Date: Thu, 22 Aug 2024 16:39:55 +0000 Subject: [PATCH] Bug 36083: Fix HTML additional contents for the logged in branchcode This patch updates the calls to AdditionalContents.get() to use Branches.GetLoggedInBranchcode instead of the logged in users homebranch for the library parameter. To test: 1. In Tools > HTML Customizations 2. Choose to create an entry in StaffAcquisitionsHome 3. Assign it to a specific library It's helpful to test with libraries other than Centerville 4. Add text and publication date (important or it will never display) 5. Save 6. Go to the Acquisitions Home page - logged into that library, no text displays. 7. Apply patch and refresh browser 8. Notice the library specifc content displays 9. Notice content created for all libraries still displays too 10. Test HTML content for specific libraries works on all 8 pages IntranetmainUserBlock Staff AcquisitionsHome StaffAuthoritiesHome StaffCataloguing Home StaffListsHome StaffPatronsHome StaffPOSHome StaffSerialsHome Signed-off-by: Sam Lau --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt | 2 +- .../prog/en/modules/authorities/authorities-home.tt | 2 +- .../prog/en/modules/cataloguing/cataloging-home.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt | 2 +- .../intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt index b2d862f073..2ade7ae479 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt @@ -203,7 +203,7 @@ [% END %] - [%- SET StaffAcquisitionsHome = AdditionalContents.get( location => "StaffAcquisitionsHome", lang => lang, library => logged_in_user.branchcode ) -%] + [%- SET StaffAcquisitionsHome = AdditionalContents.get( location => "StaffAcquisitionsHome", lang => lang, library => Branches.GetLoggedInBranchcode ) -%] [%- FOREACH block IN StaffAcquisitionsHome.content -%]
[%- block.content | $raw -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities-home.tt index 6cf7735c35..a5e04bb146 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities-home.tt @@ -34,7 +34,7 @@ - [%- SET StaffAuthoritiesHome = AdditionalContents.get( location => "StaffAuthoritiesHome", lang => lang, library => logged_in_user.branchcode ) -%] + [%- SET StaffAuthoritiesHome = AdditionalContents.get( location => "StaffAuthoritiesHome", lang => lang, library => Branches.GetLoggedInBranchcode ) -%] [%- FOREACH block IN StaffAuthoritiesHome.content -%]
[%- block.content | $raw -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt index 7cf87d2ee9..850601be01 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt @@ -219,7 +219,7 @@
- [%- SET StaffCataloguingHome = AdditionalContents.get( location => "StaffCataloguingHome", lang => lang, library => logged_in_user.branchcode ) -%] + [%- SET StaffCataloguingHome = AdditionalContents.get( location => "StaffCataloguingHome", lang => lang, library => Branches.GetLoggedInBranchcode ) -%] [%- FOREACH block IN StaffCataloguingHome.content -%]
[%- block.content | $raw -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt index e4940a8712..f5adaa6fd3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -276,7 +276,7 @@
- [% SET IntranetmainUserblock = AdditionalContents.get( location => "IntranetmainUserblock", lang => lang, library => logged_in_user.branchcode || default_branch ) %] + [% SET IntranetmainUserblock = AdditionalContents.get( location => "IntranetmainUserblock", lang => lang, library => Branches.GetLoggedInBranchcode || default_branch ) %] [% IF ( IntranetmainUserblock.content && IntranetmainUserblock.content.count > 0 ) %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt index 13bc58c91f..37343b771d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt @@ -120,7 +120,7 @@ [% END %] - [%- SET StaffPatronsHome = AdditionalContents.get( location => "StaffPatronsHome", lang => lang, library => logged_in_user.branchcode ) -%] + [%- SET StaffPatronsHome = AdditionalContents.get( location => "StaffPatronsHome", lang => lang, library => Branches.GetLoggedInBranchcode ) -%] [%- FOREACH block IN StaffPatronsHome.content -%]
[%- block.content | $raw -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt index 4b0a4cf709..76677c0d86 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt @@ -169,7 +169,7 @@
[% END %] - [%- SET StaffPOSHome = AdditionalContents.get( location => "StaffPOSHome", lang => lang, library => logged_in_user.branchcode ) -%] + [%- SET StaffPOSHome = AdditionalContents.get( location => "StaffPOSHome", lang => lang, library => Branches.GetLoggedInBranchcode ) -%] [%- FOREACH block IN StaffPOSHome.content -%]
[%- block.content | $raw -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt index 22e8960ea7..52fc13f9b6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt @@ -33,7 +33,7 @@ [% INCLUDE 'serials-advsearch.inc' %] - [%- SET StaffSerialsHome = AdditionalContents.get( location => "StaffSerialsHome", lang => lang, library => logged_in_user.branchcode ) -%] + [%- SET StaffSerialsHome = AdditionalContents.get( location => "StaffSerialsHome", lang => lang, library => Branches.GetLoggedInBranchcode ) -%] [%- FOREACH block IN StaffSerialsHome.content -%]
[%- block.content | $raw -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index 4a0d749579..773f8a099f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -547,7 +547,7 @@ [% END # /WRAPPER tab_panels %] [% END # /WRAPPER tabs %] - [%- SET StaffListsHome = AdditionalContents.get( location => "StaffListsHome", lang => lang, library => logged_in_user.branchcode ) -%] + [%- SET StaffListsHome = AdditionalContents.get( location => "StaffListsHome", lang => lang, library => Branches.GetLoggedInBranchcode ) -%] [%- FOREACH block IN StaffListsHome.content -%]
[%- block.content | $raw -%] -- 2.39.2