Bugzilla – Attachment 126032 Details for
Bug 28831
OPAC XSLT Results: Allow unavailable item grouping on status only for large consortia
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28831: Add choose/when, and change indentation
Bug-28831-Add-choosewhen-and-change-indentation.patch (text/plain), 8.64 KB, created by
Marcel de Rooy
on 2021-10-11 09:04:42 UTC
(
hide
)
Description:
Bug 28831: Add choose/when, and change indentation
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-10-11 09:04:42 UTC
Size:
8.64 KB
patch
obsolete
>From f765e197ebdc05c94253701abe06f37ca1037aa6 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 9 Sep 2021 08:56:07 +0000 >Subject: [PATCH] Bug 28831: Add choose/when, and change indentation >Content-Type: text/plain; charset=utf-8 > >As a first step: >[1] Add the new pref OPACResultsUnavailableGroupingBy in the xslt, > and pass it via C4/XSLT. >[2] Add a choose/when construction in the third part of Availability. >[3] Add indentation (8 spaces) of the inner block handling group by branch. > >Test plan: >Make sure that OPACResultsUnavailableGroupingBy eq branch. >Verify that OPAC results are still untouched. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/XSLT.pm | 2 +- > .../en/xslt/MARC21slim2OPACResults.xsl | 65 ++++++++++--------- > 2 files changed, 37 insertions(+), 30 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 864158714a..c7ed413d93 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -169,7 +169,7 @@ sub get_xslt_sysprefs { > TrackClicks opacthemes IdRef OpacSuppression > OPACResultsLibrary OPACShowOpenURL > OpenURLResolverURL OpenURLImageLocation >- OPACResultsMaxItems OPACResultsMaxItemsUnavailable >+ OPACResultsMaxItems OPACResultsMaxItemsUnavailable OPACResultsUnavailableGroupingBy > OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts / ) > { > my $sp = C4::Context->preference( $syspref ); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 72d7bc889d..8d0d010184 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -25,6 +25,7 @@ > > <xsl:variable name="OPACResultsMaxItems" select="number(marc:sysprefs/marc:syspref[@name='OPACResultsMaxItems']+0)"/> > <xsl:variable name="OPACResultsMaxItemsUnavailable" select="number(marc:sysprefs/marc:syspref[@name='OPACResultsMaxItemsUnavailable']+0)"/> >+ <xsl:variable name="OPACResultsUnavailableGroupingBy" select="marc:sysprefs/marc:syspref[@name='OPACResultsUnavailableGroupingBy']"/> > <xsl:variable name="UseControlNumber" select="marc:sysprefs/marc:syspref[@name='UseControlNumber']"/> > <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/> > <xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/> >@@ -1332,35 +1333,41 @@ > <status english="Waiting">On hold</status> > </xsl:variable> > <xsl:variable name="unavailable_items" select="key('item-by-status', 'reallynotforloan')|key('item-by-status', 'other')"/> >- <!-- First group by branch --> >- <xsl:for-each select="items:items/items:item[not(items:resultbranch=preceding-sibling::*/items:resultbranch)]"> >- <xsl:sort select="items:resultbranch"/> >- <xsl:variable name="currentbranch" select="items:resultbranch"/> >- <span class="ItemSummary unavailable"> >- <!-- Within same branch, group by substatus --> >- <xsl:for-each select="$unavailable_items[not(items:substatus=preceding-sibling::*[items:status='reallynotforloan' or items:status='other']/items:substatus)]"> >- <xsl:sort select="items:substatus"/> >- <xsl:variable name="current_substatus" select="items:substatus"/> >- <xsl:call-template name="listCallNumbers"> >- <xsl:with-param name="items" select="$unavailable_items[items:resultbranch=$currentbranch and items:substatus=$current_substatus]"/> >- <xsl:with-param name="max" select="$OPACResultsMaxItemsUnavailable"/> >- <xsl:with-param name="status_text"> >- <xsl:value-of select="$currentbranch"/> >- <xsl:text>: </xsl:text> >- <xsl:if test="items:status='other'"> >- <xsl:value-of select="exsl:node-set($other_status_list)/status[@english=$current_substatus]"/> >- </xsl:if> >- <xsl:if test="items:status='reallynotforloan'"> >- <xsl:value-of select="$current_substatus"/> >- </xsl:if> >- </xsl:with-param> >- <xsl:with-param name="class_block" select="concat('unavailable_',items:substatus)"/> >- <xsl:with-param name="class_status" select="'ItemBranch'"/> >- <xsl:with-param name="OPACItemLocation" select="$OPACItemLocation"/> >- </xsl:call-template> >- </xsl:for-each> >- </span> >- </xsl:for-each> >+ <xsl:choose> >+ <xsl:when test="$OPACResultsUnavailableGroupingBy='branch'"> >+ <!-- First group by branch --> >+ <xsl:for-each select="items:items/items:item[not(items:resultbranch=preceding-sibling::*/items:resultbranch)]"> >+ <xsl:sort select="items:resultbranch"/> >+ <xsl:variable name="currentbranch" select="items:resultbranch"/> >+ <span class="ItemSummary unavailable"> >+ <!-- Within same branch, group by substatus --> >+ <xsl:for-each select="$unavailable_items[not(items:substatus=preceding-sibling::*[items:status='reallynotforloan' or items:status='other']/items:substatus)]"> >+ <xsl:sort select="items:substatus"/> >+ <xsl:variable name="current_substatus" select="items:substatus"/> >+ <xsl:call-template name="listCallNumbers"> >+ <xsl:with-param name="items" select="$unavailable_items[items:resultbranch=$currentbranch and items:substatus=$current_substatus]"/> >+ <xsl:with-param name="max" select="$OPACResultsMaxItemsUnavailable"/> >+ <xsl:with-param name="status_text"> >+ <xsl:value-of select="$currentbranch"/> >+ <xsl:text>: </xsl:text> >+ <xsl:if test="items:status='other'"> >+ <xsl:value-of select="exsl:node-set($other_status_list)/status[@english=$current_substatus]"/> >+ </xsl:if> >+ <xsl:if test="items:status='reallynotforloan'"> >+ <xsl:value-of select="$current_substatus"/> >+ </xsl:if> >+ </xsl:with-param> >+ <xsl:with-param name="class_block" select="concat('unavailable_',items:substatus)"/> >+ <xsl:with-param name="class_status" select="'ItemBranch'"/> >+ <xsl:with-param name="OPACItemLocation" select="$OPACItemLocation"/> >+ </xsl:call-template> >+ </xsl:for-each> >+ </span> >+ </xsl:for-each> >+ </xsl:when> >+ <xsl:when test="$OPACResultsUnavailableGroupingBy='substatus'"> >+ </xsl:when> >+ </xsl:choose> > </span></xsl:if> > > </xsl:otherwise> >-- >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 28831
:
124688
|
124689
|
124690
|
124706
|
124707
|
124708
|
124804
|
124805
|
124806
|
125894
|
125895
|
125896
|
126031
| 126032 |
126033