Bugzilla – Attachment 58633 Details for
Bug 17736
Move GetReservesFromBiblionumber to Koha::Biblio->holds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17736: [QA Follow-up] We do not need GetItemHolds in acqui
Bug-17736-QA-Follow-up-We-do-not-need-GetItemHolds.patch (text/plain), 3.38 KB, created by
Marcel de Rooy
on 2017-01-06 12:26:30 UTC
(
hide
)
Description:
Bug 17736: [QA Follow-up] We do not need GetItemHolds in acqui
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-01-06 12:26:30 UTC
Size:
3.38 KB
patch
obsolete
>From a0c61fb05f87d1718b5499e4ccfdde9bddf1d4f3 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 6 Jan 2017 13:22:07 +0100 >Subject: [PATCH] Bug 17736: [QA Follow-up] We do not need GetItemHolds in > acqui >Content-Type: text/plain; charset=utf-8 > >The solution of Jonathan can be applied in two other cases, effectively >making GetItemHolds obsolete. > >Test plan: >[1] Git grep on GetItemHolds >[2] Add an order, place a hold, delete order. >[3] Add an order, receive, place hold, delete order. >--- > C4/Items.pm | 22 ---------------------- > acqui/basket.pl | 9 ++------- > acqui/parcel.pl | 8 +------- > 3 files changed, 3 insertions(+), 36 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index e02da3b..e9db673 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -92,7 +92,6 @@ BEGIN { > ShelfToCart > > GetAnalyticsCount >- GetItemHolds > > SearchItemsByField > SearchItems >@@ -2556,27 +2555,6 @@ sub GetAnalyticsCount { > return ($result); > } > >-=head2 GetItemHolds >- >- $holds = &GetItemHolds($biblionumber, $itemnumber); >- >-This function return the count of holds with $biblionumber and $itemnumber >- >-=cut >- >-sub GetItemHolds { >- my ($biblionumber, $itemnumber) = @_; >- my $holds; >- my $dbh = C4::Context->dbh; >- my $query = "SELECT count(*) >- FROM reserves >- WHERE biblionumber=? AND itemnumber=?"; >- my $sth = $dbh->prepare($query); >- $sth->execute($biblionumber, $itemnumber); >- $holds = $sth->fetchrow; >- return $holds; >-} >- > =head2 SearchItemsByField > > my $items = SearchItemsByField($field, $value); >diff --git a/acqui/basket.pl b/acqui/basket.pl >index db24721..a9be23e 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -465,13 +465,8 @@ sub get_order_infos { > my $itemcount = GetItemsCount($biblionumber); > my $holds_count = $biblio ? $biblio->holds->count : 0; > my @items = GetItemnumbersFromOrder( $ordernumber ); >- my $itemholds; >- foreach my $item (@items){ >- my $nb = GetItemHolds($biblionumber, $item); >- if ($nb){ >- $itemholds += $nb; >- } >- } >+ my $itemholds = $biblio ? $biblio->holds->search({ itemnumber => { -in => \@items } })->count : 0; >+ > # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680 > $line{can_del_bib} = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds_count); > $line{items} = ($itemcount) - (scalar @items); >diff --git a/acqui/parcel.pl b/acqui/parcel.pl >index 3bd586c..815fbe6 100755 >--- a/acqui/parcel.pl >+++ b/acqui/parcel.pl >@@ -245,13 +245,7 @@ unless( defined $invoice->{closedate} ) { > my $itemcount = GetItemsCount($biblionumber); > my $holds_count = $biblio ? $biblio->holds->count : 0; > my @items = GetItemnumbersFromOrder( $ordernumber ); >- my $itemholds; >- foreach my $item (@items){ >- my $nb = GetItemHolds($biblionumber, $item); >- if ($nb){ >- $itemholds += $nb; >- } >- } >+ my $itemholds = $biblio ? $biblio->holds->search({ itemnumber => { -in => \@items } })->count : 0; > > my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber}); > $line{suggestionid} = $suggestion->{suggestionid}; >-- >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 17736
:
58015
|
58016
|
58017
|
58056
|
58057
|
58106
|
58107
|
58108
|
58628
|
58629
|
58630
|
58631
|
58632
|
58633
|
58634
|
58635
|
58636
|
58637
|
58638
|
58639
|
58640
|
58641
|
58642
|
58643
|
58644
|
58645
|
59846
|
59847
|
59848
|
59849
|
59850
|
59851
|
59852
|
59853
|
59854
|
59855
|
59859
|
59860
|
61406
|
61407
|
61408
|
61409
|
61410
|
61411
|
61412
|
61413
|
61414
|
61415
|
61416