Bug 15100: MARC21 - make display of "Dates associated with a name" optional
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Sat, 21 Nov 2015 23:29:32 +0000 (00:29 +0100)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Wed, 27 Jan 2016 04:24:56 +0000 (04:24 +0000)
With the changes for RDA now more subfields for the fields
100, 110, 111, and 700, 710, 711 are displayed.
One of them is $d - Dates associated with a name

This patch adds separate treatment of the $d subfield and
wraps it in a span with the class "authordates".
This makes it possible to hide the information with CSS.

To test:
- Make sure you have several records with $d catalogued
- Check the display in result list and detail page
  with and without the page.
- Check, if there is a difference in display
- Check if the dates are correctly wrapped in a span
- Try to hide the information, using the following
  entry in your *UserCSS preferences:
  .authordates { display: none; }

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl

index 556f44f..d42e75a 100644 (file)
                            <xsl:with-param name="codes">
                                <xsl:choose>
                                    <!-- #13383 include subfield e for field 111  -->
-                                   <xsl:when test="@tag=111">abcdeqt</xsl:when>
-                                   <xsl:otherwise>abcdjqt</xsl:otherwise>
+                                   <xsl:when test="@tag=111">abceqt</xsl:when>
+                                   <xsl:otherwise>abcjqt</xsl:otherwise>
                                </xsl:choose>
                            </xsl:with-param>
                        </xsl:call-template>
                </xsl:call-template>
            </xsl:when>
            <!-- #13382 excludes 700$i and ind2=2, displayed as Related Works -->
-           <!--#13382 Added all relevant subfields 4, e, are handled separately -->
+           <!--#13382 Added all relevant subfields 4, e, and d are handled separately -->
            <xsl:when test="@tag=700 or @tag=710 or @tag=711">
                <xsl:variable name="str">
                    <xsl:call-template name="subfieldSelect">
-                       <xsl:with-param name="codes">abcdfghiklmnoprstux</xsl:with-param>
+                       <xsl:with-param name="codes">abcfghiklmnoprstux</xsl:with-param>
                    </xsl:call-template>
                </xsl:variable>
                <xsl:call-template name="chopPunctuation">
                </xsl:call-template>
            </xsl:when>
        </xsl:choose>
-
+    <xsl:if test="marc:subfield[@code='d']">
+        <span class="authordates">
+            <xsl:text> </xsl:text>
+            <xsl:value-of select="marc:subfield[@code='d']"/>
+        </span>
+    </xsl:if>
        <!-- add relator code too between brackets-->
     <!-- #13383 include relator code j for field 111 -->
             <xsl:if test="marc:subfield[@code='4' or @code='e'][not(parent::*[@tag=111])] or (self::*[@tag=111] and marc:subfield[@code='4' or @code='j'][. != ''])">
index 0d40cab..839e1ac 100644 (file)
                             <xsl:with-param name="codes">
                                 <xsl:choose>
                                     <!-- #13383 include subfield e for field 111  -->
-                                    <xsl:when test="@tag=111">abcdeqt</xsl:when>
-                                    <xsl:otherwise>abcdjqt</xsl:otherwise>
+                                    <xsl:when test="@tag=111">abceqt</xsl:when>
+                                    <xsl:otherwise>abcjqt</xsl:otherwise>
                                 </xsl:choose>
                             </xsl:with-param>
                         </xsl:call-template>
                     </xsl:with-param>
                 </xsl:call-template>
             </a>
+            <xsl:if test="marc:subfield[@code='d']">
+                <span class="authordates">
+                    <xsl:text> </xsl:text>
+                    <xsl:value-of select="marc:subfield[@code='d']"/>
+                </span>
+            </xsl:if>
             <xsl:if test="marc:subfield[@code='4' or @code='e'][not(parent::*[@tag=111])] or (self::*[@tag=111] and marc:subfield[@code='4' or @code='j'][. != ''])">
                 <span class="relatorcode">
                     <xsl:text> [</xsl:text>
index 3c04fbc..270c932 100644 (file)
                                     <xsl:with-param name="codes">
                                         <xsl:choose>
                                             <!-- #13383 include subfield e for field 111  -->
-                                            <xsl:when test="@tag=111">abcdeqt</xsl:when>
-                                            <xsl:otherwise>abcdjqt</xsl:otherwise>
+                                            <xsl:when test="@tag=111">abceqt</xsl:when>
+                                            <xsl:otherwise>abcjqt</xsl:otherwise>
                                         </xsl:choose>
                                     </xsl:with-param>
                                 </xsl:call-template>
                         </xsl:call-template>
                     </xsl:when>
                     <!-- #13382 excludes 700$i and ind2=2, displayed as Related Works -->
-                    <!--#13382 Added all relevant subfields 4, e, are handled separately -->
+                    <!--#13382 Added all relevant subfields 4, e, and d are handled separately -->
                     <xsl:when test="@tag=700 or @tag=710 or @tag=711">
                         <xsl:variable name="str">
                             <xsl:call-template name="subfieldSelect">
-                                <xsl:with-param name="codes">abcdfghiklmnoprstux</xsl:with-param>
+                                <xsl:with-param name="codes">abcfghiklmnoprstux</xsl:with-param>
                             </xsl:call-template>
                         </xsl:variable>
                         <xsl:call-template name="chopPunctuation">
                     </xsl:when>
                 </xsl:choose>
                 </span></span></span>
+                <xsl:if test="marc:subfield[@code='d']">
+                    <span class="authordates">
+                        <xsl:text> </xsl:text>
+                        <xsl:value-of select="marc:subfield[@code='d']"/>
+                    </span>
+                </xsl:if>
                 <!-- #13383 include relator code j for field 111 -->
                 <xsl:if test="marc:subfield[@code='4' or @code='e'][not(parent::*[@tag=111])] or (self::*[@tag=111] and marc:subfield[@code='4' or @code='j'][. != ''])">
                     <span class="relatorcode">
index 18225ac..383ccb3 100644 (file)
                         <xsl:with-param name="codes">
                             <xsl:choose>
                                 <!-- #13383 include subfield e for field 111  -->
-                                <xsl:when test="@tag=111">abcdeqt</xsl:when>
-                                <xsl:otherwise>abcdjqt</xsl:otherwise>
+                                <xsl:when test="@tag=111">abceqt</xsl:when>
+                                <xsl:otherwise>abcjqt</xsl:otherwise>
                             </xsl:choose>
                         </xsl:with-param>
                     </xsl:call-template>
                     <xsl:text>:,;/ </xsl:text>
                 </xsl:with-param>
             </xsl:call-template>
+            <xsl:if test="marc:subfield[@code='d']">
+                <span class="authordates">
+                    <xsl:text> </xsl:text>
+                    <xsl:value-of select="marc:subfield[@code='d']"/>
+                </span>
+            </xsl:if>
             <xsl:if test="marc:subfield[@code='4' or @code='e'][not(parent::*[@tag=111])] or (self::*[@tag=111] and marc:subfield[@code='4' or @code='j'][. != ''])">
                 <span class="relatorcode">
                     <xsl:text> [</xsl:text>