Bugzilla – Attachment 3029 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), 5.66 KB, created by
Marcel de Rooy
on 2011-01-27 13:40:37 UTC
(
hide
)
Description:
Revised patch
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2011-01-27 13:40:37 UTC
Size:
5.66 KB
patch
obsolete
>From 839a48a9476907b76a642dca3d6ab22bdff1af95 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 27 Jan 2011 14:19:00 +0100 >Subject: [PATCH] [REVISED] Bug 5622: Always show host entry (773) in staff; control number without organization code >Content-Type: text/plain; charset="utf-8" > >Applies to XSLT generated results in staff normal view. >Remove limitation to show host item entry only for leader19==c. >Use generic LOC label In: instead of Set: >Show title from 773t. > >Revision: Add logic for control number containing MARC Org Code. >--- > .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 12 ++++++------ > .../intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 18 ++++++++++++++++++ > .../opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 18 ++++++++++++++++++ > 3 files changed, 42 insertions(+), 6 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..022cb9a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -275,20 +275,20 @@ > </span> > </xsl:if> > >- <!-- Set --> >- <xsl:if test="$leader19='c'"> >- <span class="results_summary"><span class="label">Set: </span> >+ <!-- Host item entry --> >+ <xsl:if test="marc:datafield[@tag=773]"> >+ <span class="results_summary"><span class="label">In: </span> > <xsl:for-each select="marc:datafield[@tag=773]"> > <a> > <xsl:choose> > <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:value-of select="marc:subfield[@code='w']"/></xsl:attribute> >+ <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:when> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate(marc:subfield[@code='t'], '.', '')"/></xsl:attribute> > </xsl:otherwise> > </xsl:choose> >- <xsl:value-of select="translate(//marc:datafield[@tag=245]/marc:subfield[@code='a'], '.', '')" /> >+ <xsl:value-of select="translate(marc:subfield[@code='t'], '.', '')" /> > </a> > <xsl:choose> > <xsl:when test="position()=last()"></xsl:when> >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/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