]> git.koha-community.org Git - koha.git/commit
Bug 35305: Add XSLT for authority details page in staff interface
authorFridolin Somers <fridolin.somers@biblibre.com>
Thu, 9 Nov 2023 21:20:43 +0000 (11:20 -1000)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Wed, 30 Oct 2024 06:47:49 +0000 (07:47 +0100)
commitdec81e0968acb628c0f91b308613f0595343fa81
treeb17e37c7c37083b0fd85d14d7e97989771ead6c6
parentc2cc6869dd1730168bc1c13bb3e0dcaac89395bb
Bug 35305: Add XSLT for authority details page in staff interface

This adds a new system preference 'AuthorityXSLTDetailsDisplay'.
If set, authority MARCXML will be transformed using the XSLT
at the given filename or URL.
The HTML output will be displayed in place of tabs in details page.

The syspref value can contain {langcode} and {authtypecode} which will
be replaced by the appropriate value (resp. current language and
authority type code).

Test plan:
1) Apply patch and run updatedatabase
2) Search for an authority type GEOGR_NAME and view details page
3) Verify that display is not affected yet
4) Create an XSLT file (for example in /home/koha/xslt/en/GEOGR_NAME.xsl)
5) Set 'AuthorityXSLTDetailsDisplay' system preference to :
   /home/koha/xslt/{langcode}/{authtypecode}.xsl
6) Refresh details page
7) Verify that display matches what you expect from the XSLT
8) Set 'AuthorityXSLTDetailsDisplay' system preference to :
   <path to sources>/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCauthDetails.xsl
8) Refresh details page
9) Verify that display matches what you expect from your XSLT

Example of a minimal XSLT:

<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 xmlns:marc="http://www.loc.gov/MARC21/slim"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output omit-xml-declaration="yes"/>
  <xsl:template match="marc:record">
    <xsl:element name="div">
      <xsl:attribute name="class">
        <xsl:text>authority-summary</xsl:text>
      </xsl:attribute>
      <xsl:value-of select="marc:datafield[@tag='151']/marc:subfield[@code='a']"/>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
authorities/detail.pl
installer/data/mysql/atomicupdate/bug_35305.pl [new file with mode: 0755]
installer/data/mysql/mandatory/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt