Browse Source

Bug 15141: Add MARC21 770/772 Supplement (parent) to OPAC and staff detail pages

Adds the 2 corresponding linking fields to the staff and OPAC detail pages:

770 - Supplement/Special Issue Entry (R)
https://www.loc.gov/marc/bibliographic/bd770.html

772 - Supplement Parent Entry (R)
https://www.loc.gov/marc/bibliographic/bd772.html

To test:
- Catalog records with 770/772 in Koha, examples can be found in the LOC
  documentation.
  - When UseControlNumber is set to Use and $w is added, a link will be built using $w
  - If there is no $w or UseControlNumber is Don't use, a link will be build using the title
- Verify that they display nicely in the OPAC and staff detail pages

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Katrin Fischer 4 years ago
committed by Jonathan Druart
parent
commit
42ab7b80d4
  1. 84
      koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
  2. 85
      koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl

84
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl

@ -1145,6 +1145,90 @@
</span>
</xsl:if>
<!-- 770 - Supplement/Special issue entry -->
<xsl:if test="marc:datafield[@tag=770]">
<span class="results_summary supplement"><span class="label">Supplement: </span>
<xsl:for-each select="marc:datafield[@tag=770]">
<xsl:if test="marc:subfield[@code='i']">
<span class="770_rel_info">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">i</xsl:with-param>
</xsl:call-template>
<xsl:text> </xsl:text>
</span>
</xsl:if>
<a>
<xsl:choose>
<xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
<xsl:attribute name="href">
/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='t'], '()', ''),true())"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="marc:subfield[@code='a'] or marc:subfield[@code='t']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">a_t</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</a>
<xsl:text> </xsl:text>
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">bdghkmnr9usxyz</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="position()=last()"></xsl:when>
<xsl:otherwise><span class="separator"> | </span></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</span>
</xsl:if>
<!-- 772 - Supplement parent entry -->
<xsl:if test="marc:datafield[@tag=772]">
<span class="results_summary supplement_parent"><span class="label">Supplement to: </span>
<xsl:for-each select="marc:datafield[@tag=772]">
<xsl:if test="marc:subfield[@code='i']">
<span class="772_rel_info">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">i</xsl:with-param>
</xsl:call-template>
<xsl:text> </xsl:text>
</span>
</xsl:if>
<a>
<xsl:choose>
<xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
<xsl:attribute name="href">
/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='t'], '()', ''),true())"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="marc:subfield[@code='a'] or marc:subfield[@code='t']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">a_t</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</a>
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">bdghkmnr9usxyz</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="position()=last()"></xsl:when>
<xsl:otherwise><span class="separator"> | </span></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</span>
</xsl:if>
<!-- 775 Other Edition -->
<xsl:if test="marc:datafield[@tag=775]">

85
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl

@ -1260,6 +1260,91 @@
</span>
</xsl:if>
<!-- 770 - Supplement/Special issue entry -->
<xsl:if test="marc:datafield[@tag=770]">
<span class="results_summary supplement"><span class="label">Supplement: </span>
<xsl:for-each select="marc:datafield[@tag=770]">
<xsl:if test="marc:subfield[@code='i']">
<span class="770_rel_info">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">i</xsl:with-param>
</xsl:call-template>
<xsl:text> </xsl:text>
</span>
</xsl:if>
<a>
<xsl:choose>
<xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
<xsl:attribute name="href">
/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='t'], '()', ''),true())"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="marc:subfield[@code='a'] or marc:subfield[@code='t']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">a_t</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</a>
<xsl:text> </xsl:text>
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">bdghkmnr9usxyz</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="position()=last()"></xsl:when>
<xsl:otherwise><span class="separator"> | </span></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</span>
</xsl:if>
<!-- 772 - Supplement parent entry -->
<xsl:if test="marc:datafield[@tag=772]">
<span class="results_summary supplement_parent"><span class="label">Supplement to: </span>
<xsl:for-each select="marc:datafield[@tag=772]">
<xsl:if test="marc:subfield[@code='i']">
<span class="772_rel_info">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">i</xsl:with-param>
</xsl:call-template>
<xsl:text> </xsl:text>
</span>
</xsl:if>
<a>
<xsl:choose>
<xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
<xsl:attribute name="href">
/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:subfield[@code='t'], '()', ''),true())"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="marc:subfield[@code='a'] or marc:subfield[@code='t']">
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">a_t</xsl:with-param>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</a>
<xsl:call-template name="subfieldSelect">
<xsl:with-param name="codes">bdghkmnr9usxyz</xsl:with-param>
</xsl:call-template>
<xsl:choose>
<xsl:when test="position()=last()"></xsl:when>
<xsl:otherwise><span class="separator"> | </span></xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</span>
</xsl:if>
<!-- 775 Other Edition -->
<xsl:if test="marc:datafield[@tag=775]">
<span class="results_summary other_editions"><span class="label">Other editions: </span>

Loading…
Cancel
Save