Bugzilla – Attachment 47259 Details for
Bug 10612
Add ability to delete patrons with batch patron deletion tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10612 [QA Followup] - fix issues
Bug-10612-QA-Followup---fix-issues.patch (text/plain), 3.72 KB, created by
Nick Clemens (kidclamp)
on 2016-01-25 14:37:20 UTC
(
hide
)
Description:
Bug 10612 [QA Followup] - fix issues
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-01-25 14:37:20 UTC
Size:
3.72 KB
patch
obsolete
>From d916dca7a5533992893578324e33cd3389f102c0 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 22 Jan 2016 02:09:54 +0000 >Subject: [PATCH] Bug 10612 [QA Followup] - fix issues > >1 - Use Koha::List::Patron >2 - Return only non-empty lists for deletion selection >3 - Fix _skip_bo... to accept patro_list_patrons3 - Fix >_skip_borrowers_with_fines_or_issues to >accept patro_list_patrons3 >4 - Fix missed closing quote in cleanborrowers.tt >--- > .../prog/en/modules/tools/cleanborrowers.tt | 2 +- > tools/cleanborrowers.pl | 20 ++++++++++++-------- > 2 files changed, 13 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >index f4781e7..e89b7e3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >@@ -162,7 +162,7 @@ > <input type="hidden" name="last_issue_date" value="[% last_issue_date | $KohaDates %]" /> > <input type="hidden" name="borrower_dateexpiry" value="[% borrower_dateexpiry | $KohaDates %]" /> > <input type="hidden" name="borrower_categorycode" value="[% borrower_categorycode %]" /> >- <input type="hidden" name="patron_list_id" value="[% patron_list_id %] /> >+ <input type="hidden" name="patron_list_id" value="[% patron_list_id %]" /> > </fieldset> > <fieldset class="action"><input type="submit" value="Finish" /> <a class="cancel" href="/cgi-bin/koha/tools/cleanborrowers.pl">Cancel</a></fieldset> > </form> >diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl >index 86b410f..7e0db06 100755 >--- a/tools/cleanborrowers.pl >+++ b/tools/cleanborrowers.pl >@@ -85,9 +85,8 @@ if ( $step == 2 ) { > > my $patrons_to_delete; > if ($patron_list_id) { >- my @patron_list_patrons = >- Koha::Database->new()->schema()->resultset('PatronListPatron') >- ->search( { patron_list_id => $patron_list_id } ); >+ my @patron_list = GetPatronLists( {patron_list_id=>$patron_list_id}); >+ my @patron_list_patrons = $patron_list[0]->patron_list_patrons(); > $patrons_to_delete = \@patron_list_patrons; > } > else { >@@ -125,9 +124,8 @@ elsif ( $step == 3 ) { > if ($do_delete) { > my $patrons_to_delete; > if ($patron_list_id) { >- my @patron_list_patrons = >- Koha::Database->new()->schema()->resultset('PatronListPatron') >- ->search( { patron_list_id => $patron_list_id } ); >+ my @patron_lists = GetPatronLists( { patron_list_id => $patron_list_id } ); >+ my @patron_list_patrons = $patron_lists[0]->patron_list_patrons(); > $patrons_to_delete = \@patron_list_patrons; > } > else { >@@ -170,7 +168,13 @@ elsif ( $step == 3 ) { > testrun => ( $radio eq "testrun" ) ? 1: 0, > ); > } else { # $step == 1 >- $template->param( patron_lists => [ GetPatronLists() ] ); >+ my @all_lists = GetPatronLists(); >+ my @non_empty_lists; >+ foreach my $list (@all_lists){ >+ my @patrons = $list->patron_list_patrons(); >+ if( scalar @patrons ) { push(@non_empty_lists,$list) } >+ } >+ $template->param( patron_lists => [ @non_empty_lists ] ); > } > > $template->param( >@@ -190,7 +194,7 @@ sub _skip_borrowers_with_nonzero_balance_or_issues { > my $balance; > my $issues; > @$borrowers = map { >- (undef, $issues, $balance) = GetMemberIssuesAndFines( $_->{borrowernumber} ); >+ (undef, $issues, $balance) = GetMemberIssuesAndFines( $_->{borrowernumber} || $_->get_column('borrowernumber') ); > ($balance != 0 || $issues!= 0) ? (): ($_); > } @$borrowers; > } >-- >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 10612
:
19766
|
19767
|
21081
|
21444
|
21445
|
21446
|
22837
|
22838
|
28779
|
28780
|
36311
|
36313
|
36314
|
36315
|
41289
|
41363
|
41364
|
41365
|
46239
|
46279
|
46280
|
46834
|
47153
|
47224
|
47225
|
47226
|
47255
|
47259
|
47393
|
47394
|
47395
|
47396
|
47478
|
48833
|
48881
|
48888
|
48890
|
48891
|
48892
|
49596
|
49597
|
49607
|
49694
|
49740
|
49741
|
49766
|
49767
|
49768
|
49769
|
49770