Bugzilla – Attachment 34464 Details for
Bug 13381
RDA: 245 field changes in XSLT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13381 [ENH] 245 field enhancements
0001-Bug-13381-ENH-XSLT-enhancements-sponsored-by-bywater.patch (text/plain), 11.79 KB, created by
Winona Salesky
on 2014-12-16 15:57:05 UTC
(
hide
)
Description:
Bug 13381 [ENH] 245 field enhancements
Filename:
MIME Type:
Creator:
Winona Salesky
Created:
2014-12-16 15:57:05 UTC
Size:
11.79 KB
patch
obsolete
>From 9187e103b953e5539604303605a2385337b73096 Mon Sep 17 00:00:00 2001 >From: Winona Salesky <wsalesky@gmail.com> >Date: Tue, 16 Dec 2014 10:47:29 -0500 >Subject: [PATCH] Bug 13381 [ENH] XSLT enhancements sponsored by bywater > solutions > >Moved subfield h new line. Added subfield c to 245 display, corrected punctuation in subfield displays. >--- > .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 61 ++++++++++++++----- > .../bootstrap/en/xslt/MARC21slim2OPACDetail.xsl | 69 ++++++++++++++++------ > 2 files changed, 95 insertions(+), 35 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index f96c0eb..406081c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -1,8 +1,7 @@ > <?xml version="1.0" encoding="UTF-8"?> >- > <!DOCTYPE stylesheet [<!ENTITY nbsp " " >]> >- > <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ --> >+<!-- Edited: Bug 13381 [ENH] XSLT enhancements sponsored by bywater solutions 2014/12/15 WS wsalesky@gmail.com --> > <xsl:stylesheet version="1.0" > xmlns:marc="http://www.loc.gov/MARC21/slim" > xmlns:items="http://www.koha-community.org/items" >@@ -106,12 +105,7 @@ > <xsl:call-template name="subfieldSelect"> > <xsl:with-param name="codes">a</xsl:with-param> > </xsl:call-template> >- <xsl:if test="marc:subfield[@code='h']"> >- <xsl:text> </xsl:text> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">h</xsl:with-param> >- </xsl:call-template> >- </xsl:if> >+ <!--Bug 13381 Suppress subfield h from 245--> > <xsl:if test="marc:subfield[@code='b']"> > <xsl:text> </xsl:text> > <xsl:call-template name="subfieldSelect"> >@@ -119,9 +113,31 @@ > </xsl:call-template> > </xsl:if> > <xsl:text> </xsl:text> >+ <!--Bug 13381 add additional subfields--> > <xsl:call-template name="subfieldSelect"> > <xsl:with-param name="codes">fgknps</xsl:with-param> > </xsl:call-template> >+ <!--Bug 13381 If subfield h and subfield c add appropriate punctation--> >+ <xsl:choose> >+ <xsl:when test="marc:subfield[@code='h'] and marc:subfield[@code='c']"> >+ <xsl:variable name="length" select="string-length(marc:subfield[@code='h'])"/> >+ <xsl:if test="contains('/', substring(marc:subfield[@code='h'],$length,1))"> >+ <xsl:text> / </xsl:text> >+ </xsl:if> >+ </xsl:when> >+ <!--if perviouse subfield end ends with puncutation add space --> >+ <xsl:when test="marc:subfield[@code='c']/preceding-sibling::*"> >+ <xsl:variable name="length" select="string-length(marc:subfield[@code='c']/preceding-sibling::*[l])"/> >+ <xsl:if test="contains('.:,;/', substring(marc:subfield[@code='c']/preceding-sibling::*[1],$length,1))"> >+ <xsl:text> </xsl:text> >+ </xsl:if> >+ </xsl:when> >+ </xsl:choose> >+ <!--Bug 13381 Added Statement of responsibility subfield display. Added at end of title --> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">c</xsl:with-param> >+ </xsl:call-template> >+ > </xsl:for-each> > </h1> > </xsl:if> >@@ -143,14 +159,27 @@ > <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template> > <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=700 or @tag=710 or @tag=711]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template> > >- <xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''"> >- <span class="results_summary type"><span class="label">Material type: </span> >- <xsl:element name="img"><xsl:attribute name="src">/intranet-tmpl/prog/img/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element> >- <xsl:text> </xsl:text> >- <xsl:value-of select="$materialTypeLabel"/> >- </span> >- </xsl:if> >- >+ <xsl:if test="$DisplayIconsXSLT!='0' and $materialTypeCode!=''"> >+ <span class="results_summary type"><span class="label">Material type: </span> >+ <xsl:element name="img"><xsl:attribute name="src">/intranet-tmpl/prog/img/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="$materialTypeLabel"/> >+ </span> >+ </xsl:if> >+ >+ <!--Bug 13381 Resource Medium from 245 strips [] and / from string--> >+ <xsl:if test="marc:datafield[@tag=245][marc:subfield[@code='h']]"> >+ <span class="results_summary type"><span class="label">Medium: </span> >+ <xsl:variable name="str"> >+ <xsl:for-each select="marc:datafield[@tag=245]"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">h</xsl:with-param> >+ </xsl:call-template> >+ </xsl:for-each> >+ </xsl:variable> >+ <xsl:value-of select="translate($str,'[]/',' ')"/> >+ </span> >+ </xsl:if> > > <!--Series: Alternate Graphic Representation (MARC 880) --> > <xsl:if test="$display880"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index af9ac00..df2d662 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -1,5 +1,6 @@ > <?xml version="1.0" encoding="UTF-8"?> > <!-- $Id: MARC21slim2DC.xsl,v 1.1 2003/01/06 08:20:27 adam Exp $ --> >+<!-- Edited: Bug 13381 [ENH] XSLT enhancements sponsored by bywater solutions 2014/12/15 WS wsalesky@gmail.com --> > <!DOCTYPE stylesheet [<!ENTITY nbsp " " >]> > <xsl:stylesheet version="1.0" > xmlns:marc="http://www.loc.gov/MARC21/slim" >@@ -127,22 +128,38 @@ > <xsl:call-template name="subfieldSelect"> > <xsl:with-param name="codes">a</xsl:with-param> > </xsl:call-template> >- <xsl:if test="marc:subfield[@code='h']"> >- <xsl:text> </xsl:text> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">h</xsl:with-param> >- </xsl:call-template> >- </xsl:if> >+ <!--Bug 13381 Suppress subfield h from 245--> > <xsl:if test="marc:subfield[@code='b']"> > <xsl:text> </xsl:text> > <xsl:call-template name="subfieldSelect"> > <xsl:with-param name="codes">b</xsl:with-param> > </xsl:call-template> > </xsl:if> >- <xsl:text> </xsl:text> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">fgknps</xsl:with-param> >- </xsl:call-template> >+ <xsl:text> </xsl:text> >+ <!--Bug 13381 add additional subfields--> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">fgknps</xsl:with-param> >+ </xsl:call-template> >+ <!--Bug 13381 If subfield h and subfield c add appropriate punctation--> >+ <xsl:choose> >+ <xsl:when test="marc:subfield[@code='h'] and marc:subfield[@code='c']"> >+ <xsl:variable name="length" select="string-length(marc:subfield[@code='h'])"/> >+ <xsl:if test="contains('/', substring(marc:subfield[@code='h'],$length,1))"> >+ <xsl:text> / </xsl:text> >+ </xsl:if> >+ </xsl:when> >+ <!--if perviouse subfield end ends with puncutation add space --> >+ <xsl:when test="marc:subfield[@code='c']/preceding-sibling::*"> >+ <xsl:variable name="length" select="string-length(marc:subfield[@code='c']/preceding-sibling::*[l])"/> >+ <xsl:if test="contains('.:,;/', substring(marc:subfield[@code='c']/preceding-sibling::*[1],$length,1))"> >+ <xsl:text> </xsl:text> >+ </xsl:if> >+ </xsl:when> >+ </xsl:choose> >+ <!--Bug 13381 Added Statement of responsibility subfield display. Added at end of title --> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">c</xsl:with-param> >+ </xsl:call-template> > </xsl:for-each> > </h1> > </xsl:if> >@@ -170,16 +187,30 @@ > </h5> > </xsl:when> > </xsl:choose> >- >- <xsl:if test="$DisplayOPACiconsXSLT!='0'"> >- <xsl:if test="$materialTypeCode!=''"> >- <span class="results_summary type"><span class="label">Material type: </span> >- <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/lib/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt">materialTypeLabel</xsl:attribute><xsl:attribute name="class">materialtype</xsl:attribute></xsl:element> >- <xsl:value-of select="$materialTypeLabel"/> >- </span> >+ >+ <xsl:if test="$DisplayOPACiconsXSLT!='0'"> >+ <xsl:if test="$materialTypeCode!=''"> >+ <span class="results_summary type"><span class="label">Material type: </span> >+ <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/lib/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt">materialTypeLabel</xsl:attribute><xsl:attribute name="class">materialtype</xsl:attribute></xsl:element> >+ <xsl:value-of select="$materialTypeLabel"/> >+ </span> >+ </xsl:if> > </xsl:if> >- </xsl:if> >- >+ >+ <!--Bug 13381 Resource Medium from 245 strips [] and / from string--> >+ <xsl:if test="marc:datafield[@tag=245][marc:subfield[@code='h']]"> >+ <span class="results_summary type"><span class="label">Medium: </span> >+ <xsl:variable name="str"> >+ <xsl:for-each select="marc:datafield[@tag=245]"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">h</xsl:with-param> >+ </xsl:call-template> >+ </xsl:for-each> >+ </xsl:variable> >+ <xsl:value-of select="translate($str,'[]/',' ')"/> >+ </span> >+ </xsl:if> >+ > <!--Series: Alternate Graphic Representation (MARC 880) --> > <xsl:if test="$display880"> > <xsl:call-template name="m880Select"> >-- >1.7.12.4 (Apple Git-37) >
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 13381
:
34464
|
34996
|
34997
|
36783
|
37067
|
37068
|
37069
|
37070
|
37228
|
37982