Bugzilla – Attachment 109039 Details for
Bug 23166
Simplify code related to orders in catalogue/*detail.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23166: Replace the count of orders with Koha::Acq::Orders
Bug-23166-Replace-the-count-of-orders-with-KohaAcq.patch (text/plain), 1.86 KB, created by
Nick Clemens (kidclamp)
on 2020-08-24 20:32:11 UTC
(
hide
)
Description:
Bug 23166: Replace the count of orders with Koha::Acq::Orders
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-08-24 20:32:11 UTC
Size:
1.86 KB
patch
obsolete
>From ff30e2cbfe3550b2bcc612c97bb0776a4bac0f77 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 19 Jun 2019 21:35:20 -0500 >Subject: [PATCH] Bug 23166: Replace the count of orders with Koha::Acq::Orders > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > catalogue/detail.pl | 28 ++++++++++------------------ > 1 file changed, 10 insertions(+), 18 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index b0e6d2c07e..45a2918e02 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -552,26 +552,18 @@ if ($StaffDetailItemSelection) { > } > } > >-my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber); >-my @deletedorders_using_biblio; >-my @orders_using_biblio; >- >-foreach my $myorder (@allorders_using_biblio) { >- my $basket = $myorder->{'basketno'}; >- if ((defined $myorder->{'datecancellationprinted'}) and ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){ >- push @deletedorders_using_biblio, $myorder; >- } >- else { >- push @orders_using_biblio, $myorder; >- } >-} >- > $template->param(biblio => $biblio); > >-my $count_orders_using_biblio = scalar @orders_using_biblio ; >-$template->param (countorders => $count_orders_using_biblio); >+my $orders = >+ Koha::Acquisition::Orders->search( { biblionumber => $biblionumber } ); > >-my $count_deletedorders_using_biblio = scalar @deletedorders_using_biblio ; >-$template->param (countdeletedorders => $count_deletedorders_using_biblio); >+$template->param( >+ countorders => $orders->search( { >+ datecancellationprinted => [ undef, '0000-00-00' ] >+ } )->count, >+ countdeletedorders => $orders->search( { >+ datecancellationprinted => [ { '!=' => [ -and => ( undef, '0000-00-00' ) ] } ] >+ } )->count, >+) if $orders->count; > > output_html_with_http_headers $query, $cookie, $template->output; >-- >2.11.0
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 23166
:
90824
|
90825
|
90826
|
90827
|
90828
|
104365
|
104366
|
104367
|
104368
|
104369
|
104370
|
108991
|
108992
|
108993
|
108994
|
108995
|
108996
|
108997
|
108998
|
108999
|
109000
|
109001
|
109002
|
109019
|
109020
|
109021
|
109022
|
109023
|
109024
|
109025
|
109026
|
109037
|
109038
|
109039
|
109040
|
109041
|
109042
|
109043
|
109044
|
109045
|
109046
|
109047
|
109048
|
109049
|
109050
|
109058
|
109059