Bugzilla – Attachment 182888 Details for
Bug 39900
Add public REST endpoint for additional_contents
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39900: Preparation: Move html customizations options to class for reusability
Bug-39900-Preparation-Move-html-customizations-opt.patch (text/plain), 4.65 KB, created by
David Nind
on 2025-06-01 20:07:52 UTC
(
hide
)
Description:
Bug 39900: Preparation: Move html customizations options to class for reusability
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-06-01 20:07:52 UTC
Size:
4.65 KB
patch
obsolete
>From e295ec772494a9450c41916489132e5f72a91d5c Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Wed, 14 May 2025 10:41:22 +0000 >Subject: [PATCH] Bug 39900: Preparation: Move html customizations options to > class for reusability > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/AdditionalContents.pm | 33 +++++++++++++++++++ > .../en/modules/tools/additional-contents.tt | 2 -- > tools/additional-contents.pl | 6 ++-- > 3 files changed, 37 insertions(+), 4 deletions(-) > >diff --git a/Koha/AdditionalContents.pm b/Koha/AdditionalContents.pm >index ff7bf0b82a..10f37a4dba 100644 >--- a/Koha/AdditionalContents.pm >+++ b/Koha/AdditionalContents.pm >@@ -153,6 +153,39 @@ sub find_best_match { > return $alt1 // $alt2 // $alt3; > } > >+=head3 get_html_customizations_options >+ >+ Koha::AdditionalContents->get_html_customizations_options('opac'); >+ >+=cut >+ >+sub get_html_customizations_options { >+ my ($interface) = @_; >+ >+ if ( $interface eq 'opac' ) { >+ return [ >+ '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' >+ ]; >+ } >+ >+ if ( $interface eq 'staff' ) { >+ return [ >+ 'IntranetmainUserblock', 'RoutingListNote', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', >+ 'StaffCataloguingHome', 'StaffListsHome', 'StaffLoginInstructions', 'StaffPatronsHome', 'StaffPOSHome', >+ 'StaffSerialsHome' >+ ]; >+ } >+ >+ return []; >+ >+} >+ > =head3 _type > > =cut >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 330b5522ac..a5884db4bb 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 >@@ -532,7 +532,6 @@ > [% 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' ] %] > <optgroup label="OPAC"> > [% FOREACH l IN opac_available_options.sort %] > [% IF l == location %] >@@ -542,7 +541,6 @@ > [% END %] > [% END %] > </optgroup> >- [% SET staff_available_options = [ 'IntranetmainUserblock', 'RoutingListNote', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffLoginInstructions', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %] > <optgroup label="Staff interface"> > [% FOREACH l IN staff_available_options.sort %] > [% IF l == location %] >diff --git a/tools/additional-contents.pl b/tools/additional-contents.pl >index 89dacf9589..6809a94464 100755 >--- a/tools/additional-contents.pl >+++ b/tools/additional-contents.pl >@@ -72,8 +72,10 @@ if ( $op eq 'add_form' ) { > $category = $additional_content->category; > } > $template->param( >- additional_content => $additional_content, >- translated_contents => $translated_contents, >+ additional_content => $additional_content, >+ translated_contents => $translated_contents, >+ opac_available_options => Koha::AdditionalContents::get_html_customizations_options('opac'), >+ staff_available_options => Koha::AdditionalContents::get_html_customizations_options('staff'), > ); > } elsif ( $op eq 'cud-add_validate' ) { > output_and_exit_if_error( $cgi, $cookie, $template, { check => 'csrf_token' } ); >-- >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 39900
:
182439
|
182440
|
182441
|
182442
|
182443
|
182887
| 182888 |
182889
|
182890
|
182891