Bugzilla – Attachment 14451 Details for
Bug 6918
Can't place holds on 'on order' items with AllowOnShelfHolds off
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6918 - can't place holds on 'on order' items with AllowOnShelfHolds off
Bug-6918---cant-place-holds-on-on-order-items-with.patch (text/plain), 5.20 KB, created by
Kyle M Hall (khall)
on 2013-01-07 14:35:47 UTC
(
hide
)
Description:
Bug 6918 - can't place holds on 'on order' items with AllowOnShelfHolds off
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-01-07 14:35:47 UTC
Size:
5.20 KB
patch
obsolete
>From 7cc3d4611b814b23fa0472e39fe06b215def9620 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 7 Jan 2013 09:34:24 -0500 >Subject: [PATCH] Bug 6918 - can't place holds on 'on order' items with AllowOnShelfHolds off > >--- > C4/Biblio.pm | 15 +++++++++++++-- > C4/Reserves.pm | 2 +- > C4/VirtualShelves/Page.pm | 2 +- > opac/opac-ISBDdetail.pl | 2 +- > opac/opac-MARCdetail.pl | 2 +- > opac/opac-detail.pl | 2 +- > opac/opac-search.pl | 2 +- > 7 files changed, 19 insertions(+), 8 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 7d28ccd..57885ee 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2629,9 +2629,20 @@ more. > =cut > > sub CountItemsIssued { >- my ($biblionumber) = @_; >+ my ($params) = @_; >+ my $biblionumber = $params->{'biblionumber'}; >+ my $count_on_order = $params->{'count_on_order'}; >+ >+ my $sql = 'SELECT COUNT(*) AS issuedCount FROM items LEFT JOIN issues ON items.itemnumber = issues.itemnumber WHERE items.biblionumber = ?'; >+ >+ if ( $count_on_order ) { >+ $sql .= ' AND ( issues.itemnumber IS NOT NULL OR items.notforloan < 0 )'; >+ } else { >+ $sql .= ' AND issues.itemnumber IS NOT NULL'; >+ } >+ > my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare('SELECT COUNT(*) as issuedCount FROM items, issues WHERE items.itemnumber = issues.itemnumber AND items.biblionumber = ?'); >+ my $sth = $dbh->prepare( $sql ); > $sth->execute($biblionumber); > my $row = $sth->fetchrow_hashref(); > return $row->{'issuedCount'}; >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index a380bf0..62df806 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1441,7 +1441,7 @@ sub IsAvailableForItemLevelRequest { > if (C4::Context->preference('AllowOnShelfHolds')) { > return $available_per_item; > } else { >- return ($available_per_item and ($item->{onloan} or GetReserveStatus($itemnumber) eq "W")); >+ return ($available_per_item and ($item->{onloan} or $item->{notforloan} < 0 or GetReserveStatus($itemnumber) eq "W" )); > } > } > >diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm >index 6a4d431..21c6985 100644 >--- a/C4/VirtualShelves/Page.pm >+++ b/C4/VirtualShelves/Page.pm >@@ -271,7 +271,7 @@ sub shelfpage { > $this_item->{'normalized_isbn'} = GetNormalizedISBN(undef,$record,$marcflavour); > # Getting items infos for location display > my @items_infos = &GetItemsLocationInfo( $this_item->{'biblionumber'}); >- $this_item->{'itemsissued'} = CountItemsIssued( $this_item->{'biblionumber'} ); >+ $this_item->{'itemsissued'} = CountItemsIssued({ biblionumber => $this_item->{'biblionumber'} }); > $this_item->{'ITEM_RESULTS'} = \@items_infos; > if ( grep {$_ eq $biblionumber} @cart_list) { > $this_item->{'incart'} = 1; >diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl >index be62879..4b82fe2 100755 >--- a/opac/opac-ISBDdetail.pl >+++ b/opac/opac-ISBDdetail.pl >@@ -81,7 +81,7 @@ if($query->cookie("bib_list")){ > } > > $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); >-$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); >+$template->param( 'ItemsIssued' => CountItemsIssued({ biblionumber => $biblionumber, count_on_order => 1 }) ); > > my $marcflavour = C4::Context->preference("marcflavour"); > my $record = GetMarcBiblio($biblionumber); >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index ac13a9d..5926796 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -94,7 +94,7 @@ if($query->cookie("bib_list")){ > } > > $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); >-$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); >+$template->param( 'ItemsIssued' => CountItemsIssued({ biblionumber => $biblionumber, count_on_order => 1 }) ); > > # adding the $RequestOnOpac param > my $RequestOnOpac; >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 22c922b..fc9e025 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -390,7 +390,7 @@ if ($session->param('busc')) { > > > $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); >-$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); >+$template->param( 'ItemsIssued' => CountItemsIssued({ biblionumber => $biblionumber, count_on_order => 1 }) ); > > > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 9708176..7e2782e 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -550,7 +550,7 @@ for (my $i=0;$i<@servers;$i++) { > $tag_quantity = C4::Context->preference('TagsShowOnList')) { > foreach (@newresults) { > my $bibnum = $_->{biblionumber} or next; >- $_->{itemsissued} = CountItemsIssued( $bibnum ); >+ $_->{itemsissued} = CountItemsIssued({ biblionumber => $bibnum }); > $_ ->{'TagLoop'} = get_tags({biblionumber=>$bibnum, approved=>1, 'sort'=>'-weight', > limit=>$tag_quantity }); > } >-- >1.7.2.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 6918
:
14004
|
14152
|
14158
|
14390
|
14451
|
15077
|
19087
|
68898
|
68934
|
70232
|
102998
|
103016
|
103020
|
103021
|
103175
|
103179
|
105390
|
105473
|
105474