Bug 15727: Add MARC21 385 - Audience to detail pages
authorKatrin Fischer <katrin.fischer.83@web.de>
Sat, 11 Apr 2020 14:09:27 +0000 (14:09 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 5 May 2020 10:07:02 +0000 (11:07 +0100)
This add 385$m$a to the staff and intranet detail pages.

To test:
- Catalog different variations of 385 and verify the
  display in the OPAC and staff client is ok

Examples can be found in the LOC MARC21 documentation:
http://www.loc.gov/marc/bibliographic/bd385.html

Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

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

index ee38717..cd3a060 100644 (file)
             </span>
         </xsl:if>
 
+        <!-- 385 - Audience -->
+        <xsl:if test="marc:datafield[@tag=385]">
+            <span class="results_summary audience">
+                <span class="label">Audience: </span>
+                <xsl:for-each select="marc:datafield[@tag=385]">
+                    <xsl:if test="marc:subfield[@code='m']">
+                        <xsl:call-template name="chopPunctuation">
+                            <xsl:with-param name="chopString">
+                                <xsl:call-template name="subfieldSelect">
+                                    <xsl:with-param name="codes">m</xsl:with-param>
+                                </xsl:call-template>
+                            </xsl:with-param>
+                        </xsl:call-template>
+                        <xsl:text>: </xsl:text>
+                    </xsl:if>
+                        <xsl:call-template name="chopPunctuation">
+                            <xsl:with-param name="chopString">
+                                <xsl:call-template name="subfieldSelect">
+                                    <xsl:with-param name="codes">a</xsl:with-param>
+                                    <xsl:with-param name="delimeter">, </xsl:with-param>
+                                </xsl:call-template>
+                            </xsl:with-param>
+                        </xsl:call-template>
+                    <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>
+            </span>
+        </xsl:if>
 
         <xsl:call-template name="showISBNISSN"/>
 
index c92bbbe..21709f3 100644 (file)
                 </span>
             </xsl:if>
 
-
+        <!-- 385 - Audience -->
+        <xsl:if test="marc:datafield[@tag=385]">
+            <span class="results_summary audience">
+                <span class="label">Audience: </span>
+                <xsl:for-each select="marc:datafield[@tag=385]">
+                    <xsl:if test="marc:subfield[@code='m']">
+                        <xsl:call-template name="chopPunctuation">
+                            <xsl:with-param name="chopString">
+                                <xsl:call-template name="subfieldSelect">
+                                    <xsl:with-param name="codes">m</xsl:with-param>
+                                </xsl:call-template>
+                            </xsl:with-param>
+                        </xsl:call-template>
+                        <xsl:text>: </xsl:text>
+                    </xsl:if>
+                        <xsl:call-template name="chopPunctuation">
+                            <xsl:with-param name="chopString">
+                                <xsl:call-template name="subfieldSelect">
+                                    <xsl:with-param name="codes">a</xsl:with-param>
+                                    <xsl:with-param name="delimeter">, </xsl:with-param>
+                                </xsl:call-template>
+                            </xsl:with-param>
+                        </xsl:call-template>
+                    <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>
+            </span>
+        </xsl:if>
 
         <xsl:if test="marc:datafield[@tag=020]/marc:subfield[@code='a']">
           <span class="results_summary isbn"><span class="label">ISBN: </span>