Bugzilla – Attachment 97654 Details for
Bug 24430
Remove C4::Biblio::CountBiblioInOrders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24430: Remove CountBiblioInOrders and its traces
Bug-24430-Remove-CountBiblioInOrders-and-its-trace.patch (text/plain), 3.43 KB, created by
Martin Renvoize (ashimema)
on 2020-01-21 11:23:21 UTC
(
hide
)
Description:
Bug 24430: Remove CountBiblioInOrders and its traces
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-01-21 11:23:21 UTC
Size:
3.43 KB
patch
obsolete
>From f31993d126ed97fdc80605931f41ed29b1dac5d1 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 15 Jan 2020 16:28:00 -0300 >Subject: [PATCH] Bug 24430: Remove CountBiblioInOrders and its traces > >This patch replaces the only uses of CountBiblioInOrders and makes that >code use $biblio->orders->count instead. > >Test nothing breaks in basket.pl and parcel.pl > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Biblio.pm | 21 --------------------- > acqui/basket.pl | 5 +++-- > acqui/parcel.pl | 2 +- > 3 files changed, 4 insertions(+), 24 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index ce0d4fbdb6..c07313ab33 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -54,7 +54,6 @@ BEGIN { > TransformKohaToMarc > PrepHostMarcField > CountItemsIssued >- CountBiblioInOrders > ModBiblio > ModZebra > UpdateTotalIssues >@@ -3180,26 +3179,6 @@ sub ModBiblioMarc { > return $biblionumber; > } > >-=head2 CountBiblioInOrders >- >- $count = &CountBiblioInOrders( $biblionumber); >- >-This function return count of biblios in orders with $biblionumber >- >-=cut >- >-sub CountBiblioInOrders { >- my ($biblionumber) = @_; >- my $dbh = C4::Context->dbh; >- my $query = "SELECT count(*) >- FROM aqorders >- WHERE biblionumber=? AND datecancellationprinted IS NULL"; >- my $sth = $dbh->prepare($query); >- $sth->execute($biblionumber); >- my $count = $sth->fetchrow; >- return ($count); >-} >- > =head2 prepare_host_field > > $marcfield = prepare_host_field( $hostbiblioitem, $marcflavour ); >diff --git a/acqui/basket.pl b/acqui/basket.pl >index 0c8b5eac6c..65ed547452 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -136,7 +136,7 @@ if ( $op eq 'delete_confirm' ) { > foreach my $myorder (@orders){ > my $biblionumber = $myorder->{'biblionumber'}; > my $biblio = Koha::Biblios->find( $biblionumber ); >- my $countbiblio = CountBiblioInOrders($biblionumber); >+ my $countbiblio = $biblio->active_orders_count; > my $ordernumber = $myorder->{'ordernumber'}; > my $cnt_subscriptions = $biblio->subscriptions->count; > my $itemcount = $biblio->items->count; >@@ -477,7 +477,8 @@ sub get_order_infos { > my $biblionumber = $order->{'biblionumber'}; > if ( $biblionumber ) { # The biblio still exists > my $biblio = Koha::Biblios->find( $biblionumber ); >- my $countbiblio = CountBiblioInOrders($biblionumber); >+ my $countbiblio = $biblio->active_orders_count; >+ > my $ordernumber = $order->{'ordernumber'}; > my $cnt_subscriptions = $biblio->subscriptions->count; > my $itemcount = $biblio->items->count; >diff --git a/acqui/parcel.pl b/acqui/parcel.pl >index 9c16c9ccfe..8139cabfb9 100755 >--- a/acqui/parcel.pl >+++ b/acqui/parcel.pl >@@ -241,7 +241,7 @@ unless( defined $invoice->{closedate} ) { > > my $biblionumber = $line{'biblionumber'}; > my $biblio = Koha::Biblios->find( $biblionumber ); >- my $countbiblio = CountBiblioInOrders($biblionumber); >+ my $countbiblio = $biblio->active_orders_count; > my $ordernumber = $line{'ordernumber'}; > my $order_object = Koha::Acquisition::Orders->find($ordernumber); > my $cnt_subscriptions = $biblio ? $biblio->subscriptions->count: 0; >-- >2.20.1
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 24430
:
97414
|
97415
|
97416
|
97443
|
97446
|
97447
|
97448
|
97563
|
97564
|
97565
|
97652
|
97653
| 97654