[Koha-patches] [PATCH] Bug 7332: Translated title (MARC21 242) not shown

Jared Camins-Esakov jcamins at cpbibliography.com
Thu Dec 8 15:22:37 CET 2011


The cataloger-supplied translated title stored in MARC21 field 242 was not being
displayed when XSLT was enabled.

Test plan:
1) Enable XSLT for OPAC Details and Results, and Intranet Details.
2) Create or add a record with a 242 field
3) See that the translated title is not displayed in OPAC Details or Results, or
Intranet Details
4) Apply patch
5) See that the translated title is now displayed in OPAC Details and Results,
and Intranet Details
---
 .../prog/en/xslt/MARC21slim2intranetDetail.xsl     |   15 +++++++++++++++
 .../prog/en/xslt/MARC21slim2OPACDetail.xsl         |   16 ++++++++++++++++
 .../prog/en/xslt/MARC21slim2OPACResults.xsl        |   11 +++++++++++
 3 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
index 6c640b2..5655437 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
@@ -403,6 +403,21 @@
         </span>
        </xsl:if>
 
+        <xsl:if test="marc:datafield[@tag=242]">
+        <span class="results_summary translated_title"><span class="label">Title translated: </span>
+            <xsl:for-each select="marc:datafield[@tag=242]">
+                <xsl:call-template name="chopPunctuation">
+                  <xsl:with-param name="chopString">
+                    <xsl:call-template name="subfieldSelect">
+                        <xsl:with-param name="codes">abchnp</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>
+
         <!-- Uniform Title  Statement: Alternate Graphic Representation (MARC 880) -->
         <xsl:if test="$display880">
             <xsl:call-template name="m880Select">
diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
index 2d88880..9773831 100755
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
@@ -462,6 +462,22 @@
         </span>
        </xsl:if>
 
+
+        <xsl:if test="marc:datafield[@tag=242]">
+        <span class="results_summary translated_title"><span class="label">Title translated: </span>
+            <xsl:for-each select="marc:datafield[@tag=242]">
+                <xsl:call-template name="chopPunctuation">
+                  <xsl:with-param name="chopString">
+                    <xsl:call-template name="subfieldSelect">
+                        <xsl:with-param name="codes">abchnp</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>
+
         <!-- Uniform Title  Statement: Alternate Graphic Representation (MARC 880) -->
         <xsl:if test="$display880">
             <xsl:call-template name="m880Select">
diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
index 9c6c307..d742a29 100644
--- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
+++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
@@ -904,6 +904,17 @@
             </xsl:for-each>
 	</span>
     </xsl:if>
+    <xsl:if test="marc:datafield[@tag=242]">
+	<span class="results_summary">
+    <span class="label">Title translated: </span>
+            <xsl:for-each select="marc:datafield[@tag=242]">
+                    <xsl:call-template name="subfieldSelect">
+                        <xsl:with-param name="codes">abh</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=856]">
          <span class="results_summary">
 			   <span class="label">Online Access: </span>
-- 
1.7.2.5



More information about the Koha-patches mailing list