Bugzilla – Attachment 109267 Details for
Bug 15851
Only display "Analytics: Show analytics" when records have linked analytics
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15851: Display analytics links for more cases
Bug-15851-Display-analytics-links-for-more-cases.patch (text/plain), 4.34 KB, created by
Katrin Fischer
on 2020-08-27 22:24:25 UTC
(
hide
)
Description:
Bug 15851: Display analytics links for more cases
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-08-27 22:24:25 UTC
Size:
4.34 KB
patch
obsolete
>From dbdd982e5cd153f2eba61e4b0b9e27faaf29b2cb Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 24 Jun 2020 13:08:25 -0300 >Subject: [PATCH] Bug 15851: Display analytics links for more cases > >The current XSLT displays the link to linked analytics only for serials. >This patch makes it show for all the relevant position 7 on the leader >values. I left out a and b as recommended by expert librarians on my >team, but I can revert that if required. > >The current implementation adds a new CSS class for each case, so >libraries willing to keep the current behaviour or just have more >granular control on the cases they want the link to display, just can. > >This patch makes sense with the follow-up one, which will display the >link only if there are really related records. > >To test: >1. Open a non-serial record, notice there's no link to analytics >2. Apply this patch and reload >=> SUCCESS: There's an 'Analytics' link >3. Inspect the produced HTML >=> SUCCESS: A special class with analytic_* value has been added, and >thus we now can control its display through CSS >4. Sign off :-D > >Sponsored-by: Orex Digital > >Signed-off-by: Hugo Agud <hagud@orex.es> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../bootstrap/en/xslt/MARC21slim2OPACDetail.xsl | 35 +++++++++++++++------- > 1 file changed, 24 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index 8286a94fc4..b2d2c67cc5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -339,22 +339,35 @@ > </span> > </xsl:if> > >- <!-- Analytics --> >- <xsl:if test="$leader7='s'"> >- <span class="results_summary analytics"><span class="label">Analytics: </span> >+ <!-- Analytics information --> >+ <xsl:variable name="leader7_class"> >+ <xsl:choose> >+ <!--xsl:when test="$leader7='a'">analytic_mcp</xsl:when--> >+ <!--xsl:when test="$leader7='b'">analytic_scp</xsl:when--> >+ <xsl:when test="$leader7='c'">analytic_collection</xsl:when> >+ <xsl:when test="$leader7='d'">analytic_subunit</xsl:when> >+ <xsl:when test="$leader7='i'">analytic_ires</xsl:when> >+ <xsl:when test="$leader7='m'">analytic_monograph</xsl:when> >+ <xsl:when test="$leader7='s'">analytic_serial</xsl:when> >+ <xsl:otherwise>analytic_undefined</xsl:otherwise> >+ </xsl:choose> >+ </xsl:variable> >+ >+ <xsl:element name="span"> >+ <xsl:attribute name="class">results_summary analytics <xsl:value-of select="$leader7_class"/></xsl:attribute> >+ <span class="label">Analytics: </span> > <a> > <xsl:choose> >- <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]"> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute> >- </xsl:when> >- <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute> >- </xsl:otherwise> >+ <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]"> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Host-item:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute> >+ </xsl:otherwise> > </xsl:choose> > <xsl:text>Show analytics</xsl:text> > </a> >- </span> >- </xsl:if> >+ </xsl:element> > > <!-- Volumes of sets and traced series --> > <xsl:if test="$materialTypeCode='ST' or substring($controlField008,22,1)='m'"> >-- >2.11.0
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 15851
:
66593
|
106260
|
106261
|
106821
|
106822
|
106988
|
106989
|
106990
|
108049
|
108050
|
108051
|
109267
|
109268
|
109269
|
109459
|
109460
|
109461
|
109462