Bugzilla – Attachment 58549 Details for
Bug 15505
Mark Hold Items 'On hold' instead of 'Available'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'
Bug-15505---Mark-Hold-Items-On-hold-instead-of-Ava.patch (text/plain), 6.08 KB, created by
Chris Kirby
on 2016-12-31 20:55:42 UTC
(
hide
)
Description:
Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'
Filename:
MIME Type:
Creator:
Chris Kirby
Created:
2016-12-31 20:55:42 UTC
Size:
6.08 KB
patch
obsolete
>From 5406eec1892282280caef0c5f750e6bfe2e9c68a Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 27 Dec 2016 17:07:20 +0000 >Subject: [PATCH] Bug 15505 - Mark Hold Items 'On hold' instead of 'Available' > >This patch adds a 'pending hold' column to C4::Items:GetItemsInfo to >allow for displaying status of an item when it has been selected for a >hold by the holdsqueue. > >To test: >01 - Place a hold on an item >02 - Build the holdsqueue (kohadevbox example below) > sudo koha-shell kohadev > perl misc/cronjobs/holds/build_holds_queue.pl >03 - Search for the item on the OPAC >04 - Note item shows as 'Available' in results and details >05 - Apply Patch >06 - Repeat step 02, rebuilding the holdsqueue >07 - Search for the item on the OPAC >08 - Note that item now shows as 'Pending hold' > >Signed-off-by: Chris Kirby <chris.kirby@ilsleypubliclibrary.org> >Works as advertised. >--- > C4/Items.pm | 4 +++- > C4/Search.pm | 2 +- > C4/XSLT.pm | 6 +++++- > koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc | 5 +++++ > koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 6 ++++++ > 5 files changed, 20 insertions(+), 3 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index e02da3b..5a328d3 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1338,7 +1338,8 @@ sub GetItemsInfo { > holding.branchcode, > holding.branchname, > holding.opac_info as holding_branch_opac_info, >- home.opac_info as home_branch_opac_info >+ home.opac_info as home_branch_opac_info, >+ tmp_holdsqueue.itemnumber AS pending_hold > "; > $query .= " > FROM items >@@ -1350,6 +1351,7 @@ sub GetItemsInfo { > LEFT JOIN borrowers USING (borrowernumber) > LEFT JOIN serialitems USING (itemnumber) > LEFT JOIN serial USING (serialid) >+ LEFT JOIN tmp_holdsqueue USING (itemnumber) > LEFT JOIN itemtypes ON itemtypes.itemtype = " > . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype'); > $query .= q| >diff --git a/C4/Search.pm b/C4/Search.pm >index 4270c82..0a2853f 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -2233,7 +2233,7 @@ sub searchResults { > # XSLT processing of some stuff > # we fetched the sysprefs already before the loop through all retrieved record! > if (!$scan && $xslfile) { >- $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang); >+ $oldbiblio->{XSLTResultsRecord} = C4::XSLT::XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang); > # the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs > } > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index a829402..06a35ff 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -27,6 +27,7 @@ use C4::Context; > use C4::Items; > use C4::Koha; > use C4::Biblio; >+use C4::HoldsQueue; > use C4::Circulation; > use C4::Reserves; > use Koha::AuthorisedValues; >@@ -292,7 +293,7 @@ sub buildKohaItemsNamespace { > my $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} ); > > if ( $itemtypes->{ $item->{itype} }->{notforloan} || $item->{notforloan} || $item->{onloan} || $item->{withdrawn} || $item->{itemlost} || $item->{damaged} || >- (defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} || (defined $reservestatus && $reservestatus eq "Waiting") ){ >+ (defined $transfertwhen && $transfertwhen ne '') || $item->{itemnotforloan} || (defined $reservestatus && $reservestatus eq "Waiting") || $item->{pending_hold} ){ > if ( $item->{notforloan} < 0) { > $status = "On order"; > } >@@ -317,6 +318,9 @@ sub buildKohaItemsNamespace { > if (defined $reservestatus && $reservestatus eq "Waiting") { > $status = 'Waiting'; > } >+ if ($item->{pending_hold}) { >+ $status = 'Pending hold'; >+ } > } else { > $status = "available"; > } >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >index 843fcf6..ac635f2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -78,6 +78,11 @@ not use an API to fetch items that populates item.datedue. > <span class="item-status onorder">On order</span> > [% END %] > >+[% IF item.pending_hold %] >+ [% SET itemavailable = 0 %] >+ <span class="item-status pendinghold">Pending hold</span> >+[% END %] >+ > [% IF ( itemavailable ) %] > <span class="item-status available">Available [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]</span> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 353b08e..7c73ab3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1280,6 +1280,12 @@ > <xsl:value-of select="count(key('item-by-status', 'On order'))"/> > <xsl:text>). </xsl:text> </span> > </xsl:if> >+ <xsl:if test="count(key('item-by-status', 'Pending hold'))>0"> >+ <span class="unavailable"> >+ <xsl:text>Pending hold (</xsl:text> >+ <xsl:value-of select="count(key('item-by-status', 'Pending hold'))"/> >+ <xsl:text>). </xsl:text> </span> >+ </xsl:if> > <xsl:if test="count(key('item-by-status', 'In transit'))>0"> > <span class="unavailable"> > <xsl:text>In transit (</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 15505
:
58459
|
58549
|
83643
|
85349
|
86817
|
86821
|
88158