Bugzilla – Attachment 109184 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: OPAC XSLT Results: List variable number of itemcallnumbers
Bug-26302-OPAC-XSLT-Results-List-variable-number-o.patch (text/plain), 9.37 KB, created by
Marcel de Rooy
on 2020-08-26 14:56:24 UTC
(
hide
)
Description:
Bug 26302: OPAC XSLT Results: List variable number of itemcallnumbers
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-08-26 14:56:24 UTC
Size:
9.37 KB
patch
obsolete
>From 8e04e4f155781a476f34c96589d7eca33a846204 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 26 Aug 2020 13:49:53 +0000 >Subject: [PATCH] Bug 26302: OPAC XSLT Results: List variable number of > itemcallnumbers >Content-Type: text/plain; charset=utf-8 > >We define a local preference resultsMaxItems and add it to the xml >passed to the results XSLT (in C4::XSLT). >Instead of showing one item, we add this number of items for the >available for loan and reference segments. > >Test plan: >Play with the value of local pref resultsMaxItems. >Check if it matches with displayed callnumbers. >Try home and holdingbranch for results location. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/XSLT.pm | 2 ++ > .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 41 +++++++++++++++++----- > 2 files changed, 35 insertions(+), 8 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index a3053bde23..dd2b0a851c 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -173,9 +173,11 @@ sub get_xslt_sysprefs { > TrackClicks opacthemes IdRef OpacSuppression > OPACResultsLibrary OPACShowOpenURL > OpenURLResolverURL OpenURLImageLocation >+ resultsMaxItems > 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 8ecbf32025..987fe8f389 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -37,6 +37,7 @@ > <xsl:variable name="singleBranchMode" select="1"/> > <xsl:variable name="OPACTrackClicks" select="marc:sysprefs/marc:syspref[@name='TrackClicks']"/> > <xsl:variable name="BiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='BiblioDefaultView']"/> >+ <xsl:variable name="resultsMaxItems" select="marc:sysprefs/marc:syspref[@name='resultsMaxItems']"/> > <xsl:variable name="leader" select="marc:leader"/> > <xsl:variable name="leader6" select="substring($leader,7,1)"/> > <xsl:variable name="leader7" select="substring($leader,8,1)"/> >@@ -1255,7 +1256,13 @@ > <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> > <span class="CallNumberAndLabel"> > <span class="LabelCallNumber">Call number: </span> >- <span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/><xsl:if test="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))>1"><xsl:text>, ..</xsl:text></xsl:if></span> >+ <span class="CallNumber"> >+ <xsl:for-each select="$available_items[position() <= $resultsMaxItems]"> >+ <xsl:value-of select="items:itemcallnumber"/> >+ <xsl:if test="position()!=last()"><xsl:text>, </xsl:text></xsl:if> >+ </xsl:for-each> >+ <xsl:if test="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))>$resultsMaxItems"><xsl:text>, ..</xsl:text></xsl:if> >+ </span> > </span> > </xsl:if> > <xsl:choose> >@@ -1275,10 +1282,16 @@ > <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'"> >- <span class="CallNumberAndLabel"> >+ <span class="CallNumberAndLabel"> > <span class="LabelCallNumber">Call number: </span> >- <span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/><xsl:if test="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))>1"><xsl:text>, ..</xsl:text></xsl:if></span> >- </span> >+ <span class="CallNumber"> >+ <xsl:for-each select="$available_items[position() <= $resultsMaxItems]"> >+ <xsl:value-of select="items:itemcallnumber"/> >+ <xsl:if test="position()!=last()"><xsl:text>, </xsl:text></xsl:if> >+ </xsl:for-each> >+ <xsl:if test="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))>$resultsMaxItems"><xsl:text>, ..</xsl:text></xsl:if> >+ </span> >+ </span> > </xsl:if> > <xsl:choose> > <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when> >@@ -1295,10 +1308,16 @@ > <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'"> >- <span class="CallNumberAndLabel"> >+ <span class="CallNumberAndLabel"> > <span class="LabelCallNumber">Call number: </span> >- <span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/><xsl:if test="count(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch)))>1"><xsl:text>, ..</xsl:text></xsl:if></span> >- </span> >+ <span class="CallNumber"> >+ <xsl:for-each select="$available_items[position() <= $resultsMaxItems]"> >+ <xsl:value-of select="items:itemcallnumber"/> >+ <xsl:if test="position()!=last()"><xsl:text>, </xsl:text></xsl:if> >+ </xsl:for-each> >+ <xsl:if test="count(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch)))>$resultsMaxItems"><xsl:text>, ..</xsl:text></xsl:if> >+ </span> >+ </span> > </xsl:if> > <xsl:choose> > <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when> >@@ -1335,7 +1354,13 @@ > <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> > <span class="CallNumberAndLabel"> > <span class="LabelCallNumber">Call number: </span> >- <span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/><xsl:if test="count(key('item-by-substatus-and-branch', concat(items:substatus, ' ', items:homebranch)))>1"><xsl:text>, ..</xsl:text></xsl:if></span> >+ <span class="CallNumber"> >+ <xsl:for-each select="$reference_items[position() <= $resultsMaxItems]"> >+ <xsl:value-of select="items:itemcallnumber"/> >+ <xsl:if test="position()!=last()"><xsl:text>, </xsl:text></xsl:if> >+ </xsl:for-each> >+ <xsl:if test="count(key('item-by-substatus-and-branch', concat(items:substatus, ' ', items:homebranch)))>$resultsMaxItems"><xsl:text>, ..</xsl:text></xsl:if> >+ </span> > </span> > </xsl:if> > <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose> >-- >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 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