Bugzilla – Attachment 183007 Details for
Bug 39860
Add a way to allow for additional/custom MARC fields in the record display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39860: Move display control from system preference to additional contents
Bug-39860-Move-display-control-from-system-prefere.patch (text/plain), 8.11 KB, created by
Lucas Gass (lukeg)
on 2025-06-05 20:19:02 UTC
(
hide
)
Description:
Bug 39860: Move display control from system preference to additional contents
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-06-05 20:19:02 UTC
Size:
8.11 KB
patch
obsolete
>From f021432755309594e599fedf794dd6c50de074dc Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 5 Jun 2025 20:17:00 +0000 >Subject: [PATCH] Bug 39860: Move display control from system preference to > additional contents > >--- > C4/XSLT.pm | 35 ++++++++++++++++--- > .../en/modules/tools/additional-contents.tt | 32 +++++++++++++++++ > .../prog/en/modules/tools/tools-home.tt | 3 ++ > 3 files changed, 66 insertions(+), 4 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index a961583c15b..9fc8d3c9d88 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -33,7 +33,9 @@ use Koha::XSLT::Base; > use Koha::Libraries; > use Koha::Recalls; > use Koha::TemplateUtils qw( process_tt ); >+use Koha::AdditionalContents; > use C4::Scrubber; >+use C4::Languages; > > my $engine; #XSLT Handler object > >@@ -241,13 +243,38 @@ sub XSLTParse4Display { > } > } > my $extracontent = ''; >+ my $location; >+ my $branch = C4::Context->userenv->{branch} || ''; >+ my $lang = C4::Languages::getlanguage; >+ >+ if ( $xslsyspref eq "XSLTDetailsDisplay" ) { >+ $location = 'StaffDetailPage'; >+ } elsif ( $xslsyspref eq "XSLTResultsDisplay" ) { >+ $location = 'StaffResultsPage'; >+ } elsif ( $xslsyspref eq "OPACXSLTDetailsDisplay" ) { >+ $location = 'OPACDetailPage'; >+ } elsif ( $xslsyspref eq "OPACXSLTResultsDisplay" ) { >+ $location = 'OPACResultsPage'; >+ } >+ >+ my @record_display_customizations = Koha::AdditionalContents->search_for_display( >+ { >+ category => 'record_display', >+ location => $location, >+ lang => $lang, >+ library_id => $branch, >+ } >+ )->as_list; > >- # Check if we should add extra content based on system preference >- if ( C4::Context->preference('ExtraContentForXSLTDisplay') ) { >+ if (@record_display_customizations) { >+ foreach my $customization (@record_display_customizations) { >+ $extracontent .= $customization->content; >+ } >+ } > >+ if ($extracontent) { > my $scrubber = C4::Scrubber->new('staff'); >- my $extracontentvalue = C4::Context->preference('ExtraContentForXSLTDisplay'); >- my $extracontentproccessed = process_tt( $extracontentvalue, { record => $record } ); >+ my $extracontentproccessed = process_tt( $extracontent, { record => $record } ); > $extracontent = $scrubber->scrub($extracontentproccessed); > } > >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 330b5522acb..811a587baa8 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 >@@ -12,6 +12,8 @@ > [% t("Modify news item") | html %] > [% ELSIF category == 'pages' %] > [% t("Modify page") | html %] >+ [% ELSIF category == 'record_display' %] >+ [% t("Modify record display customization") | html %] > [% ELSE %] > [% t("Modify HTML customization") | html %] > [% END %] >@@ -20,6 +22,8 @@ > [% t("New news item") | html %] > [% ELSIF category == 'pages' %] > [% t("New page") | html %] >+ [% ELSIF category == 'record_display' %] >+ [% t("New record display customization") | html %] > [% ELSE %] > [% t("New HTML customization") | html %] > [% END %] >@@ -30,6 +34,8 @@ > [% t("News") | html %] > [% ELSIF category == 'pages' %] > [% t("Pages") | html %] >+ [% ELSIF category == 'record_display' %] >+ [% t("Record display customizations") | html %] > [% ELSE %] > [% t("HTML customizations") | html %] > [% END %] >@@ -97,6 +103,8 @@ > <a href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a> > [% ELSIF category == 'pages' %] > <a href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a> >+ [% ELSIF category == 'record_display' %] >+ <a href="/cgi-bin/koha/tools/additional-contents.pl?category=record_display">Record display customizations</a> > [% ELSE %] > <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a> > [% END %] >@@ -356,6 +364,8 @@ > [% t("News") | html %] > [% ELSIF category == 'pages' %] > [% t("Pages") | html %] >+ [% ELSIF category == 'record_display' %] >+ [% t("Record display customizations") | html %] > [% ELSE %] > [% t("HTML customizations") | html %] > [% END %] >@@ -365,6 +375,7 @@ > <a class="customization-link" href="/cgi-bin/koha/tools/additional-contents.pl?category=news">News</a> > <a class="customization-link" href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations">HTML customizations</a> > <a class="customization-link" href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a> >+ <a class="customization-link" href="/cgi-bin/koha/tools/additional-contents.pl?category=record_display">Record display customizations</a> > [% IF ( CAN_user_parameters_manage_sysprefs ) %] > <a class="syspref-link" href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACUserJS">OPACUserJS</a> > <a class="syspref-link" href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACUserCSS">OPACUserCSS</a> >@@ -531,6 +542,27 @@ > <option value="slip">Slip</option> > [% END %] > [% END %] >+ [% ELSIF category == 'record_display' %] >+ [% SET staff_available_options = ['StaffResultsPage' , 'StaffDetailPage'] %] >+ <optgroup label="Staff interface"> >+ [% FOREACH l IN staff_available_options.sort %] >+ [% IF l == location %] >+ <option value="[% l | html %]" selected="selected">[% l | html %]</option> >+ [% ELSE %] >+ <option value="[% l | html %]">[% l | html %]</option> >+ [% END %] >+ [% END %] >+ </optgroup> >+ [% SET opac_available_options = ['OPACResultsPage' , 'OPACResultsPage'] %] >+ <optgroup label="OPAC"> >+ [% FOREACH l IN opac_available_options.sort %] >+ [% IF l == location %] >+ <option value="[% l | html %]" selected="selected">[% l | html %]</option> >+ [% ELSE %] >+ <option value="[% l | html %]">[% l | html %]</option> >+ [% END %] >+ [% END %] >+ </optgroup> > [% 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"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >index 3aa18b39636..6b359282497 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >@@ -140,6 +140,9 @@ > > <dt><a href="/cgi-bin/koha/tools/additional-contents.pl?category=pages">Pages</a></dt> > <dd>Write custom pages</dd> >+ >+ <dt><a href="/cgi-bin/koha/tools/additional-contents.pl?category=record_display">Record display customizations</a></dt> >+ <dd>Write record display customizations</dd> > [% END %] > > [% IF ( CAN_user_tools_schedule_tasks ) %] >-- >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 39860
:
182054
|
182055
|
182056
|
182057
|
182058
|
182059
|
182230
|
182231
|
182232
|
182233
|
183007
|
183008
|
183009
|
183010
|
183011
|
183035
|
183077
|
183095
|
183774