Bugzilla – Attachment 122487 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: (follow-up) Handle zero callnumbers-case
Bug-26302-follow-up-Handle-zero-callnumbers-case.patch (text/plain), 5.23 KB, created by
Marcel de Rooy
on 2021-06-29 12:27:21 UTC
(
hide
)
Description:
Bug 26302: (follow-up) Handle zero callnumbers-case
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-06-29 12:27:21 UTC
Size:
5.23 KB
patch
obsolete
>From df5684379d3122f3ebb4b660ae1ea2d1977a6c8e Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 29 Jun 2021 12:22:18 +0000 >Subject: [PATCH] Bug 26302: (follow-up) Handle zero callnumbers-case >Content-Type: text/plain; charset=utf-8 > >As David observed while testing, we should differentiate between >the pref value 1 and 0 (or undef). >This patch does no longer convert the value to 1 as default. >And it removes an empty [ Call number: ] suffix. > >Test plan: >Set resultsMaxItems or ..Unavailable to zero and check search results. >Verify that you see something like: > Availability: Items available for loan: Centerville (3) . Items available for reference: Centerville Staff Collection (1) . Not available: TEST (2). MOVING (1). Withdrawn (2). > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/XSLT.pm | 1 - > .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 8 ++++---- > 2 files changed, 4 insertions(+), 5 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 716bdc10c5..3d0ac08270 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -177,7 +177,6 @@ sub get_xslt_sysprefs { > OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts / ) > { > my $sp = C4::Context->preference( $syspref ); >- $sp ||= 1 if $syspref eq 'resultsMaxItems'; # needs default > next unless defined($sp); > $sysxml .= "<syspref name=\"$syspref\">$sp</syspref>\n"; > } >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 35b3eeb3e4..96142b5785 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1281,7 +1281,7 @@ > <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> > <span class="ItemSummary"> > <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/><xsl:text> </xsl:text> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> >+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum' and $resultsMaxItems > 0"> > <span class="CallNumberAndLabel"> > <span class="LabelCallNumber">Call number: </span> > <span class="CallNumber"> >@@ -1309,7 +1309,7 @@ > <xsl:text> (</xsl:text> > <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/> > <xsl:text>) </xsl:text> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> >+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum' and $resultsMaxItems > 0"> > <span class="CallNumberAndLabel"> > <span class="LabelCallNumber">Call number: </span> > <span class="CallNumber"> >@@ -1335,7 +1335,7 @@ > <xsl:text> (</xsl:text> > <xsl:value-of select="count(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch)))"/> > <xsl:text>) </xsl:text> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> >+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum' and $resultsMaxItems > 0"> > <span class="CallNumberAndLabel"> > <span class="LabelCallNumber">Call number: </span> > <span class="CallNumber"> >@@ -1379,7 +1379,7 @@ > <xsl:text> (</xsl:text> > <xsl:value-of select="count(key('item-by-substatus-and-branch', concat(items:substatus, ' ', items:homebranch)))"/> > <xsl:text>) </xsl:text> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> >+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum' and $resultsMaxItems > 0"> > <span class="CallNumberAndLabel"> > <span class="LabelCallNumber">Call number: </span> > <span class="CallNumber"> >-- >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