Bugzilla – Attachment 90097 Details for
Bug 21887
856$u link problem in XSLT result lists and detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21887: 856 link problem in XSLT result lists and detail page
Bug-21887-856-link-problem-in-XSLT-result-lists-an.patch (text/plain), 13.96 KB, created by
Chris Cormack
on 2019-05-26 20:42:42 UTC
(
hide
)
Description:
Bug 21887: 856 link problem in XSLT result lists and detail page
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2019-05-26 20:42:42 UTC
Size:
13.96 KB
patch
obsolete
>From e1e63f8447ad5296b6da2a289b7dfd4a847b94d6 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Nazl=C4=B1=20=C3=87etin?= <nazli@devinim.com.tr> >Date: Tue, 27 Nov 2018 14:15:33 +0000 >Subject: [PATCH] Bug 21887: 856 link problem in XSLT result lists and detail > page >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Nazlı Ãetin <nazli@devinim.com.tr> > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 75 ++++++++++++-------- > .../prog/en/xslt/MARC21slim2intranetResults.xsl | 82 +++++++++++++--------- > 2 files changed, 95 insertions(+), 62 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index 2f9f8548bb..a4d97a08b5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -866,40 +866,57 @@ > </span> > </xsl:if> > >- <xsl:if test="marc:datafield[@tag=856]"> >+ <xsl:if test="marc:datafield[@tag=856]"> > <span class="results_summary online_resources"><span class="label">Online resources: </span> > <xsl:for-each select="marc:datafield[@tag=856]"> >- <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> >- <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> >- <xsl:choose> >- <xsl:when test="($Show856uAsImage='Details' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')"> >- <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element><xsl:text></xsl:text> >- </xsl:when> >- <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">y3z</xsl:with-param> >- </xsl:call-template> >- </xsl:when> >- <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])"> >- <xsl:choose> >- <xsl:when test="$URLLinkText!=''"> >- <xsl:value-of select="$URLLinkText"/> >- </xsl:when> >- <xsl:otherwise> >- <xsl:text>Click here to access online</xsl:text> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:when> >- </xsl:choose> >- </a> >- <xsl:choose> >- <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >- <xsl:otherwise> | </xsl:otherwise> >- </xsl:choose> >+ <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> >+ <a> >+ <xsl:attribute name="href"> >+ <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))"> >+ <xsl:choose> >+ <xsl:when test="@ind1=7"> >+ <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text> >+ </xsl:when> >+ <xsl:when test="@ind1=1"> >+ <xsl:text>ftp://</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>http://</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:if> >+ <xsl:value-of select="marc:subfield[@code='u']"/> >+ </xsl:attribute> >+ <xsl:choose> >+ <xsl:when test="($Show856uAsImage='Details' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')"> >+ <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element><xsl:text></xsl:text> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">y3z</xsl:with-param> >+ </xsl:call-template> >+ </xsl:when> >+ <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])"> >+ <xsl:choose> >+ <xsl:when test="$URLLinkText!=''"> >+ <xsl:value-of select="$URLLinkText"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>Click here to access online</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:when> >+ </xsl:choose> >+ </a> >+ <xsl:choose> >+ <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >+ <xsl:otherwise> | </xsl:otherwise> >+ </xsl:choose> > > </xsl:for-each> > </span> >- </xsl:if> >+ </xsl:if> >+ > <xsl:if test="marc:datafield[@tag=505]"> > <div class="results_summary contents"> > <xsl:choose> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >index 1a64983a33..d4c33f1f3d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >@@ -944,40 +944,56 @@ > </span> > </xsl:if> > <xsl:if test="marc:datafield[@tag=856]"> >- <span class="results_summary online_access"> >- <span class="label">Online access: </span> >- <xsl:for-each select="marc:datafield[@tag=856]"> >- <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> >- <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> >- <xsl:choose> >- <xsl:when test="($Show856uAsImage='Results' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')"> >- <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element><xsl:text></xsl:text> >- </xsl:when> >- <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">y3z</xsl:with-param> >- </xsl:call-template> >- </xsl:when> >- <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])"> >- <xsl:choose> >- <xsl:when test="$URLLinkText!=''"> >- <xsl:value-of select="$URLLinkText"/> >- </xsl:when> >- <xsl:otherwise> >- <xsl:text>Click here to access online</xsl:text> >- </xsl:otherwise> >- </xsl:choose> >- </xsl:when> >- </xsl:choose> >- </a> >- <xsl:choose> >- <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >- <xsl:otherwise> | </xsl:otherwise> >- </xsl:choose> >- </xsl:for-each> >- </span> >+ <span class="results_summary online_access"> >+ <span class="label">Online access: </span> >+ <xsl:for-each select="marc:datafield[@tag=856]"> >+ <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> >+ <a> >+ <xsl:attribute name="href"> >+ <xsl:if test="not(contains(marc:subfield[@code='u'],'://'))"> >+ <xsl:choose> >+ <xsl:when test="@ind1=7"> >+ <xsl:value-of select="marc:subfield[@code='2']"/><xsl:text>://</xsl:text> >+ </xsl:when> >+ <xsl:when test="@ind1=1"> >+ <xsl:text>ftp://</xsl:text> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>http://</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> > </xsl:if> >- </xsl:template> >+ <xsl:value-of select="marc:subfield[@code='u']"/> >+ </xsl:attribute> >+ <xsl:choose> >+ <xsl:when test="($Show856uAsImage='Results' or $Show856uAsImage='Both') and (substring($SubqText,1,6)='image/' or $SubqText='img' or $SubqText='bmp' or $SubqText='cod' or $SubqText='gif' or $SubqText='ief' or $SubqText='jpe' or $SubqText='jpeg' or $SubqText='jpg' or $SubqText='jfif' or $SubqText='png' or $SubqText='svg' or $SubqText='tif' or $SubqText='tiff' or $SubqText='ras' or $SubqText='cmx' or $SubqText='ico' or $SubqText='pnm' or $SubqText='pbm' or $SubqText='pgm' or $SubqText='ppm' or $SubqText='rgb' or $SubqText='xbm' or $SubqText='xpm' or $SubqText='xwd')"> >+ <xsl:element name="img"><xsl:attribute name="src"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="marc:subfield[@code='y']"/></xsl:attribute><xsl:attribute name="height">100</xsl:attribute></xsl:element><xsl:text></xsl:text> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">y3z</xsl:with-param> >+ </xsl:call-template> >+ </xsl:when> >+ <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])"> >+ <xsl:choose> >+ <xsl:when test="$URLLinkText!=''"> >+ <xsl:value-of select="$URLLinkText"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>Click here to access online</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:when> >+ </xsl:choose> >+ </a> >+ <xsl:choose> >+ <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >+ <xsl:otherwise> | </xsl:otherwise> >+ </xsl:choose> >+ </xsl:for-each> >+ </span> >+ </xsl:if> >+</xsl:template> > > <xsl:template name="nameABCQ"> > <xsl:call-template name="chopPunctuation"> >-- >2.11.0
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 21887
:
82674
|
82675
|
82676
|
82677
|
90041
|
90042
| 90097 |
90098