Bugzilla – Attachment 192906 Details for
Bug 38096
Field 857 is not considered for display on XSLT files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38096: OPAC: Preparation
Bug-38096-OPAC-Preparation.patch (text/plain), 7.95 KB, created by
Marcel de Rooy
on 2026-02-10 15:34:08 UTC
(
hide
)
Description:
Bug 38096: OPAC: Preparation
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2026-02-10 15:34:08 UTC
Size:
7.95 KB
patch
obsolete
>From 6db795daa9889a508544d7deac138118ed4fe1d9 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 4 Oct 2024 15:34:37 +0000 >Subject: [PATCH] Bug 38096: OPAC: Preparation >Content-Type: text/plain; charset=utf-8 > >The OPAC logic for 856 in results page and detail page has diverged. >This commit ensures the 856 in the OPAC detail and search results pages >are consistent, in preparation to become DRY in the following commits. > >With this DRY refactor, the following divergences are now aligned: >- 856 block now calls AddMissingProtocol regardless of value OPACURLOpenInNewWindow (previously was only being called if OPACURLOpenInNewWindow was 0). Now it's in line with what exists in MARC21slim2OPACDetail.xsl >- substring(,1,6)='image/' is also now a consideration when OPACURLOpenInNewWindow is 1. (previously was only being called if OPACURLOpenInNewWindow was 0). This is now in line with that exists in MARC21slim2OPACDetail.xsl > >Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../en/xslt/MARC21slim2OPACResults.xsl | 55 ++----------------- > 1 file changed, 5 insertions(+), 50 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index b4b8c7dc2e..26e9964e29 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1193,8 +1193,8 @@ > <ul class="resource_list"> > <xsl:for-each select="marc:datafield[@tag=856 and marc:subfield[@code='u']]"> > <xsl:variable name="SubqText"><xsl:value-of select="marc:subfield[@code='q']"/></xsl:variable> >- <xsl:if test="$OPACURLOpenInNewWindow='0'"> >- <li><a> >+ <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> >@@ -1213,6 +1213,9 @@ > </xsl:attribute> > </xsl:otherwise> > </xsl:choose> >+ <xsl:if test="$OPACURLOpenInNewWindow='1'"> >+ <xsl:attribute name="target">_blank</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: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> >@@ -1222,51 +1225,6 @@ > <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></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: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 ($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> >@@ -1274,10 +1232,7 @@ > <xsl:text>Click here to access online</xsl:text> > </xsl:otherwise> > </xsl:choose> >- </xsl:when> >- </xsl:choose> > </a></li> >- </xsl:if> > </xsl:for-each> > </ul> > </div> >-- >2.39.5
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 38096
:
172466
|
172467
|
172468
|
172469
|
172470
|
172471
|
172532
|
172533
|
172534
|
172535
|
172536
|
192376
|
192377
|
192378
|
192379
|
192380
|
192381
|
192589
|
192590
|
192591
|
192592
|
192593
|
192594
|
192813
|
192814
|
192815
|
192816
|
192817
|
192818
|
192819
| 192906 |
192907
|
192908
|
192909
|
192910
|
192911
|
192919
|
192920
|
192921
|
192922
|
192966
|
193000