Bugzilla – Attachment 142588 Details for
Bug 13600
XSLT: 8xx not showing if there is no 4xx
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13600: XSLT - 8xx not showing if there is no 4xx
Bug-13600-XSLT---8xx-not-showing-if-there-is-no-4x.patch (text/plain), 25.28 KB, created by
David Nind
on 2022-10-25 00:15:24 UTC
(
hide
)
Description:
Bug 13600: XSLT - 8xx not showing if there is no 4xx
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-10-25 00:15:24 UTC
Size:
25.28 KB
patch
obsolete
>From 31292f5f153b5c6d5afe90a7868e8c498b568353 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 16 Sep 2022 11:38:15 +0000 >Subject: [PATCH] Bug 13600: XSLT - 8xx not showing if there is no 4xx > >This patch adjusts XSLT so that series tag displays if any 440,490,800,810,830 is present > >It also adjusts 8xx to display even if 490 ind 1 = 1 is not present > >To test: >1 - Check records with multiple series tag >2 - Confirm display is correct > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../prog/en/xslt/MARC21slimUtils.xsl | 172 +++++++++--------- > .../bootstrap/en/xslt/MARC21slimUtils.xsl | 172 +++++++++--------- > 2 files changed, 170 insertions(+), 174 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index fc29e9203b..317a3a3c1a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -408,7 +408,7 @@ > <xsl:param name="UseControlNumber"/> > <xsl:param name="UseAuthoritiesForTracings"/> > <!-- Series --> >- <xsl:if test="marc:datafield[@tag=440 or @tag=490]"> >+ <xsl:if test="marc:datafield[@tag=440 or @tag=490 or @tag=800 or @tag=801 or @tag=811 or @tag=830]"> > <span class="results_summary series"><span class="label">Series: </span> > <!-- 440 --> > <xsl:for-each select="marc:datafield[@tag=440 and @ind1!='z']"> >@@ -459,93 +459,91 @@ > <xsl:otherwise><span class="separator"> | </span></xsl:otherwise> > </xsl:choose> > </xsl:for-each> >- <!-- 490 Series traced, Ind1 = 1 --> >- <xsl:if test="marc:datafield[@tag=490][@ind1=1]"> >- <xsl:for-each select="marc:datafield[(@tag=800 or @tag=810 or @tag=811) and @ind1!='z']"> >- <xsl:choose> >- <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=rcn:<xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/></xsl:attribute> >- <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> >- </a> >- </xsl:when> >- <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >- <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> >- </a> >- </xsl:when> >- <xsl:otherwise> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='t'], true())"/>"&q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >- <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> >- </a> >- </xsl:otherwise> >- </xsl:choose> >- <xsl:call-template name="part"/> >- <xsl:text> ; </xsl:text> >- <xsl:value-of select="marc:subfield[@code='v']" /> >- <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose> >- </xsl:for-each> >+ <!-- 800,810,811,830 always display. --> >+ <xsl:for-each select="marc:datafield[(@tag=800 or @tag=810 or @tag=811) and @ind1!='z']"> >+ <xsl:choose> >+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=rcn:<xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/></xsl:attribute> >+ <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> >+ </a> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >+ <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> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='t'], true())"/>"&q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <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> >+ </a> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:call-template name="part"/> >+ <xsl:text> ; </xsl:text> >+ <xsl:value-of select="marc:subfield[@code='v']" /> >+ <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose> >+ </xsl:for-each> > >- <xsl:for-each select="marc:datafield[@tag=830 and @ind1!='z']"> >- <xsl:choose> >- <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >- <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}"> >- <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> >- </a> >- </xsl:when> >- <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >- <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> >- </a> >- </xsl:when> >- <xsl:otherwise> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >- <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> >- </a> >- </xsl:otherwise> >- </xsl:choose> >- <xsl:call-template name="part"/> >- <xsl:if test="marc:subfield[@code='v']"> >- <xsl:text> ; </xsl:text><xsl:value-of select="marc:subfield[@code='v']" /> >- </xsl:if> >- <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose> >- </xsl:for-each> >- </xsl:if> >+ <xsl:for-each select="marc:datafield[@tag=830 and @ind1!='z']"> >+ <xsl:choose> >+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >+ <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}"> >+ <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> >+ </a> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >+ <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> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <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> >+ </a> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:call-template name="part"/> >+ <xsl:if test="marc:subfield[@code='v']"> >+ <xsl:text> ; </xsl:text><xsl:value-of select="marc:subfield[@code='v']" /> >+ </xsl:if> >+ <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose> >+ </xsl:for-each> > > </span> > </xsl:if> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >index 98618cefce..52c53a4de0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >@@ -372,7 +372,7 @@ > <xsl:param name="UseControlNumber"/> > <xsl:param name="UseAuthoritiesForTracings"/> > <!-- Series --> >- <xsl:if test="marc:datafield[@tag=440 or @tag=490]"> >+ <xsl:if test="marc:datafield[@tag=440 or @tag=490 or @tag=800 or @tag=810 or @tag=811 or @tag=830]"> > <span class="results_summary series"><span class="label">Series: </span> > <!-- 440 --> > <xsl:for-each select="marc:datafield[@tag=440 and @ind1!='z']"> >@@ -423,93 +423,91 @@ > <xsl:otherwise><span class="separator"> | </span></xsl:otherwise> > </xsl:choose> > </xsl:for-each> >- <!-- 490 Series traced, Ind1 = 1 --> >- <xsl:if test="marc:datafield[@tag=490][@ind1=1]"> >- <xsl:for-each select="marc:datafield[(@tag=800 or @tag=810 or @tag=811) and @ind1!='z']"> >- <xsl:choose> >- <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=rcn:<xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/></xsl:attribute> >- <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> >- </a> >- </xsl:when> >- <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >- <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> >- </a> >- </xsl:when> >- <xsl:otherwise> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='t'], true())"/>"&q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >- <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> >- </a> >- </xsl:otherwise> >- </xsl:choose> >- <xsl:call-template name="part"/> >- <xsl:text> ; </xsl:text> >- <xsl:value-of select="marc:subfield[@code='v']" /> >- <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose> >- </xsl:for-each> >+ <!-- 800,810,811,830 always display. --> >+ <xsl:for-each select="marc:datafield[(@tag=800 or @tag=810 or @tag=811) and @ind1!='z']"> >+ <xsl:choose> >+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=rcn:<xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/></xsl:attribute> >+ <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> >+ </a> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >+ <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> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='t'], true())"/>"&q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <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> >+ </a> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:call-template name="part"/> >+ <xsl:text> ; </xsl:text> >+ <xsl:value-of select="marc:subfield[@code='v']" /> >+ <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose> >+ </xsl:for-each> > >- <xsl:for-each select="marc:datafield[@tag=830 and @ind1!='z']"> >- <xsl:choose> >- <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >- <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}"> >- <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> >- </a> >- </xsl:when> >- <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >- <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> >- </a> >- </xsl:when> >- <xsl:otherwise> >- <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >- <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> >- </a> >- </xsl:otherwise> >- </xsl:choose> >- <xsl:call-template name="part"/> >- <xsl:if test="marc:subfield[@code='v']"> >- <xsl:text> ; </xsl:text><xsl:value-of select="marc:subfield[@code='v']" /> >- </xsl:if> >- <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose> >- </xsl:for-each> >- </xsl:if> >+ <xsl:for-each select="marc:datafield[@tag=830 and @ind1!='z']"> >+ <xsl:choose> >+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >+ <a href="/cgi-bin/koha/catalogue/search.pl?q=rcn:{marc:subfield[@code='w']}"> >+ <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> >+ </a> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >+ <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> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <a><xsl:attribute name="href"><xsl:value-of select="$searchurl"/>?q=se,phr:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <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> >+ </a> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:call-template name="part"/> >+ <xsl:if test="marc:subfield[@code='v']"> >+ <xsl:text> ; </xsl:text><xsl:value-of select="marc:subfield[@code='v']" /> >+ </xsl:if> >+ <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"> | </span></xsl:otherwise></xsl:choose> >+ </xsl:for-each> > > </span> > </xsl:if> >-- >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 13600
:
40097
|
40106
|
40107
|
40207
|
40636
|
40637
|
140705
|
140706
|
140736
|
142530
|
142588
|
142589
|
143069
|
143566
|
143567
|
143568