Bugzilla – Attachment 57833 Details for
Bug 17624
Add Staff Collection status for items in C4::XSLT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17624: Separate XSLT item status for Staff Collection
Bug-17624-Separate-XSLT-item-status-for-Staff-Coll.patch (text/plain), 3.98 KB, created by
Marcel de Rooy
on 2016-11-30 14:42:12 UTC
(
hide
)
Description:
Bug 17624: Separate XSLT item status for Staff Collection
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-11-30 14:42:12 UTC
Size:
3.98 KB
patch
obsolete
>From a9f7dec7da77b85162ae917ed37cabf54d0b0e84 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 28 Nov 2016 11:02:25 +0100 >Subject: [PATCH] Bug 17624: Separate XSLT item status for Staff Collection >Content-Type: text/plain; charset=utf-8 > >In order to differentiate a regular not for loan with a not-for-loan that >has the status "Staff Collection", this patch slightly adjusts the status >in C4::XSLT::buildKohaItemsNamespace. This status is used in the OPAC >results XSLT. > >If you do not have items with notforloan>=2, there will be no change in >behavior. > >If you use notforloan=2 and did not change its authorised value description, >a count for Staff Collection will be added in the Availability line. The >items with notforloan==2 will no longer be viewed as "for reference". > >Higher values for notforloan will no longer be listed too as "for >reference". (Same for a modified notforloan==2.) > >Note: I also considered using a plugin here or a specific preference. This >solution is by far the simplest. Currently, we are presenting the item >status in various places on various ways. A better solution would depend >on consolidating the item status code in Koha::Item. > >Test plan: >[1] Pick a biblio with three items: one should be for loan, set the other > two to Not for loan and Staff Collection. >[2] Look for this biblio on OPAC search results. Check Availability. >--- > C4/XSLT.pm | 11 +++++++++++ > .../opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 9 ++++++++- > 2 files changed, 19 insertions(+), 1 deletion(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index a829402..99982bb 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -299,6 +299,17 @@ sub buildKohaItemsNamespace { > if ( $item->{itemnotforloan} > 0 || $item->{notforloan} > 0 || $itemtypes->{ $item->{itype} }->{notforloan} == 1 ) { > $status = "reference"; > } >+ if( $item->{notforloan} > 1 ) { >+ # Handle higher positive values for notforloan >+ # If av [exceptionally] returns nothing, we'll keep reference >+ my $av = Koha::AuthorisedValues->search({ >+ category => 'NOT_LOAN', >+ authorised_value => $item->{notforloan}, >+ }); >+ if( $av->count ) { >+ $status = $av->next->opac_description; >+ } >+ } > if ($item->{onloan}) { > $status = "Checked out"; > } >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 353b08e..61828e0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1159,7 +1159,7 @@ > </xsl:for-each> > (<xsl:value-of select="$AlternateHoldingsCount"/>) > </xsl:when> >- <xsl:otherwise>No items available </xsl:otherwise> >+ <xsl:otherwise>No items available. </xsl:otherwise> > </xsl:choose> > </xsl:when> > <xsl:when test="count(key('item-by-status', 'available'))>0"> >@@ -1249,6 +1249,13 @@ > </xsl:when></xsl:choose> > </xsl:when> </xsl:choose> > >+ <xsl:if test="count(key('item-by-status', 'Staff Collection'))>0"> >+ <span class="unavailable"> >+ <xsl:text>Staff Collection (</xsl:text> >+ <xsl:value-of select="count(key('item-by-status', 'Staff Collection'))"/> >+ <xsl:text>). </xsl:text> >+ </span> >+ </xsl:if> > <xsl:if test="count(key('item-by-status', 'Checked out'))>0"> > <span class="unavailable"> > <xsl:text>Checked out (</xsl:text> >-- >2.1.4
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 17624
:
57540
|
57541
| 57833 |
57834