Bugzilla – Attachment 97257 Details for
Bug 24352
Wrong labels displaying in result list with OpacItemLocation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24352: OpacItemLocation is buggy
Bug-24352-OpacItemLocation-is-buggy.patch (text/plain), 11.14 KB, created by
David Nind
on 2020-01-11 23:16:10 UTC
(
hide
)
Description:
Bug 24352: OpacItemLocation is buggy
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-01-11 23:16:10 UTC
Size:
11.14 KB
patch
obsolete
>From b143a3a500632c8659f31f9c76bcda30d90c7bdc Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 10 Jan 2020 14:10:23 +0000 >Subject: [PATCH] Bug 24352: OpacItemLocation is buggy > >This patch modifies the OPAC's MARC21 search results XSLT so that the >OpacItemLocation preference correctly controls what information >displays. Previously the code for distinguishing between the 'location' >and 'collection' settings was combined. > >To test, apply the patch and set the OPACXSLTResultsDisplay system >preference to 'default.' > >Set the OpacItemLocation preference to 'call number only.' > - On the OPAC search results page, each result with items should show > information in this format: > - "Availability: Items available for loan: {library} [Call number: > {call number} ] > > With the OpacItemLocation preference set to 'collection code,' > - "Availability: Items available for loan: {library} > Collection(s): {collection description} [{ call number }]" > > With the OpacItemLocation preference set to 'location,' > - "Availability: Items available for loan: {library} > Location(s): {shelving location} [{ call number }]" > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 132 +++++++++++++++------ > 1 file changed, 97 insertions(+), 35 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 14f8b17144..f42359194d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1384,41 +1384,103 @@ > <xsl:text>). </xsl:text> </span> > </xsl:if> > </span> >- <xsl:choose> >- <xsl:when test="($OPACItemLocation='location' or $OPACItemLocation='ccode') and (count(key('item-by-status', 'available'))!=0 or count(key('item-by-status', 'reference'))!=0)"> >- <span class="results_summary location"> >- <span class="label">Location(s): </span> >- <xsl:choose> >- <xsl:when test="count(key('item-by-status', 'available'))>0"> >- <span class="available"> >- <xsl:variable name="available_items" select="key('item-by-status', 'available')"/> >- <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >- <xsl:choose> >- <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when> >- <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when> >- </xsl:choose> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"><span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/></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> >- </xsl:for-each> >- </span> >- </xsl:when> >- <xsl:when test="count(key('item-by-status', 'reference'))>0"> >- <span class="available"> >- <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/> >- <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >- <xsl:choose> >- <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when> >- <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when> >- </xsl:choose> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"><span class="CallNumber"><xsl:value-of select="items:itemcallnumber"/></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> >- </xsl:for-each> >- </span> >- </xsl:when> >- </xsl:choose> >- </span> >- </xsl:when> >- </xsl:choose> >+ >+ <xsl:choose> >+ <xsl:when test="$OPACItemLocation='location' and (count(key('item-by-status', 'available'))!=0 or count(key('item-by-status', 'reference'))!=0)"> >+ <span class="results_summary location"> >+ <span class="label">Location(s): </span> >+ <xsl:choose> >+ <xsl:when test="count(key('item-by-status', 'available'))>0"> >+ <span class="available"> >+ <xsl:variable name="available_items" select="key('item-by-status', 'available')"/> >+ <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >+ <b><xsl:value-of select="concat(items:location,' ')"/></b> >+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> >+ <span class="CallNumber">[<xsl:value-of select="items:itemcallnumber"/>]</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> >+ </xsl:for-each> >+ </span> >+ </xsl:when> >+ <xsl:when test="count(key('item-by-status', 'reference'))>0"> >+ <span class="available"> >+ <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/> >+ <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >+ <b><xsl:value-of select="concat(items:location,' ')"/></b> >+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> >+ <span class="CallNumber">[<xsl:value-of select="items:itemcallnumber"/>]</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> >+ </xsl:for-each> >+ </span> >+ </xsl:when> >+ </xsl:choose> >+ </span> >+ </xsl:when> >+ </xsl:choose> >+ >+ <xsl:choose> >+ <xsl:when test="$OPACItemLocation='ccode' and (count(key('item-by-status', 'available'))!=0 or count(key('item-by-status', 'reference'))!=0)"> >+ <span class="results_summary location"> >+ <span class="label">Collection(s): </span> >+ <xsl:choose> >+ <xsl:when test="count(key('item-by-status', 'available'))>0"> >+ <span class="available"> >+ <xsl:variable name="available_items" select="key('item-by-status', 'available')"/> >+ <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >+ <b><xsl:value-of select="concat(items:ccode,' ')"/></b> >+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> >+ <span class="CallNumber">[<xsl:value-of select="items:itemcallnumber"/>]</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> >+ </xsl:for-each> >+ </span> >+ </xsl:when> >+ <xsl:when test="count(key('item-by-status', 'reference'))>0"> >+ <span class="available"> >+ <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/> >+ <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >+ <b><xsl:value-of select="concat(items:ccode,' ')"/></b> >+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> >+ <span class="CallNumber">[<xsl:value-of select="items:itemcallnumber"/>]</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> >+ </xsl:for-each> >+ </span> >+ </xsl:when> >+ </xsl:choose> >+ </span> >+ </xsl:when> >+ </xsl:choose> >+ > </xsl:template> > > <xsl:template name="nameABCQ"> >-- >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 24352
:
97221
|
97225
|
97257
|
105931
|
105948
|
106171