Bugzilla – Attachment 142782 Details for
Bug 8948
MARC21 field 787 doesn't display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8948: Display MARC 787 relationship field
Bug-8948-Display-MARC-787-relationship-field.patch (text/plain), 4.44 KB, created by
Nick Clemens (kidclamp)
on 2022-10-28 16:46:04 UTC
(
hide
)
Description:
Bug 8948: Display MARC 787 relationship field
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-10-28 16:46:04 UTC
Size:
4.44 KB
patch
obsolete
>From c505cd9394d87dde8837529d9af2c08937c43203 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 28 Oct 2022 16:38:22 +0000 >Subject: [PATCH] Bug 8948: Display MARC 787 relationship field > >This field is defined similar to 775, as a related work: >https://www.loc.gov/marc/bibliographic/bd787.html > >This patch adds a display of this field, linking to the referenced record as the 775 does > >It also tests for 580 field, and displays the text there if present, using the 787 a and t subfields otherwise > >To test: >1 - Edit the default framework to make 787atw and 580a visible in editor >2 - Add a 787 to a record: > $aThe ideas behind the chess openings > $w2470231 >3 - Confirm there is no display >4 - Apply patch / restart all >5 - 'Other related works' now shows >6 - Link should be using title of record >7 - Set system preference UseControlNumber to Use >8 - Reload details, link should now use control number >9 - Add a 580 to the record: > $a This is a friendly work to this one >10 - Confirm the text of the link now displays the text etnered above >--- > .../en/xslt/MARC21slim2intranetDetail.xsl | 53 +++++++++++++++++++ > 1 file changed, 53 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index acaf38a650..868b34e4c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -1435,6 +1435,59 @@ > </xsl:for-each> > </xsl:if> > >+ <!-- 787 Other Relationship Entry --> >+ <xsl:if test="marc:datafield[@tag=787]"> >+ <span class="results_summary other_relationship_entry"><span class="label">Other related works: </span> >+ <xsl:variable name="f580"> >+ <xsl:text></xsl:text> >+ <xsl:if test="marc:datafield[@tag=580]"> >+ <xsl:for-each select="marc:datafield[@tag=580]"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a_t</xsl:with-param> >+ </xsl:call-template> >+ </xsl:for-each> >+ </xsl:if> >+ </xsl:variable> >+ <xsl:for-each select="marc:datafield[@tag=787]"> >+ <xsl:variable name="f787"> >+ <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a_t</xsl:with-param> >+ </xsl:call-template></xsl:with-param></xsl:call-template> >+ </xsl:variable> >+ <xsl:if test="marc:subfield[@code='i']"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">i</xsl:with-param> >+ </xsl:call-template> >+ <xsl:text>: </xsl:text> >+ </xsl:if> >+ <a> >+ <xsl:choose> >+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f787, '()', ''), true())"/></xsl:attribute> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:choose> >+ <xsl:when test="$f580 != ''"> >+ <xsl:value-of select="$f580"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a_t</xsl:with-param> >+ </xsl:call-template> >+ </xsl:otherwise> >+ </xsl:choose> >+ </a> >+ <xsl:choose> >+ <xsl:when test="position()=last()"></xsl:when> >+ <xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise> >+ </xsl:choose> >+ </xsl:for-each> >+ </span> >+ </xsl:if> >+ > <!-- Indicate if record is suppressed in OPAC --> > <xsl:choose> > <xsl:when test="$OpacSuppression = 1 and marc:datafield[@tag=942][marc:subfield[@code='n'] = '1']"> >-- >2.30.2
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 8948
:
20653
|
26946
|
142781
|
142782
|
142791
|
143083
|
143084
|
143111
|
143141
|
143142
|
143143
|
143562
|
143563
|
143564
|
143642
|
143684
|
143685
|
143686
|
143687