Bugzilla – Attachment 3052 Details for
Bug 5622
Improve display of MARC21 773 field in XSLT detail view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Revised patch
patch.txt (text/plain), 7.82 KB, created by
Marcel de Rooy
on 2011-02-02 15:54:12 UTC
(
hide
)
Description:
Revised patch
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2011-02-02 15:54:12 UTC
Size:
7.82 KB
patch
obsolete
>From 09ae1c4cb83d353194fe23445abcbffce7b1ce72 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 2 Feb 2011 16:24:36 +0100 >Subject: [PATCH] 5622: Improve display of MARC21 773 field in XSLT detail view >Content-Type: text/plain; charset="utf-8" > >Applies change to OPAC and staff detail view. >Chops punctuation. Adds 773g. Strips MARC org code from URL. >Utils code is used as basis for patches #5662 and #5663 too. >--- > .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 10 +++++----- > .../intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 18 ++++++++++++++++++ > .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 10 +++++----- > .../opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 18 ++++++++++++++++++ > 4 files changed, 46 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index edaf280..ebc8a86 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -565,19 +565,19 @@ > </xsl:choose> > </span> > <xsl:variable name="f773"> >- <xsl:call-template name="subfieldSelect"> >+ <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect"> > <xsl:with-param name="codes">at</xsl:with-param> >- </xsl:call-template> >+ </xsl:call-template></xsl:with-param></xsl:call-template> > </xsl:variable> > <xsl:choose> > <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >- <a href="/cgi-bin/koha/catalogue/search.pl?q=Control-number:{marc:subfield[@code='w']}"> >- <xsl:value-of select="translate($f773, '()', '')"/> >+ <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute> >+ <xsl:value-of select="translate($f773, '()', '')"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if> > </a> > </xsl:when> > <xsl:otherwise> > <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute> >- <xsl:value-of select="$f773"/> >+ <xsl:value-of select="$f773"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if> > </a> > </xsl:otherwise> > </xsl:choose> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index d101723..559de13 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -65,6 +65,24 @@ > <xsl:text> </xsl:text> > </xsl:template> > >+ <!-- Function extractControlNumber is used to extract the control number (record number) from MARC tags 773/80/85 [etc.] subfield $w. >+ Parameter: control number string. >+ Assumes LOC convention: (OrgCode)recordNumber. >+ If OrgCode is not present, return full string. >+ Additionally, handle various brackets/parentheses. Chop leading and trailing spaces. >+ --> >+ <xsl:template name="extractControlNumber"> >+ <xsl:param name="subfieldW"/> >+ <xsl:variable name="tranW" select="translate($subfieldW,']})>','))))')"/> >+ <xsl:choose> >+ <xsl:when test="contains($tranW,')')"> >+ <xsl:value-of select="normalize-space(translate(substring-after($tranW,')'),'[]{}()<>',''))"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="normalize-space($subfieldW)"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:template> > > <!-- Function m880Select: Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags > - should be called immediately before the corresonding latin tags are processed >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >index 5703059..019ee01 100755 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl >@@ -605,19 +605,19 @@ > </xsl:choose> > </span> > <xsl:variable name="f773"> >- <xsl:call-template name="subfieldSelect"> >+ <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect"> > <xsl:with-param name="codes">at</xsl:with-param> >- </xsl:call-template> >+ </xsl:call-template></xsl:with-param></xsl:call-template> > </xsl:variable> > <xsl:choose> > <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >- <a href="/cgi-bin/koha/opac-search.pl?q=Control-number:{marc:subfield[@code='w']}"> >- <xsl:value-of select="translate($f773, '()', '')"/> >+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute> >+ <xsl:value-of select="translate($f773, '()', '')"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if> > </a> > </xsl:when> > <xsl:otherwise> > <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute> >- <xsl:value-of select="$f773"/> >+ <xsl:value-of select="$f773"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if> > </a> > </xsl:otherwise> > </xsl:choose> >diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index d101723..559de13 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -65,6 +65,24 @@ > <xsl:text> </xsl:text> > </xsl:template> > >+ <!-- Function extractControlNumber is used to extract the control number (record number) from MARC tags 773/80/85 [etc.] subfield $w. >+ Parameter: control number string. >+ Assumes LOC convention: (OrgCode)recordNumber. >+ If OrgCode is not present, return full string. >+ Additionally, handle various brackets/parentheses. Chop leading and trailing spaces. >+ --> >+ <xsl:template name="extractControlNumber"> >+ <xsl:param name="subfieldW"/> >+ <xsl:variable name="tranW" select="translate($subfieldW,']})>','))))')"/> >+ <xsl:choose> >+ <xsl:when test="contains($tranW,')')"> >+ <xsl:value-of select="normalize-space(translate(substring-after($tranW,')'),'[]{}()<>',''))"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="normalize-space($subfieldW)"/> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:template> > > <!-- Function m880Select: Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags > - should be called immediately before the corresonding latin tags are processed >-- >1.6.0.6 >
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 5622
:
2998
|
3029
| 3052 |
3342