From f7199fa2683cb480d1a65f996fafb4047a7903a1 Mon Sep 17 00:00:00 2001
From: Caitlin Goodger <caitlingoodger.student@wegc.school.nz>
Date: Wed, 18 Jan 2017 20:54:33 +0000
Subject: [PATCH] Bug 17437 MARC21: Show $i for 780/785

Test Plan
1: Inside Administration go to MARC bibliographic framework and on the
default framework under Actions click on MARC structure
2: Search for 780 under search tag and under actions click subfields
3: Find i and click on edit.
4: Under Advanced Constraints select editor and save the changes.
5: Repeat for 785.
6: Find a Bibliograpical record and under Edit select edit record.
7: Under the 7 put values into 780 and 785. For this to work it is
dependant on the patch 17929 so that you can type into the indicators
8: When you save the changes you won't be able to see 780 or 785 on the
Bibliographical details
8: Apply the patch
9: Refresh and 780 and 785 should be there at the bottom under the
content

https://bugs.koha-community.org/show_bug.cgi?id=15437

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 .../prog/en/xslt/MARC21slim2intranetDetail.xsl     | 67 ++++++++++++----------
 1 file changed, 37 insertions(+), 30 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
index 16f727a0e1..115901f278 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
@@ -1242,36 +1242,35 @@
 
         <!-- 780 -->
         <xsl:if test="marc:datafield[@tag=780]">
-        <xsl:for-each select="marc:datafield[@tag=780]">
-        <xsl:if test="@ind1=0">
-        <span class="results_summary preceeding_entry">
-        <xsl:choose>
-        <xsl:when test="@ind2=0">
-            <span class="label">Continues:</span>
-        </xsl:when>
-        <xsl:when test="@ind2=1">
-            <span class="label">Continues in part:</span>
-        </xsl:when>
-        <xsl:when test="@ind2=2">
-            <span class="label">Supersedes:</span>
-        </xsl:when>
-        <xsl:when test="@ind2=3">
-            <span class="label">Supersedes in part:</span>
-        </xsl:when>
-        <xsl:when test="@ind2=4">
-            <span class="label">Formed by the union: ... and: ...</span>
-        </xsl:when>
-        <xsl:when test="@ind2=5">
-            <span class="label">Absorbed:</span>
-        </xsl:when>
-        <xsl:when test="@ind2=6">
-            <span class="label">Absorbed in part:</span>
-        </xsl:when>
-        <xsl:when test="@ind2=7">
-            <span class="label">Separated from:</span>
-        </xsl:when>
-        </xsl:choose>
-        <xsl:text> </xsl:text>
+           <xsl:for-each select="marc:datafield[@tag=780]">
+              <xsl:if test="@ind1=0">
+                 <span class="results_summary preceeding_entry">
+                 <xsl:choose>
+                    <xsl:when test="@ind2=0">
+                       <span class="label">Continues:</span>
+                    </xsl:when>
+                    <xsl:when test="@ind2=1">
+                       <span class="label">Continues in part:</span>
+                    </xsl:when>
+                    <xsl:when test="@ind2=2">
+                       <span class="label">Supersedes:</span>
+                    </xsl:when>
+                    <xsl:when test="@ind2=3">
+                       <span class="label">Supersedes in part:</span>
+                    </xsl:when>
+                    <xsl:when test="@ind2=4">
+                       <span class="label">Formed by the union: ... and: ...</span>
+                    </xsl:when>
+                    <xsl:when test="@ind2=5">
+                       <span class="label">Absorbed:</span>
+                    </xsl:when>
+                    <xsl:when test="@ind2=6">
+                       <span class="label">Absorbed in part:</span>
+                    </xsl:when>
+                    <xsl:when test="@ind2=7">
+                       <span class="label">Separated from:</span>
+                    </xsl:when>
+                </xsl:choose>
                 <xsl:variable name="f780">
                     <xsl:call-template name="subfieldSelect">
                         <xsl:with-param name="codes">a_t</xsl:with-param>
@@ -1291,6 +1290,10 @@
             </xsl:choose>
         </span>
  
+        <xsl:if test="marc:subfield[@code='i']">
+            <span class="results_summary"><xsl:value-of select="marc:subfield[@code='i']"/></span>
+         </xsl:if>
+
         <xsl:if test="marc:subfield[@code='n']">
             <span class="results_summary preceeding_entry_note"><xsl:value-of select="marc:subfield[@code='n']"/></span>
         </xsl:if>
@@ -1353,6 +1356,10 @@
             </xsl:choose>
 
         </span>
+            <xsl:if test="marc:subfield[@code='i']">
+                 <span class="results_summary"><xsl:value-of select="marc:subfield[@code='i']"/></span>
+             </xsl:if>
+
         </xsl:for-each>
         </xsl:if>
 
-- 
2.11.0