Bugzilla – Attachment 32204 Details for
Bug 12724
Show RDA tag 264 on OPAC Detail XSLT view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12724: Show RDA tag 264 on OPAC Detail XSLT view
Bug-12724-Show-RDA-tag-264-on-OPAC-Detail-XSLT-vie.patch (text/plain), 6.14 KB, created by
Paul Poulain
on 2014-10-10 20:17:51 UTC
(
hide
)
Description:
Bug 12724: Show RDA tag 264 on OPAC Detail XSLT view
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2014-10-10 20:17:51 UTC
Size:
6.14 KB
patch
obsolete
>From 5fcc5f41b9c2ca16f9f388bdb60e83c43594d39b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 4 Aug 2014 15:36:41 +0200 >Subject: [PATCH] Bug 12724: Show RDA tag 264 on OPAC Detail XSLT view >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch adds selected information from tag 264 to the Publisher line >on the OPAC detail XSLT view (MARC21). This includes a label, and the >subfields abc. > >If Publication tag 260 exists, it adds information. If tag 260 does not exist, >it creates a 'publisher' line. (NOTE: Probably, both fields will not both be >present, but this patch can deal with that..) > >Instead of showing all 264 tags, it picks the preferred one based on the >following rules (using both indicators; see LOC description): >[1] Try to select a Publisher -- Latest. Pick first one. >[2] Else try to select a Publisher. Pick the last one. >[3] Else try to select an other one (Producer, Manufacturer, ..) with Latest. > Pick the first one of that. >[4] Otherwise: Pick the last 264 tag. > >Test plan: >[1] Add one 260 and multiple 264 tags to your record. >[2] Check display in OPAC detail XSLT. >[3] Change some indicators, subfields of the 264s. >[4] Check display again, following the above rules. > Go back to step 3 a couple of times. >[5] Remove tag 260. Check display again. > >Followed test plan. Patch behaves as expected. >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> >--- > .../bootstrap/en/xslt/MARC21slim2OPACDetail.xsl | 77 +++++++++++++++++++++- > 1 file changed, 75 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index 6e22599..cd18080 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -324,7 +324,9 @@ > </xsl:call-template> > </xsl:if> > >- <xsl:if test="marc:datafield[@tag=260]"> >+ <!-- Publisher info and RDA related info from tags 260, 264 --> >+ <xsl:choose> >+ <xsl:when test="marc:datafield[@tag=260]"> > <span class="results_summary publisher"><span class="label">Publisher: </span> > <xsl:for-each select="marc:datafield[@tag=260]"> > <span property="publisher" typeof="Organization"> >@@ -358,8 +360,18 @@ > </xsl:if> > <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose> > </xsl:for-each> >+ <xsl:if test="marc:datafield[@tag=264]"> >+ <xsl:text>; </xsl:text> >+ <xsl:call-template name="showRDAtag264"/> >+ </xsl:if> > </span> >- </xsl:if> >+ </xsl:when> >+ <xsl:when test="marc:datafield[@tag=264]"> >+ <span class="results_summary"> >+ <xsl:call-template name="showRDAtag264"/> >+ </span> >+ </xsl:when> >+ </xsl:choose> > > <!-- Edition Statement: Alternate Graphic Representation (MARC 880) --> > <xsl:if test="$display880"> >@@ -1058,6 +1070,67 @@ > <xsl:text>.</xsl:text> > </xsl:template> > >+ <xsl:template name="showRDAtag264"> >+ <!-- Depending on how many tags you have, we will pick by preference >+ Publisher-latest or Publisher or 'Other'-latest or 'Other' >+ The preferred tag is saved in the fav variable and passed to a >+ helper named-template --> >+ <xsl:choose> >+ <xsl:when test="marc:datafield[@tag=264 and @ind1=3 and @ind2=1]"> >+ <!-- ind1==3 means latest change --> >+ <!-- ind2==1 means Publisher --> >+ <xsl:variable name="fav" select="marc:datafield[@tag=264 and @ind1=3 and @ind2=1][1]"/> >+ <xsl:call-template name="showRDAtag264helper"> >+ <xsl:with-param name="field" select="$fav"/> >+ </xsl:call-template> >+ </xsl:when> >+ >+ <xsl:when test="marc:datafield[@tag=264 and @ind2=1]"> >+ <xsl:variable name="fav" select="marc:datafield[@tag=264 and @ind2=1][last()]"/> >+ <xsl:call-template name="showRDAtag264helper"> >+ <xsl:with-param name="field" select="$fav"/> >+ </xsl:call-template> >+ </xsl:when> >+ >+ <xsl:when test="marc:datafield[@tag=264 and @ind1=3]"> >+ <xsl:variable name="fav" select="marc:datafield[@tag=264 and @ind1=3][1]"/> >+ <xsl:call-template name="showRDAtag264helper"> >+ <xsl:with-param name="field" select="$fav"/> >+ </xsl:call-template> >+ </xsl:when> >+ >+ <xsl:otherwise> >+ <xsl:variable name="fav" select="marc:datafield[@tag=264][last()]"/> >+ <xsl:call-template name="showRDAtag264helper"> >+ <xsl:with-param name="field" select="$fav"/> >+ </xsl:call-template> >+ </xsl:otherwise> >+ </xsl:choose> >+ </xsl:template> >+ <xsl:template name="showRDAtag264helper"> >+ <xsl:param name="field"/> >+ <xsl:variable name="ind2" select="$field/@ind2"/> >+ <xsl:choose> >+ <xsl:when test="$ind2='0'"> >+ <span class="label">Producer: </span> >+ </xsl:when> >+ <xsl:when test="$ind2='1'"> >+ <span class="label">Publisher: </span> >+ </xsl:when> >+ <xsl:when test="$ind2='2'"> >+ <span class="label">Distributor: </span> >+ </xsl:when> >+ <xsl:when test="$ind2='3'"> >+ <span class="label">Manufacturer: </span> >+ </xsl:when> >+ </xsl:choose> >+ <xsl:value-of select="$field/marc:subfield[@code='a']"/> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="$field/marc:subfield[@code='b']"/> >+ <xsl:text> </xsl:text> >+ <xsl:value-of select="$field/marc:subfield[@code='c']"/> >+ </xsl:template> >+ > <xsl:template name="nameABCQ"> > <xsl:call-template name="chopPunctuation"> > <xsl:with-param name="chopString"> >-- >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 12724
:
30555
|
30559
| 32204