Bugzilla – Attachment 38677 Details for
Bug 14025
Fix 856u-links in the OPAC for NORMARC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14025 - Fix 865u-links in the OPAC for NORMARC
Bug-14025---Fix-865u-links-in-the-OPAC-for-NORMARC.patch (text/plain), 10.77 KB, created by
Magnus Enger
on 2015-04-29 19:56:35 UTC
(
hide
)
Description:
Bug 14025 - Fix 865u-links in the OPAC for NORMARC
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2015-04-29 19:56:35 UTC
Size:
10.77 KB
patch
obsolete
>From 12e3b29629fef5ae1e9b1fff44569665c1918cb2 Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@enger.priv.no> >Date: Wed, 29 Apr 2015 21:28:50 +0200 >Subject: [PATCH] Bug 14025 - Fix 865u-links in the OPAC for NORMARC > >The display of links found in 856$u for NORMARC has not been keeping up with >the one for MARC21, and several sysprefs have not been implemented. This >patch tries to fix that. > >Affected sysprefs: >- OPACURLOpenInNewWindow >- URLLinkText >- OPACDisplay856uAsImage >- OPACTrackClicks > >To test: >- Make sure you have a record with a URL in 856$u and marcflavor = NORMARC. > (It does not have to be a full NORMARC setup or a NORMARC record, just make > sure you are viewing the record through the NORMARC XSLT files.) >- View the record both in a result list and in detail view >- Check that the 4 involved sysprefs affect the display in the expected ways >--- > .../bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl | 52 ++++++++++++++++------ > .../bootstrap/en/xslt/NORMARCslim2OPACResults.xsl | 50 +++++++++++++++++++++ > 2 files changed, 89 insertions(+), 13 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl >index 01d56af..4d1785b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl >@@ -34,10 +34,14 @@ > </xsl:variable> > <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/> > <xsl:variable name="theme" select="marc:sysprefs/marc:syspref[@name='opacthemes']"/> >- >+ <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/> >+ <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/> >+ <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/> >+ <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/> > <xsl:variable name="leader" select="marc:leader"/> > <xsl:variable name="leader6" select="substring($leader,7,1)"/> > <xsl:variable name="leader7" select="substring($leader,8,1)"/> >+ <xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/> > <xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/> > <xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/> > <xsl:variable name="typeOf008"> >@@ -476,23 +480,45 @@ > </span> > </xsl:if> > >+<!-- Image processing code added here, takes precedence over text links including y3z text --> > <xsl:if test="marc:datafield[@tag=856]"> >- <span class="results_summary"><span class="label">Nettbasert ressurs: </span> >+ <span class="results_summary online_resources"><span class="label">Online resources: </span> > <xsl:for-each select="marc:datafield[@tag=856]"> >- <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute> >- <xsl:choose> >+ <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="marc:subfield[@code='u']"/>;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="marc:subfield[@code='u']"/>;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: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: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'])"> >- Klikk her for tilgang >- </xsl:when> >- </xsl:choose> >- </a> >+ <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> >+ </a> > <xsl:choose> >- <xsl:when test="position()=last()"></xsl:when> >+ <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> > <xsl:otherwise> | </xsl:otherwise> > </xsl:choose> > </xsl:for-each> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACResults.xsl >index 52597bb..163b3aa 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACResults.xsl >@@ -23,6 +23,10 @@ > <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/> > <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/> > <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/> >+ <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/> >+ <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/> >+ <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/> >+ <xsl:variable name="Show856uAsImage" select="marc:sysprefs/marc:syspref[@name='OPACDisplay856uAsImage']"/> > > <xsl:variable name="leader" select="marc:leader"/> > <xsl:variable name="leader6" select="substring($leader,7,1)"/> >@@ -781,6 +785,52 @@ > > </xsl:if> > >+<!-- Links found in 856$u. This is copied verbatim from MARC21 detail view and should be identical to code in NORMARC detail view (except for $Show856uAsImage='Results'). --> >+ <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 property="url"> >+ <xsl:choose> >+ <xsl:when test="$OPACTrackClicks='track'"> >+ <xsl:attribute name="href">/cgi-bin/koha/tracklinks.pl?uri=<xsl:value-of select="marc:subfield[@code='u']"/>;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="marc:subfield[@code='u']"/>;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: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> >+ </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:text>Click here to access online</xsl:text> >+ </xsl:otherwise> >+ </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> >+<!-- End of links found in 856$u --> >+ > <span class="results_summary"> > <span class="label">Availability: </span> > <xsl:choose> >-- >1.9.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 14025
:
38677
|
39240
|
39409