Bugzilla – Attachment 72755 Details for
Bug 19935
Move C4::Members::GetPendingIssues to the Koha namespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19935: Replace GetPendingIssues - Discharges
Bug-19935-Replace-GetPendingIssues---Discharges.patch (text/plain), 1.47 KB, created by
Benjamin Rokseth
on 2018-03-13 10:02:47 UTC
(
hide
)
Description:
Bug 19935: Replace GetPendingIssues - Discharges
Filename:
MIME Type:
Creator:
Benjamin Rokseth
Created:
2018-03-13 10:02:47 UTC
Size:
1.47 KB
patch
obsolete
>From 6d680f476c62b23214dc09c7dca85932ab675ae9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 8 Jan 2018 11:15:02 -0300 >Subject: [PATCH] Bug 19935: Replace GetPendingIssues - Discharges > >We should actually use Koha::Patron->checkouts here to avoid the >prefetch. > >Test plan: >A patron with checkouts cannot get a discharge > >Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no> >--- > Koha/Patron/Discharge.pm | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > >diff --git a/Koha/Patron/Discharge.pm b/Koha/Patron/Discharge.pm >index a1f4942..42eb438 100644 >--- a/Koha/Patron/Discharge.pm >+++ b/Koha/Patron/Discharge.pm >@@ -6,11 +6,10 @@ use File::Temp qw( :POSIX ); > use Carp; > > use C4::Templates qw ( gettemplate ); >-use C4::Members qw( GetPendingIssues ); > > use Koha::Database; > use Koha::DateUtils qw( dt_from_string output_pref ); >-use Koha::Patrons; >+use Koha::Checkouts; > > sub count { > my ($params) = @_; >@@ -34,13 +33,11 @@ sub can_be_discharged { > my ($params) = @_; > return unless $params->{borrowernumber}; > >- my $issues = GetPendingIssues( $params->{borrowernumber} ); >- if( @$issues ) { >- return 0; >- } >- else { >- return 1; >- } >+ my $patron = Koha::Patrons->find( $params->{borrowernumber} ); >+ return unless $patron; >+ >+ my $has_pending_checkouts = $patron->pending_checkouts->count; >+ return $has_pending_checkouts ? 0 : 1; > } > > sub is_discharged { >-- >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 19935
:
70351
|
70352
|
70353
|
70354
|
70355
|
70356
|
70357
|
70358
|
70359
|
70360
|
70361
|
71807
|
71808
|
71809
|
71810
|
71811
|
71812
|
71813
|
72752
|
72753
|
72754
|
72755
|
72756
|
72757
|
72758
|
72759
|
72760
|
72761
|
72762
|
73557
|
73558
|
73559
|
73560
|
73561
|
73562
|
73563
|
73564
|
73565
|
73566
|
73567
|
73568
|
73569
|
73570
|
73571
|
73572
|
73573
|
73574
|
73575
|
73576
|
73577
|
73578
|
73579
|
73580
|
73581
|
73582