Bugzilla – Attachment 95240 Details for
Bug 7611
Show the NOT_LOAN authorised values for item status in XSLT OPAC search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7611: (follow-up) separate positive and negative statuses as in the past
Bug-7611-follow-up-separate-positive-and-negative-.patch (text/plain), 5.66 KB, created by
Nick Clemens (kidclamp)
on 2019-11-08 16:59:09 UTC
(
hide
)
Description:
Bug 7611: (follow-up) separate positive and negative statuses as in the past
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-11-08 16:59:09 UTC
Size:
5.66 KB
patch
obsolete
>From c047ea372ad447cf26b658de124e79a9ea1f8e5c Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 8 Nov 2019 15:49:08 +0000 >Subject: [PATCH] Bug 7611: (follow-up) separate positive and negative statuses > as in the past > >This patch preserves someting closer to previous functionality. > >Negative not for loan are in the 'unavailable' section in red, positive ones are in the 'reference' section in green. Itemtype level will also be in green in reference > >Item specific status will override an itemtype level. > >The line break between 'reference' and 'unavailable' existed before and is preserved - negative not for loan and checked out items appear here >--- > C4/XSLT.pm | 8 +++----- > .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 17 +++++++++++------ > 2 files changed, 14 insertions(+), 11 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 2f116a717f..df9bc47d1c 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -338,16 +338,14 @@ sub buildKohaItemsNamespace { > $status = "Checked out"; > } > elsif ( $item->notforloan ) { >- $status = "reallynotforloan"; >- $substatus = exists $descs{$item->{notforloan}} ? $descs{$item->{notforloan}}->{opac_description} : "Not for loan_$item->{notforloan}"; >+ $status = $item->notforloan < 0 ? "reallynotforloan" : "reference"; >+ $substatus = exists $descs{$item->notforloan} ? $descs{$item->notforloan}->{opac_description} : "Not for loan_".$item->notforloan; > } > elsif ( exists $itemtypes->{ $item->effective_itemtype } > && $itemtypes->{ $item->effective_itemtype }->{notforloan} == 1 ) > { > $status = "reference"; >- } >- elsif ( $item->notforloan < 0) { >- $status = "On order"; >+ $substatus = "Not for loan"; > } > else { > $status = "available"; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index d35d0374fb..e7802641df 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1310,11 +1310,16 @@ > <span class="available reference"> > <span class="AvailabilityLabel"><strong><xsl:text>Items available for reference: </xsl:text></strong></span> > <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])]"> >- <span class="ItemSummary"> >+ <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-substatus-and-branch', concat(items:substatus, ' ', items:homebranch))[1])]"> >+ <span> >+ <xsl:attribute name="class"> >+ ItemSummary >+ <xsl:value-of select="translate(items:substatus,' ','_')"/> >+ </xsl:attribute> > <xsl:if test="$singleBranchMode=0"> >- <span class="ItemBranch"><xsl:value-of select="items:homebranch"/> </span> >+ <span class="ItemBranch"><xsl:value-of select="items:homebranch"/><xsl:text> </xsl:text></span> > </xsl:if> >+ <span class='notforloandesc'><xsl:value-of select="items:substatus"/></span> > <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> > <span class="CallNumberAndLabel"> > <span class="LabelCallNumber">Call number: </span> >@@ -1322,7 +1327,7 @@ > </span> > </xsl:if> > <xsl:text> (</xsl:text> >- <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/> >+ <xsl:value-of select="count(key('item-by-substatus-and-branch', concat(items:substatus, ' ', 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> > </span> >@@ -1339,8 +1344,8 @@ > <xsl:when test="count(key('item-by-status', 'reallynotforloan'))>0"> > <span class="unavailable"> > <br /> >- <xsl:variable name="reference_items" select="key('item-by-status', 'reallynotforloan')"/> >- <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-substatus-and-branch', concat(items:substatus, ' ', items:homebranch))[1])]"> >+ <xsl:variable name="unavailable_items" select="key('item-by-status', 'reallynotforloan')"/> >+ <xsl:for-each select="$unavailable_items[generate-id() = generate-id(key('item-by-substatus-and-branch', concat(items:substatus, ' ', items:homebranch))[1])]"> > <span> > <xsl:attribute name="class"> > ItemSummary >-- >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 7611
:
7905
|
7906
|
7907
|
60816
|
62930
|
62931
|
85115
|
92495
|
92496
|
94026
|
94212
|
95060
|
95061
|
95235
|
95236
|
95237
|
95238
|
95239
|
95240
|
97804
|
97805
|
97806
|
97807
|
97808
|
99074
|
99075
|
99076
|
99077
|
99078
|
99163