Bugzilla – Attachment 182233 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: Allow for the defining of custom MARC fields on the staff interface record display pages
Bug-39860-Allow-for-the-defining-of-custom-MARC-fi.patch (text/plain), 3.08 KB, created by
Lucas Gass (lukeg)
on 2025-05-09 21:42:33 UTC
(
hide
)
Description:
Bug 39860: Allow for the defining of custom MARC fields on the staff interface record display pages
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-05-09 21:42:33 UTC
Size:
3.08 KB
patch
obsolete
>From 2099b4d1b289306a9c8f36f5055155d8d7e73b25 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 7 May 2025 21:39:18 +0000 >Subject: [PATCH] Bug 39860: Allow for the defining of custom MARC fields on > the staff interface record display pages > >To test: >1. APPLY PATCH, updatedatabase, restart_all >2. Search for the new 'ExtraContentForXSLTDisplay' system preference >3. Find or create a record that has some MARC fields that don't show up by default in the record display. ( I tested using a 538$a ) >4. Add the following to the ExtraContentForXSLTDisplay sys pref: > >[% IF record.subfield('538' , 'a') %] > <span class="results_summary test1"> > <span class="label">The 538a: </span> > [% record.subfield('538' , 'a') %] > </span> >[% END %] > >5. Go to the record from step 3, you should see the 538$a labeled as 'The 538a:' with the appropriate data in it. >--- > C4/XSLT.pm | 17 ++++++++++++++++- > .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 1 - > 2 files changed, 16 insertions(+), 2 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 422a02b1ea7..a961583c15b 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -32,6 +32,8 @@ use Koha::RecordProcessor; > use Koha::XSLT::Base; > use Koha::Libraries; > use Koha::Recalls; >+use Koha::TemplateUtils qw( process_tt ); >+use C4::Scrubber; > > my $engine; #XSLT Handler object > >@@ -238,6 +240,16 @@ sub XSLTParse4Display { > $variables->{OpenURLResolverURL} = $biblio->get_openurl; > } > } >+ my $extracontent = ''; >+ >+ # Check if we should add extra content based on system preference >+ if ( C4::Context->preference('ExtraContentForXSLTDisplay') ) { >+ >+ my $scrubber = C4::Scrubber->new('staff'); >+ my $extracontentvalue = C4::Context->preference('ExtraContentForXSLTDisplay'); >+ my $extracontentproccessed = process_tt( $extracontentvalue, { record => $record } ); >+ $extracontent = $scrubber->scrub($extracontentproccessed); >+ } > > # embed variables > my $varxml = "<variables>\n"; >@@ -260,7 +272,10 @@ sub XSLTParse4Display { > #If the xslt should fail, we will return undef (old behavior was > #raw MARC) > #Note that we did set do_not_return_source at object construction >- return $engine->transform( $xmlrecord, $xslfilename ); #file or URL >+ my $transformed_xml = $engine->transform( $xmlrecord, $xslfilename ); >+ >+ my $concatenated_content = $transformed_xml . $extracontent; >+ return $concatenated_content; > } > > =head2 buildKohaItemsNamespace >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index 9167240766c..3d56fe9f560 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -14,7 +14,6 @@ > <xsl:template match="/"> > <xsl:apply-templates/> > </xsl:template> >- > <xsl:template match="marc:record"> > > <!-- Option: Display Alternate Graphic Representation (MARC 880) --> >-- >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