Bugzilla – Attachment 172535 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: Staff: Display 857 to detail and results pages
Bug-38096-Staff-Display-857-to-detail-and-results-.patch (text/plain), 16.37 KB, created by
Caroline Cyr La Rose
on 2024-10-08 15:27:56 UTC
(
hide
)
Description:
Bug 38096: Staff: Display 857 to detail and results pages
Filename:
MIME Type:
Creator:
Caroline Cyr La Rose
Created:
2024-10-08 15:27:56 UTC
Size:
16.37 KB
patch
obsolete
>From 22f2cdda2551a75746fffe93a528509577e45c81 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 4 Oct 2024 15:22:25 +0000 >Subject: [PATCH] Bug 38096: Staff: Display 857 to detail and results pages > >This work DRYs the 856 display logic to renderMARCOnlineResourceField. >This was previously written in detail and results pages. > >Once this single function exists, 857 can also make use of it to be >displayed using the same logic/features already present for 856. > >1) If testing k-t-d, add the test data for test plan (skip if sandboxes): >updatedatabase >2) Force reindex of this biblio by saving it, visit the biblio: ><staff_url>/cgi-bin/koha/catalogue/detail.pl?biblionumber=76 >3) Click "Edit" -> "Edit record" -> "Save" >4) Open the following URL's, preferably on 4 different browser tabs (we're using biblio 76 for this test): ><staff_url>/cgi-bin/koha/catalogue/search.pl?q=music (first record [76] is the one we're testing) ><staff_url>/cgi-bin/koha/catalogue/detail.pl?biblionumber=76 ><opac_url>/cgi-bin/koha/opac-search.pl?idx=&q=music (first record [76] is the one we're testing) ><opac_url>/cgi-bin/koha/opac-detail.pl?biblionumber=76 >5) Verify that on all pages there are 3 instances of 856 (Online resources) and 3 instances of 857 (Online archive resources) with their respective link labels and URLs. >6) Click on the "Koha community no protocol" link for 856 and 857, notice the 'http://' protocol is added. >7) Change the values of OPACDisplay856uAsImage + Display856uAsImage and refresh the respective page. Verify it works as expected (respects the system preference). Note: This only applies for 856, not 857 (out of scope here). >8) Change the value of OPACURLOpenInNewWindow and click on the links before and after. Verify they respect the system preference. > >Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> >--- > .../en/xslt/MARC21slim2intranetDetail.xsl | 60 +++++++----------- > .../en/xslt/MARC21slim2intranetResults.xsl | 62 +++++++------------ > .../prog/en/xslt/MARC21slimUtils.xsl | 55 ++++++++++++++++ > .../en/xslt/MARC21slim2OPACResults.xsl | 1 + > 4 files changed, 99 insertions(+), 79 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index 1f255b10f1..0bf50e79ee 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -920,48 +920,30 @@ > </span> > </xsl:if> > >+ <!-- 856 --> > <xsl:if test="marc:datafield[@tag=856]"> > <xsl:if test="marc:datafield[@tag=856]/marc:subfield[@code='u']"> >- <span class="results_summary online_resources"><span class="label">Online resources: </span> >- <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> >- <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: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> >+ <span class="results_summary online_resources"> >+ <span class="label">Online resources: </span> >+ <xsl:call-template name="renderMARCOnlineResourceField"> >+ <xsl:with-param name="MARCOnlineResourceField">856</xsl:with-param> >+ <xsl:with-param name="Show856uAsImage" select="$Show856uAsImage"></xsl:with-param> >+ <xsl:with-param name="screen" select="'detail'"></xsl:with-param> >+ </xsl:call-template> >+ </span> >+ </xsl:if> >+ </xsl:if> > >- </xsl:for-each> >- </span> >+ <!-- 857 --> >+ <xsl:if test="marc:datafield[@tag=857]"> >+ <xsl:if test="marc:datafield[@tag=857]/marc:subfield[@code='u']"> >+ <span class="results_summary online_resources"> >+ <span class="label">Online archive resources: </span> >+ <xsl:call-template name="renderMARCOnlineResourceField"> >+ <xsl:with-param name="MARCOnlineResourceField">857</xsl:with-param> >+ <xsl:with-param name="screen" select="'detail'"></xsl:with-param> >+ </xsl:call-template> >+ </span> > </xsl:if> > </xsl:if> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >index e40e94a435..07993a37c9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >@@ -977,48 +977,30 @@ > <xsl:with-param name="UseControlNumber" select="$UseControlNumber"/> > </xsl:call-template> > >+ <!-- 856 --> > <xsl:if test="marc:datafield[@tag=856]"> > <xsl:if test="marc:datafield[@tag=856]/marc:subfield[@code='u']"> >- <span class="results_summary online_resources"> >- <span class="label">Online resources: </span> >- <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> >- <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='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_resources"> >+ <span class="label">Online resources: </span> >+ <xsl:call-template name="renderMARCOnlineResourceField"> >+ <xsl:with-param name="MARCOnlineResourceField">856</xsl:with-param> >+ <xsl:with-param name="Show856uAsImage" select="$Show856uAsImage"></xsl:with-param> >+ <xsl:with-param name="screen" select="'results'"></xsl:with-param> >+ </xsl:call-template> >+ </span> >+ </xsl:if> >+ </xsl:if> >+ >+ <!-- 857 --> >+ <xsl:if test="marc:datafield[@tag=857]"> >+ <xsl:if test="marc:datafield[@tag=857]/marc:subfield[@code='u']"> >+ <span class="results_summary online_resources"> >+ <span class="label">Online archive resources: </span> >+ <xsl:call-template name="renderMARCOnlineResourceField"> >+ <xsl:with-param name="MARCOnlineResourceField">857</xsl:with-param> >+ <xsl:with-param name="screen" select="'results'"></xsl:with-param> >+ </xsl:call-template> >+ </span> > </xsl:if> > </xsl:if> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index 45e0ee2252..ba5aff416c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -691,6 +691,61 @@ > </xsl:if> > </xsl:template> > >+ <xsl:template name="renderMARCOnlineResourceField"> >+ <xsl:param name="MARCOnlineResourceField" /> >+ <xsl:param name="Show856uAsImage" /> >+ <xsl:param name="screen" /> >+ >+ <xsl:for-each >+ select="marc:datafield[@tag=$MARCOnlineResourceField and marc:subfield[@code='u']]"> >+ <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="(($screen='detail' and $Show856uAsImage='Details' or $Show856uAsImage='Both') or >+ ($screen='results' and $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> >+ </xsl:template> >+ >+ > <xsl:template name="AddMissingProtocol"> > <xsl:param name="resourceLocation"/> > <xsl:param name="indicator1"/> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 292a3c560e..5110ddb5a6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1243,6 +1243,7 @@ > <xsl:with-param name="MARCOnlineResourceField">857</xsl:with-param> > <xsl:with-param name="OPACTrackClicks" select="$OPACTrackClicks"></xsl:with-param> > <xsl:with-param name="OPACURLOpenInNewWindow" select="$OPACURLOpenInNewWindow"></xsl:with-param> >+ <xsl:with-param name="screen" select="results"></xsl:with-param> > </xsl:call-template> > </ul> > </div> >-- >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 38096
:
172466
|
172467
|
172468
|
172469
|
172470
|
172471
|
172532
|
172533
|
172534
| 172535 |
172536