From ae61b031ae94f2319b951ce894570da46afef964 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 Signed-off-by: Laura_Escamilla Signed-off-by: Martin Renvoize --- 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 66a04d29e1..533cc7285e 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 @@ -201,7 +201,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 b2bcb07099..de869cdbac 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 8cde1a41a5..0bfd275638 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 f624843057..65d793f319 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 8684ac860e..49a0b98275 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 e624d24f84..f30834d02a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt @@ -168,7 +168,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 3153db6fa0..40727e470e 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 @@ -37,7 +37,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 25929c88e8..8a036da3e6 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.5