Bugzilla – Attachment 52811 Details for
Bug 7441
Search results showing wrong branch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7441 - Followup search results showing wrong branch [UNIMARC]
Bug-7441---Followup-search-results-showing-wrong-b.patch (text/plain), 7.23 KB, created by
Jonathan Druart
on 2016-06-24 15:09:28 UTC
(
hide
)
Description:
Bug 7441 - Followup search results showing wrong branch [UNIMARC]
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-06-24 15:09:28 UTC
Size:
7.23 KB
patch
obsolete
>From 4dc44f6b358b7874523795f5df52d436f3e9b03a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 24 Jun 2016 16:08:23 +0100 >Subject: [PATCH] Bug 7441 - Followup search results showing wrong branch > [UNIMARC] > >--- > .../bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl | 58 +++++++++++++++------- > 1 file changed, 41 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl >index d72ad3f..3c97177 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl >@@ -11,7 +11,8 @@ > <xsl:import href="UNIMARCslimUtils.xsl"/> > <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/> > <xsl:key name="item-by-status" match="items:item" use="items:status"/> >-<xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/> >+<xsl:key name="item-by-status-and-branch-home" match="items:item" use="concat(items:status, ' ', items:homebranch)"/> >+<xsl:key name="item-by-status-and-branch-holding" match="items:item" use="concat(items:status, ' ', items:holdingbranch)"/> > > <xsl:template match="/"> > <xsl:apply-templates/> >@@ -25,6 +26,7 @@ > select="marc:datafield[@tag=090]/marc:subfield[@code='a']"/> > <xsl:variable name="isbn" > select="marc:datafield[@tag=010]/marc:subfield[@code='a']"/> >+ <xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/> > <xsl:variable name="BiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='BiblioDefaultView']"/> > <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/> > <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/> >@@ -146,31 +148,53 @@ > <xsl:variable name="available_items" select="key('item-by-status', 'available')"/> > <xsl:choose> > <xsl:when test="$singleBranchMode=1"> >- <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]"> >+ <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> > <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if> > <xsl:text> (</xsl:text> >- <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/> >+ <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/> > <xsl:text>)</xsl:text> > <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> > </xsl:when> > <xsl:otherwise> >- <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]"> >- <xsl:value-of select="items:homebranch"/> >- <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>] >- </xsl:if> >- <xsl:text> (</xsl:text> >- <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/> >- <xsl:text>)</xsl:text> >- <xsl:choose> >- <xsl:when test="position()=last()"> >- <xsl:text>. </xsl:text> >+ <xsl:choose> >+ <xsl:when test="$OPACResultsLibrary='homebranch'"> >+ <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >+ <xsl:value-of select="items:homebranch"/> >+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>] >+ </xsl:if> >+ <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: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> > </xsl:when> > <xsl:otherwise> >- <xsl:text>, </xsl:text> >+ <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]"> >+ <xsl:value-of select="items:holdingbranch"/> >+ <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>] >+ </xsl:if> >+ <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: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> > </xsl:otherwise> > </xsl:choose> >- </xsl:for-each> > </xsl:otherwise> > </xsl:choose> > </span> >@@ -182,13 +206,13 @@ > <b><xsl:text>Items available for reference: </xsl:text></b> > <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', concat(items:status, ' ', items:homebranch))[1])]"> >+ <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> > <xsl:if test="$singleBranchMode=0"> > <xsl:value-of select="items:homebranch"/> > </xsl:if> > <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]</xsl:if> > <xsl:text> (</xsl:text> >- <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/> >+ <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/> > <xsl:text>)</xsl:text> > <xsl:choose> > <xsl:when test="position()=last()"> >-- >2.8.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 7441
:
8656
|
8657
|
9700
|
9701
|
12550
|
12551
|
12552
|
12553
|
13856
|
13888
|
14229
|
14361
|
14362
|
14977
|
14978
|
14979
|
17901
|
17902
|
17903
|
17968
|
18151
|
18152
|
18153
|
18154
|
18857
|
18858
|
18859
|
18942
|
19089
|
19090
|
19091
|
19470
|
19471
|
19472
|
19473
|
19474
|
19475
|
51963
|
52746
|
52747
|
52810
|
52811
|
54058
|
54101
|
54102
|
54250