Bugzilla – Attachment 143141 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), 5.65 KB, created by
Andrew Fuerste-Henry
on 2022-11-03 17:13:40 UTC
(
hide
)
Description:
Bug 8948: Display MARC 787 relationship field
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2022-11-03 17:13:40 UTC
Size:
5.65 KB
patch
obsolete
>From 69c4461e205bd3f1d5791ccd56ae4a13d8aeabe7 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: > $tThe ideas behind the chess openings > $aFine, Reuben< > $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 before the link >11 - Add a second 580, confirm it displays as well > - there is no seperator as each should end with a period or other punctuation according to MARC > - there is a dpan with a class surrounding each so styling can be added as desired >12 - Add a second 787 > - confirm seperator present and wrapped in a span with a class > - confirm each 787 is shown with a span/class for styling > >Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> >--- > .../en/xslt/MARC21slim2intranetDetail.xsl | 63 +++++++++++++++++++ > 1 file changed, 63 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..c3dff33006 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -1435,6 +1435,69 @@ > </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:for-each select="marc:datafield[@tag=580]"> >+ <span class="linking_complexity_note"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a</xsl:with-param> >+ </xsl:call-template> >+ <xsl:text> </xsl:text> >+ </span> >+ </xsl:for-each> >+ <xsl:for-each select="marc:datafield[@tag=787]"> >+ <span class="other_relationship_entry"> >+ <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> >+ <xsl:choose> >+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >+ <a><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:value-of select="$f787"/> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:variable name="relation_query"> >+ <xsl:text>ti,phr:(</xsl:text> >+ <xsl:call-template name="quote_search_term"> >+ <xsl:with-param name="term"><xsl:value-of select="marc:subfield[@code='t']"/></xsl:with-param> >+ </xsl:call-template> >+ <xsl:text>)</xsl:text> >+ <xsl:if test="marc:subfield[@code='a']"> >+ <xsl:text> AND au:(</xsl:text> >+ <xsl:call-template name="quote_search_term"> >+ <xsl:with-param name="term"> >+ <xsl:value-of select="marc:subfield[@code='a']"/> >+ </xsl:with-param> >+ </xsl:call-template> >+ <xsl:text>)</xsl:text> >+ </xsl:if> >+ </xsl:variable> >+ <a> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:value-of select="str:encode-uri($relation_query, true())" /> >+ </xsl:attribute> >+ <xsl:value-of select="$f787"/> >+ </a> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:choose> >+ <xsl:when test="position()=last()"></xsl:when> >+ <xsl:otherwise><span class="separator"><xsl:text>; </xsl:text></span></xsl:otherwise> >+ </xsl:choose> >+ </span> >+ </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