Bugzilla – Attachment 180475 Details for
Bug 34025
Uniform titles (130 / 240 /730) in biblio to link to authority file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34025: Make more controlled fields linkable (130, 240, 730 + 7XX $a + $t) [XSLT]
Bug-34025-Make-more-controlled-fields-linkable-130.patch (text/plain), 17.19 KB, created by
Janusz Kaczmarek
on 2025-04-03 09:30:19 UTC
(
hide
)
Description:
Bug 34025: Make more controlled fields linkable (130, 240, 730 + 7XX $a + $t) [XSLT]
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2025-04-03 09:30:19 UTC
Size:
17.19 KB
patch
obsolete
>From 0f2bd80ad6afe22f4bfa35d446519282159d7ec8 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Thu, 3 Apr 2025 09:11:32 +0000 >Subject: [PATCH] Bug 34025: Make more controlled fields linkable (130, 240, > 730 + 7XX $a + $t) [XSLT] > >MARC21 contain linking fields (130, 240, 730 + 7XX $a + $t) that currently >currently are not 'clickable'. This patch adds the links, similarly to the links >created for contributors', both in OPAC and staff interface. > >Test plan: >========== >1. Add some 130, 240, 730 + 7XX $a + $t fields to a record. Note that 730 > and 7XX $a + $t fields have to have 2nd indicator set to 2. > You can link the fields to authority records. >2. Not that the information displayed from these fields is not > 'clickable' neither in OPAC, nor in the staff interface. >3. Apply the patch ; restart all. >4. You should be able to see and use the links now. If the fields are > linked to authotiry record and UseAuthoritiesForTracings > systempreference is set, the search will be performed with > authid identifier. There should be also a magnifying glass icon > with a link to the authority record. >--- > .../en/xslt/MARC21slim2intranetDetail.xsl | 82 +++++++++++++++- > .../en/xslt/MARC21slim2OPACDetail.xsl | 97 +++++++++++++++++-- > 2 files changed, 169 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index 839f358a9c..770fb00f35 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -549,21 +549,55 @@ > </xsl:call-template> > </xsl:if> > >- <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]"> >+ <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: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> >+ <a> >+ <xsl:choose> >+ <xsl:when >+ test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >+ <xsl:attribute name="href"> >+ <xsl:text>/cgi-bin/koha/catalogue/search.pl?q=an:</xsl:text> >+ <xsl:value-of >+ select="str:encode-uri(marc:subfield[@code=9], true())" /> >+ <xsl:if test="$AuthorLinkSortBy!='default'"> >+ <xsl:text>&sort_by=</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortBy" /> >+ <xsl:text>_</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortOrder" /> >+ </xsl:if> >+ </xsl:attribute> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:attribute name="href"> >+ <xsl:text>/cgi-bin/koha/catalogue/search.pl?q=au:"</xsl:text> >+ <xsl:value-of >+ select="str:encode-uri(marc:subfield[@code='a'], true())" /> >+ <xsl:text>"</xsl:text> >+ </xsl:attribute> >+ </xsl:otherwise> >+ </xsl:choose> > <xsl:for-each select="marc:subfield"> > <xsl:if test="contains('adfghklmnoprst',@code)"> > <xsl:value-of select="text()"/> > <xsl:text> </xsl:text> > </xsl:if> > </xsl:for-each> >+ </a> >+ <xsl:if test="marc:subfield[@code=9]"> >+ <xsl:call-template name="showAuthlink"> >+ <xsl:with-param name="authid"> >+ <xsl:value-of >+ select="str:encode-uri(marc:subfield[@code=9], true())" /> >+ </xsl:with-param> >+ </xsl:call-template> >+ </xsl:if> > <xsl:if test="position() != last()"> > <span class="separator"><xsl:text> | </xsl:text></span> > </xsl:if> >@@ -617,6 +651,39 @@ > <xsl:if test="marc:datafield[@tag=700][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=710][@ind2=2 and not(marc:subfield[@code='i'])] or marc:datafield[@tag=711][@ind2=2 and not(marc:subfield[@code='i'])]"> > <span class="results_summary contained_works"><span class="label">Contained works: </span> > <xsl:for-each select="marc:datafield[@tag=700][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=710][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=711][@ind2=2][not(marc:subfield[@code='i'])]"> >+ >+ <a> >+ <xsl:choose> >+ <xsl:when >+ test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >+ <xsl:attribute name="href"> >+ <xsl:text>/cgi-bin/koha/catalogue/search.pl?q=an:</xsl:text> >+ <xsl:value-of >+ select="str:encode-uri(marc:subfield[@code=9], true())" /> >+ <xsl:if test="$AuthorLinkSortBy!='default'"> >+ <xsl:text>&sort_by=</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortBy" /> >+ <xsl:text>_</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortOrder" /> >+ </xsl:if> >+ </xsl:attribute> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:attribute name="href"> >+ <xsl:text>/cgi-bin/koha/catalogue/search.pl?q=au:"</xsl:text> >+ <xsl:value-of >+ select="str:encode-uri(marc:subfield[@code='a'], true())" /> >+ <xsl:text>"</xsl:text> >+ <xsl:if test="$AuthorLinkSortBy!='default'"> >+ <xsl:text>&sort_by=</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortBy" /> >+ <xsl:text>_</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortOrder" /> >+ </xsl:if> >+ </xsl:attribute> >+ </xsl:otherwise> >+ </xsl:choose> >+ > <xsl:variable name="str"> > <xsl:call-template name="subfieldSelect"> > <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param> >@@ -648,6 +715,17 @@ > <xsl:text>]</xsl:text> > </span> > </xsl:if> >+ >+ </a> >+ <xsl:if test="marc:subfield[@code=9]"> >+ <xsl:call-template name="showAuthlink"> >+ <xsl:with-param name="authid"> >+ <xsl:value-of >+ select="str:encode-uri(marc:subfield[@code=9], true())" /> >+ </xsl:with-param> >+ </xsl:call-template> >+ </xsl:if> >+ > <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> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index b5b07f3ee8..8361875491 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -654,11 +654,11 @@ > </span> > </xsl:if> > >- <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]"> >+ <xsl:if test="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2=2]"> > <span class="results_summary uniform_titles"> > <span class="label">Uniform titles: </span> > <ul class="resource_list"> >- <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2!=2]"> >+ <xsl:for-each select="marc:datafield[@tag=130]|marc:datafield[@tag=240]|marc:datafield[@tag=730][@ind2=2]"> > <li> > <span property="alternateName"> > <xsl:if test="marc:subfield[@code='i']"> >@@ -667,12 +667,47 @@ > </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()"/> >- <xsl:text> </xsl:text> >- </xsl:if> >- </xsl:for-each> >+ >+ <a> >+ <xsl:choose> >+ <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >+ <xsl:attribute name="href"> >+ <xsl:text>/cgi-bin/koha/opac-search.pl?q=an:</xsl:text> >+ <xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/> >+ </xsl:attribute> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:attribute name="href"> >+ <xsl:text>/cgi-bin/koha/opac-search.pl?q=au:"</xsl:text> >+ <xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/> >+ <xsl:text>"</xsl:text> >+ <xsl:if test="$AuthorLinkSortBy!='default'"> >+ <xsl:text>&sort_by=</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortBy"/> >+ <xsl:text>_</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortOrder" /> >+ </xsl:if> >+ </xsl:attribute> >+ </xsl:otherwise> >+ </xsl:choose> >+ >+ <xsl:for-each select="marc:subfield"> >+ <xsl:if test="contains('adfghklmnoprst',@code)"> >+ <xsl:value-of select="text()"/> >+ <xsl:text> </xsl:text> >+ </xsl:if> >+ </xsl:for-each> >+ </a> >+ >+ <xsl:if test="marc:subfield[@code=9]"> >+ <a class='authlink'> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> >+ <xsl:element name="i"> >+ <xsl:attribute name="class">fa fa-search</xsl:attribute> >+ </xsl:element> >+ </a> >+ </xsl:if> >+ > </span> > </li> > </xsl:for-each> >@@ -732,6 +767,39 @@ > <ul class="resource_list"> > <xsl:for-each select="marc:datafield[@tag=700][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=710][@ind2=2][not(marc:subfield[@code='i'])] | marc:datafield[@tag=711][@ind2=2][not(marc:subfield[@code='i'])]"> > <li> >+ >+ <a> >+ <xsl:choose> >+ <xsl:when >+ test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >+ <xsl:attribute name="href"> >+ <xsl:text>/cgi-bin/koha/opac-search.pl?q=an:</xsl:text> >+ <xsl:value-of >+ select="str:encode-uri(marc:subfield[@code=9], true())" /> >+ <xsl:if test="$AuthorLinkSortBy!='default'"> >+ <xsl:text>&sort_by=</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortBy" /> >+ <xsl:text>_</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortOrder" /> >+ </xsl:if> >+ </xsl:attribute> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:attribute name="href"> >+ <xsl:text>/cgi-bin/koha/opac-search.pl?q=au:"</xsl:text> >+ <xsl:value-of >+ select="str:encode-uri(marc:subfield[@code='a'], true())" /> >+ <xsl:text>"</xsl:text> >+ <xsl:if test="$AuthorLinkSortBy!='default'"> >+ <xsl:text>&sort_by=</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortBy" /> >+ <xsl:text>_</xsl:text> >+ <xsl:value-of select="$AuthorLinkSortOrder" /> >+ </xsl:if> >+ </xsl:attribute> >+ </xsl:otherwise> >+ </xsl:choose> >+ > <xsl:variable name="str"> > <xsl:call-template name="subfieldSelect"> > <xsl:with-param name="codes">abcdfghiklmnporstux</xsl:with-param> >@@ -763,6 +831,19 @@ > <xsl:text>]</xsl:text> > </span> > </xsl:if> >+ >+ </a> >+ <xsl:if test="marc:subfield[@code=9]"> >+ <a class='authlink'> >+ <xsl:attribute name="href"> >+ /cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of >+ select="str:encode-uri(marc:subfield[@code=9], true())" /></xsl:attribute> >+ <xsl:element name="i"> >+ <xsl:attribute name="class">fa fa-search</xsl:attribute> >+ </xsl:element> >+ </a> >+ </xsl:if> >+ > </li> > </xsl:for-each> > </ul> >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34025
:
152389
| 180475