Bug 23119: MARC21 added title 246, 730 subfield i displays out of order, and should...
authorDavid Roberts <david@koha-ptfs.co.uk>
Mon, 6 Apr 2020 23:42:19 +0000 (23:42 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 4 May 2020 07:45:25 +0000 (08:45 +0100)
This patch makes the subfield i display before subfield a in the 246 and
730 fields

To test:

1) Create a bibliographic record with data in several subfields in tags
246 and 730.
2) See that subfield i displays at the end of the field in the 246
field, and probably not at all in the 730 field. Check in both the OPAC
and staff client
3) Apply the patch.
4) Check your bib record again in both clients. Subfield i should now
display before subfield a.

Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
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 1d4ecc8..ee38717 100644 (file)
         <xsl:if test="marc:datafield[@tag=246]">
             <span class="results_summary other_title"><span class="label">Other title: </span>
                 <xsl:for-each select="marc:datafield[@tag=246]">
+                    <xsl:if test="marc:subfield[@code='i']">
+                            <xsl:call-template name="subfieldSelect">
+                                   <xsl:with-param name="codes">i</xsl:with-param>
+                           </xsl:call-template>
+                    </xsl:if>
+                       <xsl:text> </xsl:text>
                     <xsl:call-template name="chopPunctuation">
                         <xsl:with-param name="chopString">
                             <xsl:call-template name="subfieldSelect">
                             <xsl:when test="@ind2=8"> [Spine title]</xsl:when>
                         </xsl:choose>
                     </xsl:if>
-                    <xsl:if test="marc:subfield[@code='i']">
-                        <xsl:value-of select="concat(' [',marc:subfield[@code='i'],']')"/>
-                    </xsl:if>
                     <!-- #13386 added separator | -->
                     <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise></xsl:choose>
                 </xsl:for-each>
         <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
             <span class="results_summary uniform_title"><span class="label">Uniform titles: </span>
                 <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
+                    <xsl:if test="marc:subfield[@code='i']">
+                           <xsl:call-template name="subfieldSelect">
+                                   <xsl:with-param name="codes">i</xsl:with-param>
+                           </xsl:call-template>
+                   </xsl:if>
+                   <xsl:text> </xsl:text>
                     <xsl:for-each select="marc:subfield">
                         <xsl:if test="contains('adfghklmnoprst',@code)">
                             <xsl:value-of select="text()"/>
index 5d79840..c92bbbe 100644 (file)
                         <span property="alternateName">
                             <xsl:call-template name="chopPunctuation">
                                 <xsl:with-param name="chopString">
+                                    <xsl:if test="marc:subfield[@code='i']">
+                                           <xsl:call-template name="subfieldSelect">
+                                                   <xsl:with-param name="codes">i</xsl:with-param>
+                                           </xsl:call-template>
+                                    </xsl:if>
+                                   <xsl:text> </xsl:text>
                                     <xsl:call-template name="subfieldSelect">
                                         <xsl:with-param name="codes">abhfgnp</xsl:with-param>
                                     </xsl:call-template>
                                     <xsl:when test="@ind2=8"> [Spine title]</xsl:when>
                                 </xsl:choose>
                             </xsl:if>
-                            <xsl:if test="marc:subfield[@code='i']">
-                                <xsl:value-of select="concat(' [',marc:subfield[@code='i'],']')"/>
-                            </xsl:if>
                         </span>
                         <!-- #13386 added separator | -->
                         <xsl:choose><xsl:when test="position()=last()"><xsl:text></xsl:text></xsl:when><xsl:otherwise><span class="separator"><xsl:text> | </xsl:text></span></xsl:otherwise></xsl:choose>
                 <span class="results_summary uniform_titles"><span class="label">Uniform titles: </span>
                     <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]">
                         <span property="alternateName">
+                            <xsl:if test="marc:subfield[@code='i']">
+                                   <xsl:call-template name="subfieldSelect">
+                                           <xsl:with-param name="codes">i</xsl:with-param>
+                                   </xsl:call-template>
+                            </xsl:if>
+                           <xsl:text> </xsl:text>
                             <xsl:for-each select="marc:subfield">
                                 <xsl:if test="contains('adfghklmnoprst',@code)">
                                     <xsl:value-of select="text()"/>