Bugzilla – Attachment 164429 Details for
Bug 36111
Online resource link should be based on the presence of 856$u (MARC21)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36111: 856$h should not appear as a link in detailed record
Bug-36111-856h-should-not-appear-as-a-link-in-deta.patch (text/plain), 39.98 KB, created by
Matthias Le Gac
on 2024-04-04 15:25:48 UTC
(
hide
)
Description:
Bug 36111: 856$h should not appear as a link in detailed record
Filename:
MIME Type:
Creator:
Matthias Le Gac
Created:
2024-04-04 15:25:48 UTC
Size:
39.98 KB
patch
obsolete
>From 8972cd7d7c6670365b7d5e73d4bfc20dc473de23 Mon Sep 17 00:00:00 2001 >From: Matthias Le Gac <matthias.le-gac@inlibro.com> >Date: Tue, 20 Feb 2024 16:52:50 -0500 >Subject: [PATCH] Bug 36111: 856$h should not appear as a link in detailed > record > >Test plan: >1. Add 856$h to MARC editor > 1.1. Go to Administration > MARC bibliographic frameworks > 1.2. Next to Default framework, click Actions > MARC structure > 1.3. Search for field 856 > 1.4. Click Actions > Edit subfields > 1.5. Click h > 1.6. Check the Editor box > 1.7. Click Save changes >2. Catalog a new record with a random URL in 856$h > 2.1. Go to Cataloging > 2.2. Click New record > 2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c, > 245$a, 942$c) > 2.4. Go to tab 8 and enter a value in 856$h > 2.5. Click Save (No need to add an item) >3. Search for the title in the staff interface (a large enough > search to have more than one result) > --> Notice it says "Online resources: Click here to access online" > 3.1. Try to click the link > --> Blank page >4. Access the detailed record in the staff interface > --> Notice it says "Online resources: Click here to access online" > 4.1. Try to click the link > --> Blank page >5. Search for the title in the opac (a large enough search to have > more than one result) > --> Notice it says "Online resources: Click here to access online" > 5.1. Try to click the link > --> Blank page >6. Access the detailed record in the opac > --> Notice it says "Online resources: Click here to access online" > 6.1. Try to click the link > --> Blank page >7. Edit the item and add a text in field 856$y >8. Access the detailed record in the staff interface > --> Notice it says what you put in 856$y field >9. Apply the patch >10. Replay steps 3 through 6, but this time, the "Online resources" > field should not be present. >11. Replay steps 7 through 8, but this time, what you put in 856$y > field should not be present. >12. Edit the item and add a url in field 856$u >13. Replay steps 3 through 6, but this time, clicking on the link > should take you to the URL specified in the 856$u field. >14. Replay steps 7 through 8, but this time, what you put in 856$y > field should be present and > clicking on the link should take you to the URL specified in the 856$u field. > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../en/xslt/MARC21slim2intranetDetail.xsl | 84 ++++---- > .../en/xslt/MARC21slim2intranetResults.xsl | 25 ++- > .../en/xslt/MARC21slim2OPACDetail.xsl | 96 ++++++---- > .../en/xslt/MARC21slim2OPACResults.xsl | 179 ++++++++++-------- > 4 files changed, 216 insertions(+), 168 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index 48439f3a24..f90a9c37a6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -921,46 +921,56 @@ > </xsl:if> > > <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:call-template name="AddMissingProtocol"> >- <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/> >- <xsl:with-param name="indicator1" select="@ind1"/> >- <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/> >- </xsl:call-template> >- <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:variable name="hasCodeU" select="marc:datafield[@tag=856]/marc:subfield[@code='u']"/> >+ <xsl:variable name="hasCodeY" select="marc:datafield[@tag=856]/marc:subfield[@code='y']"/> >+ <xsl:variable name="hasCode3" select="marc:datafield[@tag=856]/marc:subfield[@code='3']"/> >+ <xsl:variable name="hasCodeZ" select="marc:datafield[@tag=856]/marc:subfield[@code='z']"/> >+ >+ <xsl:if test="$hasCodeU or $hasCodeY or $hasCode3 or $hasCodeZ"> >+ <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:call-template name="AddMissingProtocol"> >+ <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/> >+ <xsl:with-param name="indicator1" select="@ind1"/> >+ <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/> >+ </xsl:call-template> >+ <xsl:value-of select="marc:subfield[@code='u']"/> >+ </xsl:attribute> >+ <xsl:if test="not(marc:subfield[@code='u'])"> >+ <xsl:attribute name="style">pointer-events: none; color: #202020;</xsl:attribute> >+ </xsl:if> > <xsl:choose> >- <xsl:when test="$URLLinkText!=''"> >- <xsl:value-of select="$URLLinkText"/> >+ <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:when test="marc:subfield[@code='u']"> >+ <xsl:text>Click here to access online</xsl:text> >+ </xsl:when> >+ </xsl:choose> > </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> >+ </a> >+ <xsl:choose> >+ <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >+ <xsl:when test="marc:subfield[@code='y'] or marc:subfield[@code='3'] or marc:subfield[@code='z'] or marc:subfield[@code='u']"><xsl:text> | </xsl:text></xsl:when> >+ </xsl:choose> >+ </xsl:for-each> >+ </span> >+ </xsl:if> > </xsl:if> > > <!-- 505 - Formatted contents note --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >index 16a423e421..3869b0e9c2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >@@ -978,8 +978,13 @@ > </xsl:call-template> > > <xsl:if test="marc:datafield[@tag=856]"> >- <span class="results_summary online_resources"> >- <span class="label">Online resources: </span> >+ <xsl:variable name="hasCodeU" select="marc:datafield[@tag=856]/marc:subfield[@code='u']"/> >+ <xsl:variable name="hasCodeY" select="marc:datafield[@tag=856]/marc:subfield[@code='y']"/> >+ <xsl:variable name="hasCode3" select="marc:datafield[@tag=856]/marc:subfield[@code='3']"/> >+ <xsl:variable name="hasCodeZ" select="marc:datafield[@tag=856]/marc:subfield[@code='z']"/> >+ >+ <xsl:if test="$hasCodeU or $hasCodeY or $hasCode3 or $hasCodeZ"> >+ <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> >@@ -991,8 +996,11 @@ > </xsl:call-template> > <xsl:value-of select="marc:subfield[@code='u']"/> > </xsl:attribute> >+ <xsl:if test="not(marc:subfield[@code='u'])"> >+ <xsl:attribute name="style">pointer-events: none; color: #202020;</xsl:attribute> >+ </xsl:if> > <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: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']"> >@@ -1005,19 +1013,20 @@ > <xsl:when test="$URLLinkText!=''"> > <xsl:value-of select="$URLLinkText"/> > </xsl:when> >- <xsl:otherwise> >+ <xsl:when test="marc:subfield[@code='u']"> > <xsl:text>Click here to access online</xsl:text> >- </xsl:otherwise> >+ </xsl:when> > </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:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >+ <xsl:when test="marc:subfield[@code='y'] or marc:subfield[@code='3'] or marc:subfield[@code='z'] or marc:subfield[@code='u']"><xsl:text> | </xsl:text></xsl:when> > </xsl:choose> > </xsl:for-each> >- </span> >+ </span> >+ </xsl:if> > </xsl:if> > > <!-- Content Warning --> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index 3fe783b615..c29f883572 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -1038,56 +1038,70 @@ > > <!-- Image processing code added here, takes precedence over text links including y3z text --> > <xsl:if test="marc:datafield[@tag=856]"> >- <span class="results_summary online_resources"> >- <span class="label">Online resources: </span> >- <ul class="resource_list"> >- <xsl:for-each select="marc:datafield[@tag=856]"> >- <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> >- <li> >- <a property="url"> >- <xsl:choose> >- <xsl:when test="$OPACTrackClicks='track'"> >- <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >- </xsl:when> >- <xsl:when test="$OPACTrackClicks='anonymous'"> >- <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >- </xsl:when> >- <xsl:otherwise> >- <xsl:attribute name="href"> >- <xsl:call-template name="AddMissingProtocol"> >- <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/> >- <xsl:with-param name="indicator1" select="@ind1"/> >- <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/> >- </xsl:call-template> >- <xsl:value-of select="marc:subfield[@code='u']"/> >- </xsl:attribute> >- </xsl:otherwise> >- </xsl:choose> >- <xsl:if test="$OPACURLOpenInNewWindow='1'"> >- <xsl:attribute name="target">_blank</xsl:attribute> >+ <xsl:variable name="hasCodeU" select="marc:datafield[@tag=856]/marc:subfield[@code='u']"/> >+ <xsl:variable name="hasCodeY" select="marc:datafield[@tag=856]/marc:subfield[@code='y']"/> >+ <xsl:variable name="hasCode3" select="marc:datafield[@tag=856]/marc:subfield[@code='3']"/> >+ <xsl:variable name="hasCodeZ" select="marc:datafield[@tag=856]/marc:subfield[@code='z']"/> >+ >+ <xsl:if test="$hasCodeU or $hasCodeY or $hasCode3 or $hasCodeZ"> >+ <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 property="url"> >+ <xsl:choose> >+ <xsl:when test="$OPACTrackClicks='track'"> >+ <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >+ </xsl:when> >+ <xsl:when test="$OPACTrackClicks='anonymous'"> >+ <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:attribute name="href"> >+ <xsl:call-template name="AddMissingProtocol"> >+ <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/> >+ <xsl:with-param name="indicator1" select="@ind1"/> >+ <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/> >+ </xsl:call-template> >+ <xsl:value-of select="marc:subfield[@code='u']"/> >+ </xsl:attribute> >+ <xsl:if test="not(marc:subfield[@code='u'])"> >+ <xsl:attribute name="style">pointer-events: none; color: #202020;</xsl:attribute> > </xsl:if> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:if test="$OPACURLOpenInNewWindow='1'"> >+ <xsl:attribute name="target">_blank</xsl:attribute> >+ </xsl:if> >+ <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="style">height:100px</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="($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="style">height:100px</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="$URLLinkText!=''"> > <xsl:value-of select="$URLLinkText"/> > </xsl:when> >- <xsl:otherwise> >+ <xsl:when test="marc:subfield[@code='u']"> > <xsl:text>Click here to access online</xsl:text> >- </xsl:otherwise> >+ </xsl:when> > </xsl:choose> >- </a> >- </li> >- </xsl:for-each> >- </ul> >+ </xsl:when> >+ </xsl:choose> >+ </a> >+ <xsl:choose> >+ <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >+ <xsl:when test="marc:subfield[@code='y'] or marc:subfield[@code='3'] or marc:subfield[@code='z'] or marc:subfield[@code='u']"><xsl:text> | </xsl:text></xsl:when> >+ </xsl:choose> >+ </xsl:for-each> > </span> > </xsl:if> >+ </xsl:if> > > <!-- 787 Other Relationship Entry --> > <xsl:if test="marc:datafield[@tag=787]"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index c2ebe9c7d9..532825938c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1216,92 +1216,107 @@ > </xsl:if> > > <xsl:if test="marc:datafield[@tag=856]"> >- <div class="results_summary online_resources"> >- <span class="label">Online resources: </span> >- <ul class="resource_list"> >- <xsl:for-each select="marc:datafield[@tag=856]"> >- <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> >- <xsl:if test="$OPACURLOpenInNewWindow='0'"> >- <li><a> >- <xsl:choose> >- <xsl:when test="$OPACTrackClicks='track'"> >- <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >- </xsl:when> >- <xsl:when test="$OPACTrackClicks='anonymous'"> >- <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >- </xsl:when> >- <xsl:otherwise> >- <xsl:attribute name="href"> >- <xsl:call-template name="AddMissingProtocol"> >- <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/> >- <xsl:with-param name="indicator1" select="@ind1"/> >- <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/> >- </xsl:call-template> >- <xsl:value-of select="marc:subfield[@code='u']"/> >- </xsl:attribute> >- </xsl:otherwise> >- </xsl:choose> >- <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="style">height:100px;</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:variable name="hasCodeU" select="marc:datafield[@tag=856]/marc:subfield[@code='u']"/> >+ <xsl:variable name="hasCodeY" select="marc:datafield[@tag=856]/marc:subfield[@code='y']"/> >+ <xsl:variable name="hasCode3" select="marc:datafield[@tag=856]/marc:subfield[@code='3']"/> >+ <xsl:variable name="hasCodeZ" select="marc:datafield[@tag=856]/marc:subfield[@code='z']"/> >+ >+ <xsl:if test="$hasCodeU or $hasCodeY or $hasCode3 or $hasCodeZ"> >+ <div 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> >+ <xsl:if test="$OPACURLOpenInNewWindow='0'"> >+ <a> >+ <xsl:choose> >+ <xsl:when test="$OPACTrackClicks='track'"> >+ <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >+ </xsl:when> >+ <xsl:when test="$OPACTrackClicks='anonymous'"> >+ <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:attribute name="href"> >+ <xsl:call-template name="AddMissingProtocol"> >+ <xsl:with-param name="resourceLocation" select="marc:subfield[@code='u']"/> >+ <xsl:with-param name="indicator1" select="@ind1"/> >+ <xsl:with-param name="accessMethod" select="marc:subfield[@code='2']"/> > </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:value-of select="marc:subfield[@code='u']"/> >+ </xsl:attribute> >+ <xsl:if test="not(marc:subfield[@code='u'])"> >+ <xsl:attribute name="style">pointer-events: none; color: #202020;</xsl:attribute> >+ </xsl:if> >+ </xsl:otherwise> >+ </xsl:choose> >+ <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="style">height:100px;</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:when test="marc:subfield[@code='u']"> >+ <xsl:text>Click here to access online</xsl:text> >+ </xsl:when> > </xsl:choose> >- </a></li> >- </xsl:if> >- <xsl:if test="$OPACURLOpenInNewWindow='1'"> >- <li><a target='_blank'> >- <xsl:choose> >- <xsl:when test="$OPACTrackClicks='track'"> >- <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >- </xsl:when> >- <xsl:when test="$OPACTrackClicks='anonymous'"> >- <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >- </xsl:when> >- <xsl:otherwise> >- <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> >- </xsl:otherwise> >- </xsl:choose> >+ </xsl:when> >+ </xsl:choose> >+ </a> >+ </xsl:if> >+ <xsl:if test="$OPACURLOpenInNewWindow='1'"> >+ <a target='_blank'> >+ <xsl:choose> >+ <xsl:when test="$OPACTrackClicks='track'"> >+ <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >+ </xsl:when> >+ <xsl:when test="$OPACTrackClicks='anonymous'"> >+ <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="str:encode-uri(marc:subfield[@code='u'], true())"/>&biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> >+ <xsl:if test="not(marc:subfield[@code='u'])"> >+ <xsl:attribute name="style">pointer-events: none; color: #202020;</xsl:attribute> >+ </xsl:if> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:choose> >+ <xsl:when test="($Show856uAsImage='Results' or $Show856uAsImage='Both') and ($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="style">height:100px</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="($Show856uAsImage='Results' or $Show856uAsImage='Both') and ($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="style">height:100px</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:when test="$URLLinkText!=''"> >+ <xsl:value-of select="$URLLinkText"/> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code='u']"> >+ <xsl:text>Click here to access online</xsl:text> >+ </xsl:when> > </xsl:choose> >- </a></li> >- </xsl:if> >- </xsl:for-each> >- </ul> >- </div> >- </xsl:if> >+ </xsl:when> >+ </xsl:choose> >+ </a> >+ </xsl:if> >+ <xsl:choose> >+ <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >+ <xsl:when test="marc:subfield[@code='y'] or marc:subfield[@code='3'] or marc:subfield[@code='z'] or marc:subfield[@code='u']"><xsl:text> | </xsl:text></xsl:when> >+ </xsl:choose> >+ </xsl:for-each> >+ </div> >+ </xsl:if> >+ </xsl:if> > > <!-- Availability line --> > <div class="results_summary availability"> >-- >2.34.1
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 36111
:
162322
|
162405
|
162406
|
163876
|
164029
|
164151
|
164275
|
164276
|
164429
|
164430
|
164476
|
165236
|
165335
|
165346
|
165347
|
165355
|
165356
|
165688
|
165709
|
165710
|
165711
|
170437
|
170471
|
170474
|
170576