Bugzilla – Attachment 123641 Details for
Bug 26302
OPAC XSLT Results: List variable number of itemcallnumbers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26302: (QA follow-up) Prevent empty call numbers
Bug-26302-QA-follow-up-Prevent-empty-call-numbers.patch (text/plain), 3.32 KB, created by
Marcel de Rooy
on 2021-08-09 12:02:33 UTC
(
hide
)
Description:
Bug 26302: (QA follow-up) Prevent empty call numbers
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-08-09 12:02:33 UTC
Size:
3.32 KB
patch
obsolete
>From df74ffc84b782eec48cd3287cec9846649d7c129 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 9 Aug 2021 11:55:11 +0000 >Subject: [PATCH] Bug 26302: (QA follow-up) Prevent empty call numbers >Content-Type: text/plain; charset=utf-8 > >This does not make the code easier, but here we go: > >Suppose resultsMaxItems == 2. >If we would normally list two call numbers like: > Liberty (2) [Call number: PERL F 1, PERL F 2]. >If one call number would be empty, we now list: > Liberty (2) [Call number: PERL F 1, ...]. >And when both are empty, we only show a number: > Liberty (2). > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index d2867e54fe..f220204a2b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1476,25 +1476,30 @@ > <xsl:text> (</xsl:text> > <xsl:value-of select="count($items)"/> > <xsl:text>)</xsl:text> >- <xsl:if test="$max>0 and $OPACItemLocation!='library'"> >+ <xsl:if test="$max>0 and count($items[items:itemcallnumber!=''])>0 and $OPACItemLocation!='library'"> > <span class="CallNumberAndLabel"> > <span class="LabelCallNumber"> > <xsl:if test="$OPACItemLocation='callnum'">Call number: </xsl:if> > <xsl:if test="$OPACItemLocation='ccode'">Collection code, call number: </xsl:if> > <xsl:if test="$OPACItemLocation='location'">Location, call number: </xsl:if> > </span> >+ <xsl:for-each select="$items[items:itemcallnumber!=''][position() <= $max]"> > <span class="CallNumber"> >- <xsl:for-each select="$items[position() <= $max]"> > <xsl:if test="$OPACItemLocation='location'"> > <strong><xsl:value-of select="concat(items:location,' ')"/></strong> > </xsl:if> > <xsl:if test="$OPACItemLocation='ccode'"> > <strong><xsl:value-of select="concat(items:ccode,' ')"/></strong> > </xsl:if> >- <xsl:value-of select="items:itemcallnumber"/><xsl:if test="position()!=last()"><xsl:text>, </xsl:text></xsl:if> >- </xsl:for-each> >- <xsl:if test="count($items)>$max"><xsl:text>, ..</xsl:text></xsl:if> >+ <xsl:value-of select="items:itemcallnumber"/> >+ <xsl:if test="position()!=last()"> >+ <xsl:text>, </xsl:text> >+ </xsl:if> >+ <xsl:if test="position()=last() and (count($items)>$max or count($items[items:itemcallnumber=''])>0)"> >+ <xsl:text>, ..</xsl:text> >+ </xsl:if> > </span> >+ </xsl:for-each> > </span> > </xsl:if> > <xsl:text>. </xsl:text> >-- >2.20.1
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 26302
:
109184
|
119108
|
119109
|
119110
|
119111
|
122386
|
122387
|
122388
|
122389
|
122391
|
122462
|
122463
|
122464
|
122465
|
122466
|
122487
|
123499
|
123500
|
123501
|
123502
|
123526
|
123527
|
123528
|
123529
|
123531
|
123532
|
123533
|
123534
|
123640
|
123641
|
123643
|
123644
|
123645
|
123646
|
123647
|
123648
|
123649
|
124243
|
124244
|
124245