Bugzilla – Attachment 30388 Details for
Bug 8995
Show OpenURL links in OPAC search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8995: Add OpenURL link to OPAC bootstrap XSLT files
Bug-8995-Add-OpenURL-link-to-OPAC-bootstrap-XSLT-f.patch (text/plain), 11.99 KB, created by
Julian Maurice
on 2014-07-31 09:31:55 UTC
(
hide
)
Description:
Bug 8995: Add OpenURL link to OPAC bootstrap XSLT files
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2014-07-31 09:31:55 UTC
Size:
11.99 KB
patch
obsolete
>From 3b1924498c51c71dce5c8aec2d615b1ef7109a1f Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 31 Jul 2014 11:09:29 +0200 >Subject: [PATCH] Bug 8995: Add OpenURL link to OPAC bootstrap XSLT files > >--- > .../bootstrap/en/xslt/MARC21slim2OPACDetail.xsl | 58 +++++++++++++++++++ > .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 60 +++++++++++++++++++- > .../bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl | 59 +++++++++++++++++++ > .../bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl | 58 +++++++++++++++++++ > 4 files changed, 234 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index fdd5421..ea19f58 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -982,6 +982,64 @@ > </xsl:for-each> > </xsl:if> > >+ <!-- OpenURL --> >+ <xsl:variable name="OPACShowOpenURL" select="marc:sysprefs/marc:syspref[@name='OPACShowOpenURL']" /> >+ <xsl:variable name="OpenURLResolverURL" select="marc:sysprefs/marc:syspref[@name='OpenURLResolverURL']" /> >+ <xsl:variable name="OpenURLImageLocation" select="marc:sysprefs/marc:syspref[@name='OpenURLImageLocation']" /> >+ <xsl:variable name="OpenURLText" select="marc:sysprefs/marc:syspref[@name='OpenURLText']" /> >+ <xsl:variable name="COinS" select="marc:variables/marc:variable[@name='COinS']" /> >+ >+ <xsl:if test="$OPACShowOpenURL = 1 and $OpenURLResolverURL != '' and $COinS != ''"> >+ <xsl:variable name="openurltext"> >+ <xsl:choose> >+ <xsl:when test="$OpenURLText != ''"> >+ <xsl:value-of select="$OpenURLText" /> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>OpenURL</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> >+ <xsl:variable name="openurlimagelocation"> >+ <xsl:choose> >+ <xsl:when test="starts-with($OpenURLImageLocation, 'http://') or starts-with($OpenURLImageLocation, 'https://')"> >+ <xsl:value-of select="$OpenURLImageLocation" /> >+ </xsl:when> >+ <xsl:when test="$OpenURLImageLocation != ''"> >+ <xsl:text>/opac-tmpl/prog/images/</xsl:text> >+ <xsl:value-of select="$OpenURLImageLocation" /> >+ </xsl:when> >+ </xsl:choose> >+ </xsl:variable> >+ >+ <span class="results_summary"><a> >+ <xsl:attribute name="href"> >+ <xsl:value-of select="$OpenURLResolverURL" /> >+ <xsl:text>?</xsl:text> >+ <xsl:value-of select="$COinS" /> >+ </xsl:attribute> >+ <xsl:attribute name="title"> >+ <xsl:value-of select="$openurltext" /> >+ </xsl:attribute> >+ <xsl:attribute name="class"> >+ <xsl:text>OpenURL</xsl:text> >+ </xsl:attribute> >+ <xsl:choose> >+ <xsl:when test="$openurlimagelocation != ''"> >+ <img> >+ <xsl:attribute name="src"> >+ <xsl:value-of select="$openurlimagelocation" /> >+ </xsl:attribute> >+ </img> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="$openurltext" /> >+ </xsl:otherwise> >+ </xsl:choose> >+ </a></span> >+ </xsl:if> >+ <!-- End of OpenURL --> >+ > </xsl:element> > </xsl:template> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index ea6af38..67b0d30 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -438,8 +438,66 @@ > </xsl:for-each> > </xsl:if> > </a> >- <p> > >+ <!-- OpenURL --> >+ <xsl:variable name="OPACShowOpenURL" select="marc:sysprefs/marc:syspref[@name='OPACShowOpenURL']" /> >+ <xsl:variable name="OpenURLResolverURL" select="marc:sysprefs/marc:syspref[@name='OpenURLResolverURL']" /> >+ <xsl:variable name="OpenURLImageLocation" select="marc:sysprefs/marc:syspref[@name='OpenURLImageLocation']" /> >+ <xsl:variable name="OpenURLText" select="marc:sysprefs/marc:syspref[@name='OpenURLText']" /> >+ <xsl:variable name="COinS" select="marc:variables/marc:variable[@name='COinS']" /> >+ >+ <xsl:if test="$OPACShowOpenURL = 1 and $OpenURLResolverURL != '' and $COinS != ''"> >+ <xsl:variable name="openurltext"> >+ <xsl:choose> >+ <xsl:when test="$OpenURLText != ''"> >+ <xsl:value-of select="$OpenURLText" /> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>OpenURL</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> >+ <xsl:variable name="openurlimagelocation"> >+ <xsl:choose> >+ <xsl:when test="starts-with($OpenURLImageLocation, 'http://') or starts-with($OpenURLImageLocation, 'https://')"> >+ <xsl:value-of select="$OpenURLImageLocation" /> >+ </xsl:when> >+ <xsl:when test="$OpenURLImageLocation != ''"> >+ <xsl:text>/opac-tmpl/prog/images/</xsl:text> >+ <xsl:value-of select="$OpenURLImageLocation" /> >+ </xsl:when> >+ </xsl:choose> >+ </xsl:variable> >+ >+ <span class="results_summary"><a> >+ <xsl:attribute name="href"> >+ <xsl:value-of select="$OpenURLResolverURL" /> >+ <xsl:text>?</xsl:text> >+ <xsl:value-of select="$COinS" /> >+ </xsl:attribute> >+ <xsl:attribute name="title"> >+ <xsl:value-of select="$openurltext" /> >+ </xsl:attribute> >+ <xsl:attribute name="class"> >+ <xsl:text>OpenURL</xsl:text> >+ </xsl:attribute> >+ <xsl:choose> >+ <xsl:when test="$openurlimagelocation != ''"> >+ <img> >+ <xsl:attribute name="src"> >+ <xsl:value-of select="$openurlimagelocation" /> >+ </xsl:attribute> >+ </img> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="$openurltext" /> >+ </xsl:otherwise> >+ </xsl:choose> >+ </a></span> >+ </xsl:if> >+ <!-- End of OpenURL --> >+ >+ <p> > <!-- Author Statement: Alternate Graphic Representation (MARC 880) --> > <xsl:if test="$display880"> > <xsl:call-template name="m880Select"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl >index f7d1984..b07abb0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl >@@ -438,6 +438,65 @@ > </xsl:for-each> > </span> > </xsl:if> >+ >+ <!-- OpenURL --> >+ <xsl:variable name="OPACShowOpenURL" select="marc:sysprefs/marc:syspref[@name='OPACShowOpenURL']" /> >+ <xsl:variable name="OpenURLResolverURL" select="marc:sysprefs/marc:syspref[@name='OpenURLResolverURL']" /> >+ <xsl:variable name="OpenURLImageLocation" select="marc:sysprefs/marc:syspref[@name='OpenURLImageLocation']" /> >+ <xsl:variable name="OpenURLText" select="marc:sysprefs/marc:syspref[@name='OpenURLText']" /> >+ <xsl:variable name="COinS" select="marc:variables/marc:variable[@name='COinS']" /> >+ >+ <xsl:if test="$OPACShowOpenURL = 1 and $OpenURLResolverURL != '' and $COinS != ''"> >+ <xsl:variable name="openurltext"> >+ <xsl:choose> >+ <xsl:when test="$OpenURLText != ''"> >+ <xsl:value-of select="$OpenURLText" /> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>OpenURL</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> >+ <xsl:variable name="openurlimagelocation"> >+ <xsl:choose> >+ <xsl:when test="starts-with($OpenURLImageLocation, 'http://') or starts-with($OpenURLImageLocation, 'https://')"> >+ <xsl:value-of select="$OpenURLImageLocation" /> >+ </xsl:when> >+ <xsl:when test="$OpenURLImageLocation != ''"> >+ <xsl:text>/opac-tmpl/prog/images/</xsl:text> >+ <xsl:value-of select="$OpenURLImageLocation" /> >+ </xsl:when> >+ </xsl:choose> >+ </xsl:variable> >+ >+ <span class="results_summary"><a> >+ <xsl:attribute name="href"> >+ <xsl:value-of select="$OpenURLResolverURL" /> >+ <xsl:text>?</xsl:text> >+ <xsl:value-of select="$COinS" /> >+ </xsl:attribute> >+ <xsl:attribute name="title"> >+ <xsl:value-of select="$openurltext" /> >+ </xsl:attribute> >+ <xsl:attribute name="class"> >+ <xsl:text>OpenURL</xsl:text> >+ </xsl:attribute> >+ <xsl:choose> >+ <xsl:when test="$openurlimagelocation != ''"> >+ <img> >+ <xsl:attribute name="src"> >+ <xsl:value-of select="$openurlimagelocation" /> >+ </xsl:attribute> >+ </img> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="$openurltext" /> >+ </xsl:otherwise> >+ </xsl:choose> >+ </a></span> >+ </xsl:if> >+ <!-- End of OpenURL --> >+ > </xsl:template> > > <xsl:template name="nameABCDQ"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl >index 5c9c88e..4956b27 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl >@@ -77,6 +77,64 @@ > </xsl:for-each> > </xsl:if> > >+ <!-- OpenURL --> >+ <xsl:variable name="OPACShowOpenURL" select="marc:sysprefs/marc:syspref[@name='OPACShowOpenURL']" /> >+ <xsl:variable name="OpenURLResolverURL" select="marc:sysprefs/marc:syspref[@name='OpenURLResolverURL']" /> >+ <xsl:variable name="OpenURLImageLocation" select="marc:sysprefs/marc:syspref[@name='OpenURLImageLocation']" /> >+ <xsl:variable name="OpenURLText" select="marc:sysprefs/marc:syspref[@name='OpenURLText']" /> >+ <xsl:variable name="COinS" select="marc:variables/marc:variable[@name='COinS']" /> >+ >+ <xsl:if test="$OPACShowOpenURL = 1 and $OpenURLResolverURL != '' and $COinS != ''"> >+ <xsl:variable name="openurltext"> >+ <xsl:choose> >+ <xsl:when test="$OpenURLText != ''"> >+ <xsl:value-of select="$OpenURLText" /> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:text>OpenURL</xsl:text> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> >+ <xsl:variable name="openurlimagelocation"> >+ <xsl:choose> >+ <xsl:when test="starts-with($OpenURLImageLocation, 'http://') or starts-with($OpenURLImageLocation, 'https://')"> >+ <xsl:value-of select="$OpenURLImageLocation" /> >+ </xsl:when> >+ <xsl:when test="$OpenURLImageLocation != ''"> >+ <xsl:text>/opac-tmpl/prog/images/</xsl:text> >+ <xsl:value-of select="$OpenURLImageLocation" /> >+ </xsl:when> >+ </xsl:choose> >+ </xsl:variable> >+ >+ <span class="results_summary"><a> >+ <xsl:attribute name="href"> >+ <xsl:value-of select="$OpenURLResolverURL" /> >+ <xsl:text>?</xsl:text> >+ <xsl:value-of select="$COinS" /> >+ </xsl:attribute> >+ <xsl:attribute name="title"> >+ <xsl:value-of select="$openurltext" /> >+ </xsl:attribute> >+ <xsl:attribute name="class"> >+ <xsl:text>OpenURL</xsl:text> >+ </xsl:attribute> >+ <xsl:choose> >+ <xsl:when test="$openurlimagelocation != ''"> >+ <img> >+ <xsl:attribute name="src"> >+ <xsl:value-of select="$openurlimagelocation" /> >+ </xsl:attribute> >+ </img> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="$openurltext" /> >+ </xsl:otherwise> >+ </xsl:choose> >+ </a></span> >+ </xsl:if> >+ <!-- End of OpenURL --> >+ > <xsl:call-template name="tag_title"> > <xsl:with-param name="tag">454</xsl:with-param> > <xsl:with-param name="label">Translation of</xsl:with-param> >-- >1.7.10.4
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 8995
:
13141
|
22753
|
23625
|
23626
|
23627
|
24087
|
24088
|
24089
|
26899
|
26900
|
26901
|
29357
|
29358
|
29359
|
30385
|
30386
|
30387
|
30388
|
30389
|
30390
|
35747
|
35916
|
40647
|
44639
|
48371
|
48372
|
55131
|
55132
|
55133
|
55134
|
55135
|
55136
|
55882
|
64513
|
64514
|
64515
|
64516
|
64517
|
64518
|
64519
|
64532
|
64533
|
64534
|
64535
|
64536
|
64537
|
64538
|
86483
|
86484
|
86485
|
86486
|
86487
|
86488
|
86489
|
86490
|
86491
|
86492
|
86541
|
86542
|
86557
|
86558
|
86559
|
86601
|
86602
|
86603
|
86604
|
86605
|
86606
|
86607
|
86608
|
86609
|
86610
|
88665
|
88666
|
88667
|
88668
|
88669
|
88670
|
88671
|
88672
|
88673
|
88735
|
88736
|
88737
|
88738
|
88739
|
88740
|
88741
|
88742
|
88743
|
88744
|
89012
|
89013
|
89014
|
89015
|
89120