From c93041e375e61c0063cf8c059279d5417836b357 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 20 Feb 2025 15:26:01 +0000 Subject: [PATCH] Bug 31642: Use the AV categories to control locations for HTML customizations Test plan: Go to HTML customizations. Add new. Check that you see the expected display locations. Add a new location under AV category ADD_CONT_HTML_CUSTOM. Add another HTML customization with that new location. Edit it. Signed-off-by: Marcel de Rooy Signed-off-by: David Nind --- .../en/modules/tools/additional-contents.tt | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) 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 75e1a5215b..916d93e8a2 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 @@ -2,6 +2,7 @@ [% USE Asset %] [% USE Koha %] [% USE KohaDates %] +[% USE AuthorisedValues %] [% USE Branches %] [% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] @@ -532,23 +533,35 @@ [% END %] [% END %] [% ELSE %] - [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock', 'SelfCheckHelpMessage', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions', 'ILLModuleCopyrightClearance' ] %] + [%# NOTE: Since bug 31642 you can add new options (i.e. block locations) via Authorised Values %} + [%# Use the three AV categories: ADD_CONT_HTML_OPAC_SYSTEM, ADD_CONT_HTML_STAFF_SYSTEM or ADD_CONT_HTML_CUSTOM %] + [% SET opac_available_options = AuthorisedValues.Get('ADD_CONT_HTML_OPAC_SYSTEM') %] - [% FOREACH l IN opac_available_options.sort %] - [% IF l == location %] - + [% FOREACH l IN opac_available_options %] + [% IF l.authorised_value == location %] + [% ELSE %] - + [% END %] [% END %] - [% SET staff_available_options = [ 'IntranetmainUserblock', 'RoutingListNote', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffLoginInstructions', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %] + [% SET staff_available_options = AuthorisedValues.Get('ADD_CONT_HTML_STAFF_SYSTEM') %] - [% FOREACH l IN staff_available_options.sort %] - [% IF l == location %] - + [% FOREACH l IN staff_available_options %] + [% IF l.authorised_value == location %] + [% ELSE %] - + + [% END %] + [% END %] + + [% SET custom_available_options = AuthorisedValues.Get('ADD_CONT_HTML_CUSTOM') %] + + [% FOREACH l IN custom_available_options %] + [% IF l.authorised_value == location %] + + [% ELSE %] + [% END %] [% END %] -- 2.39.5