Bugzilla – Attachment 778 Details for
Bug 2655
Items waiting on the hold shelf display as "Available" in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Propose patch. Follow-up patch. - Fixes opac (no xsl) and intranet.
0004-Bug-2655-Fixes-availabilty-counts-if-items-are-on-h.patch (text/plain), 6.88 KB, created by
Chris Cormack
on 2010-02-21 01:14:00 UTC
(
hide
)
Description:
Propose patch. Follow-up patch. - Fixes opac (no xsl) and intranet.
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2010-02-21 01:14:00 UTC
Size:
6.88 KB
patch
obsolete
>From 774033d8850df1a55144c905d9c7de833a7d4e18 Mon Sep 17 00:00:00 2001 >From: Garry Collum <gcollum@gmail.com> >Date: Sat, 20 Feb 2010 20:14:05 -0500 >Subject: [PATCH] Bug 2655: Fixes availabilty counts if items are on hold shelf. Patch (2/2) >Content-Type: text/plain; charset="utf-8" > >This fixes the opac results - non xsl transformed - and the intranet result lists. > >Also fixes opac-detail which was showing all items 'on hold' if there was a bib level request, whether items were on the hold shelf or not. >--- > C4/Search.pm | 11 +++++++++++ > .../prog/en/modules/catalogue/results.tmpl | 1 + > .../opac-tmpl/prog/en/modules/opac-detail.tmpl | 2 +- > .../opac-tmpl/prog/en/modules/opac-results.tmpl | 1 + > 4 files changed, 14 insertions(+), 1 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 6ae9827..554174c 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -27,6 +27,7 @@ use XML::Simple; > use C4::Dates qw(format_date); > use C4::XSLT; > use C4::Branch; >+use C4::Reserves; # CheckReserves > use C4::Debug; > use YAML; > use URI::Escape; >@@ -1516,6 +1517,7 @@ sub searchResults { > my $itemdamaged_count = 0; > my $item_in_transit_count = 0; > my $can_place_holds = 0; >+ my $item_onhold_count = 0; > my $items_count = scalar(@fields); > my $maxitems = > ( C4::Context->preference('maxItemsinSearchResults') ) >@@ -1573,6 +1575,10 @@ sub searchResults { > my $transfertwhen = ''; > my ($transfertfrom, $transfertto); > >+ # is item on the reserve shelf? >+ my $reservestatus = 0; >+ my $reserveitem; >+ > unless ($item->{wthdrawn} > || $item->{itemlost} > || $item->{damaged} >@@ -1592,6 +1598,7 @@ sub searchResults { > # should map transit status to record indexed in Zebra. > # > ($transfertwhen, $transfertfrom, $transfertto) = C4::Circulation::GetTransfers($item->{itemnumber}); >+ ($reservestatus, $reserveitem) = C4::Reserves::CheckReserves($item->{itemnumber}); > } > > # item is withdrawn, lost or damaged >@@ -1599,12 +1606,14 @@ sub searchResults { > || $item->{itemlost} > || $item->{damaged} > || $item->{notforloan} >+ || $reservestatus eq 'Waiting' > || ($transfertwhen ne '')) > { > $wthdrawn_count++ if $item->{wthdrawn}; > $itemlost_count++ if $item->{itemlost}; > $itemdamaged_count++ if $item->{damaged}; > $item_in_transit_count++ if $transfertwhen ne ''; >+ $item_onhold_count++ if $reservestatus eq 'Waiting'; > $item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan}; > $other_count++; > >@@ -1613,6 +1622,7 @@ sub searchResults { > $other_items->{$key}->{$_} = $item->{$_}; > } > $other_items->{$key}->{intransit} = ($transfertwhen ne '') ? 1 : 0; >+ $other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; > $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value; > $other_items->{$key}->{count}++ if $item->{$hbranch}; > $other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; >@@ -1677,6 +1687,7 @@ sub searchResults { > $oldbiblio->{itemlostcount} = $itemlost_count; > $oldbiblio->{damagedcount} = $itemdamaged_count; > $oldbiblio->{intransitcount} = $item_in_transit_count; >+ $oldbiblio->{onholdcount} = $item_onhold_count; > $oldbiblio->{orderedcount} = $ordered_count; > $oldbiblio->{isbn} =~ > s/-//g; # deleting - in isbn to enable amazon content >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl >index 09d6339..9dbfe4a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl >@@ -515,6 +515,7 @@ function GetZ3950Terms(){ > <!-- TMPL_IF NAME="itemlost" -->(Lost)<!-- /TMPL_IF --> > <!-- TMPL_IF NAME="damaged" -->(Damaged)<!-- /TMPL_IF --> > <!-- TMPL_IF NAME="intransit" -->(In transit)<!-- /TMPL_IF --> >+ <!-- TMPL_IF NAME="onhold" -->(On hold)<!-- /TMPL_IF --> > <!-- TMPL_IF NAME="notforloan" --><!-- TMPL_VAR name="notforloan" --><!-- /TMPL_IF --> > (<!-- TMPL_VAR NAME="count" -->)</li> > <!-- /TMPL_LOOP --></ul> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl >index 28dbf90..1716dc8 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl >@@ -406,7 +406,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > In transit from <!-- TMPL_VAR NAME="transfertfrom" --> > to <!-- TMPL_VAR NAME="transfertto" --> since <!-- TMPL_VAR NAME="transfertwhen" --> > <!-- TMPL_ELSE --> >- <!-- TMPL_IF NAME="waiting" -->On hold<!-- TMPL_ELSE --><!-- TMPL_IF NAME="onhold" -->On hold<!-- TMPL_ELSE -->Available<!-- /TMPL_IF --><!-- /TMPL_IF --> >+ <!-- TMPL_IF NAME="waiting" -->On hold<!-- TMPL_ELSE -->Available<!-- /TMPL_IF --> > <!-- /TMPL_IF --> > <!-- /TMPL_IF --> > <!-- /TMPL_IF --> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl >index 86bb4c5..1ea73e5 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl >@@ -447,6 +447,7 @@ $(document).ready(function(){ > <!-- TMPL_UNLESS NAME="hidelostitems" --><!-- TMPL_IF NAME="itemlostcount" --> Lost (<!-- TMPL_VAR NAME="itemlostcount" -->),<!-- /TMPL_IF --><!-- /TMPL_UNLESS --> > <!-- TMPL_IF NAME="damagedcount" --> Damaged (<!-- TMPL_VAR NAME="damagedcount" -->),<!-- /TMPL_IF --> > <!-- TMPL_IF NAME="orderedcount" --> On order (<!-- TMPL_VAR NAME="orderedcount" -->),<!-- /TMPL_IF --> >+ <!-- TMPL_IF NAME="onholdcount" --> On hold (<!-- TMPL_VAR NAME="onholdcount" -->),<!-- /TMPL_IF --> > <!-- TMPL_IF NAME="intransitcount" --> In transit (<!-- TMPL_VAR NAME="intransitcount" -->),<!-- /TMPL_IF --> > </span> > </span> >-- >1.5.6.5 >
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 2655
:
775
|
776
|
777
| 778