Bugzilla – Attachment 7676 Details for
Bug 7537
Implement TraceCompleteSubfields, TraceSubjectSubdivisions and UseICU for NORMARC XSLT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7537 - Implement TraceCompleteSubfields and TraceSubjectSubdivisions for NORMARC XSLT
Bug-7537---Implement-TraceCompleteSubfields-and-Tr.patch (text/plain), 10.09 KB, created by
Magnus Enger
on 2012-02-16 11:08:10 UTC
(
hide
)
Description:
Bug 7537 - Implement TraceCompleteSubfields and TraceSubjectSubdivisions for NORMARC XSLT
Filename:
MIME Type:
Creator:
Magnus Enger
Created:
2012-02-16 11:08:10 UTC
Size:
10.09 KB
patch
obsolete
>From 58079c4cae2df8c3598fbb14d47e213ab27ad75a Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@enger.priv.no> >Date: Thu, 16 Feb 2012 12:07:35 +0100 >Subject: [PATCH] Bug 7537 - Implement TraceCompleteSubfields and TraceSubjectSubdivisions for NORMARC XSLT >Content-Type: text/plain; charset="utf-8" > >As the title says, this patch implements TraceCompleteSubfields and >TraceSubjectSubdivisions for NORMARC XSLT, both for the OPAC and the >Intranet. This affects how clickable subject-links are constructed. > >To test: > >Find a record with a complex subject, like "Art -- United States". >MARC21 and NORMARC are very similar in how they handle subjects, so testing >on a MARC21 database should be OK. > >Make sure you have these syspref settings: >- marcflavour = NORMARC >- XSLTDetailsDisplay = using XSLT stylesheets >- OPACXSLTDetailsDisplay = using XSLT stylesheets > >Now try the different combinations of TraceCompleteSubfields and >TraceSubjectSubdivisions and check the format of the clickable links, >both in the OPAC and staff client. Here's what you should be seeing: > >1. >TraceCompleteSubfields = Don't force >TraceSubjectSubdivisions = Don't include >-> q=su:{Art} > >2. >TraceCompleteSubfields = Force >TraceSubjectSubdivisions = Don't include >-> q=su,complete-subfield:{Art} > >3. >TraceCompleteSubfields = Don't force >TraceSubjectSubdivisions = Include >-> q=(su:{Art}) and (su:{United%20States.}) > >4. >TraceCompleteSubfields = Force >TraceSubjectSubdivisions = Include >-> q=(su,complete-subfield:{Art}) and (su,complete-subfield:{United States.}) >--- > .../prog/en/xslt/NORMARCslim2intranetDetail.xsl | 22 +++++++++++++++--- > .../prog/en/xslt/NORMARCslimUtils.xsl | 4 ++- > .../prog/en/xslt/NORMARCslim2OPACDetail.xsl | 24 ++++++++++++++++--- > .../opac-tmpl/prog/en/xslt/NORMARCslimUtils.xsl | 4 ++- > 4 files changed, 44 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl >index 163ed29..b9f6da6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl >@@ -15,6 +15,8 @@ > > <!-- Sysprefs --> > <xsl:variable name="OPACBaseURL" select="marc:sysprefs/marc:syspref[@name='OPACBaseURL']"/> >+ <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable> >+ <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/> > > <xsl:variable name="leader" select="marc:leader"/> > <xsl:variable name="leader6" select="substring($leader,7,1)"/> >@@ -293,16 +295,27 @@ > </span> > </xsl:if> > >+ <!-- Subjects --> >+ > <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']"> >- <span class="results_summary"><span class="label">Emner: </span> >+ <span class="results_summary subjects"><span class="label">Emne(r): </span> > <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']"> > <a> > <xsl:choose> >- <xsl:when test="marc:subfield[@code=9]"> >+ <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> > <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> > </xsl:when> >+ <xsl:when test="$TraceSubjectSubdivisions='1'"> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">abcdvxyz</xsl:with-param> >+ <xsl:with-param name="delimeter"> and </xsl:with-param> >+ <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:{</xsl:with-param> >+ <xsl:with-param name="suffix">})</xsl:with-param> >+ </xsl:call-template> >+ </xsl:attribute> >+ </xsl:when> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:{<xsl:value-of select="marc:subfield[@code='a']"/>}</xsl:attribute> > </xsl:otherwise> > </xsl:choose> > <xsl:call-template name="chopPunctuation"> >@@ -313,7 +326,8 @@ > <xsl:with-param name="subdivDelimiter">-- </xsl:with-param> > </xsl:call-template> > </xsl:with-param> >- </xsl:call-template></a> >+ </xsl:call-template> >+ </a> > <xsl:choose> > <xsl:when test="position()=last()"></xsl:when> > <xsl:otherwise> | </xsl:otherwise> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslimUtils.xsl >index 7c2bf21..606727e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslimUtils.xsl >@@ -24,13 +24,15 @@ > <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param> > <xsl:param name="subdivCodes"/> > <xsl:param name="subdivDelimiter"/> >+ <xsl:param name="prefix"/> >+ <xsl:param name="suffix"/> > <xsl:variable name="str"> > <xsl:for-each select="marc:subfield"> > <xsl:if test="contains($codes, @code)"> > <xsl:if test="contains($subdivCodes, @code)"> > <xsl:value-of select="$subdivDelimiter"/> > </xsl:if> >- <xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/> >+ <xsl:value-of select="$prefix"/><xsl:value-of select="text()"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/> > </xsl:if> > </xsl:for-each> > </xsl:variable> >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl >index 1a4e042..eefaddd 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslim2OPACDetail.xsl >@@ -15,6 +15,10 @@ > </xsl:template> > > <xsl:template match="marc:record"> >+ >+ <!-- Sysprefs --> >+ <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable> >+ <xsl:variable name="TraceSubjectSubdivisions" select="marc:sysprefs/marc:syspref[@name='TraceSubjectSubdivisions']"/> > > <xsl:variable name="leader" select="marc:leader"/> > <xsl:variable name="leader6" select="substring($leader,7,1)"/> >@@ -298,16 +302,27 @@ > </span> > </xsl:if> > >+ <!-- Subjects --> >+ > <xsl:if test="marc:datafield[substring(@tag, 1, 1) = '6']"> >- <span class="results_summary"><span class="label">Emner: </span> >+ <span class="results_summary subjects"><span class="label">Emne(r): </span> > <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']"> > <a> > <xsl:choose> >- <xsl:when test="marc:subfield[@code=9]"> >+ <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> > </xsl:when> >+ <xsl:when test="$TraceSubjectSubdivisions='1'"> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">abcdvxyz</xsl:with-param> >+ <xsl:with-param name="delimeter"> and </xsl:with-param> >+ <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:{</xsl:with-param> >+ <xsl:with-param name="suffix">})</xsl:with-param> >+ </xsl:call-template> >+ </xsl:attribute> >+ </xsl:when> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:{<xsl:value-of select="marc:subfield[@code='a']"/>}</xsl:attribute> > </xsl:otherwise> > </xsl:choose> > <xsl:call-template name="chopPunctuation"> >@@ -318,7 +333,8 @@ > <xsl:with-param name="subdivDelimiter">-- </xsl:with-param> > </xsl:call-template> > </xsl:with-param> >- </xsl:call-template></a> >+ </xsl:call-template> >+ </a> > <xsl:choose> > <xsl:when test="position()=last()"></xsl:when> > <xsl:otherwise> | </xsl:otherwise> >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslimUtils.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslimUtils.xsl >index 31317b1..91a0437 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslimUtils.xsl >@@ -25,13 +25,15 @@ > <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param> > <xsl:param name="subdivCodes"/> > <xsl:param name="subdivDelimiter"/> >+ <xsl:param name="prefix"/> >+ <xsl:param name="suffix"/> > <xsl:variable name="str"> > <xsl:for-each select="marc:subfield"> > <xsl:if test="contains($codes, @code)"> > <xsl:if test="contains($subdivCodes, @code)"> > <xsl:value-of select="$subdivDelimiter"/> > </xsl:if> >- <xsl:value-of select="text()"/><xsl:value-of select="$delimeter"/> >+ <xsl:value-of select="$prefix"/><xsl:value-of select="text()"/><xsl:value-of select="$suffix"/><xsl:value-of select="$delimeter"/> > </xsl:if> > </xsl:for-each> > </xsl:variable> >-- >1.7.2.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 7537
:
7676
|
8119
|
8141
|
8587
|
8654