Bugzilla – Attachment 36314 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]
[SIGNED-OFF] Bug 10612 [Code cleanup] - Rename some variables
SIGNED-OFF-Bug-10612-Code-cleanup---Rename-some-va.patch (text/plain), 6.36 KB, created by
Kyle M Hall (khall)
on 2015-03-02 14:16:11 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 10612 [Code cleanup] - Rename some variables
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-03-02 14:16:11 UTC
Size:
6.36 KB
patch
obsolete
>From 55ca097e52e059e05a80dd074cd567b04a2d8196 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 11 Jun 2014 08:51:28 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 10612 [Code cleanup] - Rename some > variables > >To move towards a more consistent codebase, I have changed some >variables from being camelCased or onelongname to the more standard >convention of words_separated_with_underscores. In addition, this >changes the use of the word 'member' to the word 'patron' to move >towards unification of our terminology. Our internal terminology should >move towards matching our external terminology ( members, borrowers => >patrons, reserves => holds, etc ). > >Signed-off-by: Nicole <nicole@bywatersolutions.com> >--- > .../prog/en/modules/tools/cleanborrowers.tt | 14 ++++----- > tools/cleanborrowers.pl | 30 ++++++++++---------- > 2 files changed, 22 insertions(+), 22 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 97d5953..4b664a3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >@@ -130,12 +130,12 @@ > <fieldset> > <legend>Warnings</legend> > <ul> >- <li>[% memberstodelete_list.size || 0 %] patrons will be deleted</li> >- <li>[% memberstoanonymize_list.size || 0 %] patron's checkout histories will be anonymized</li> >+ <li>[% patrons_to_delete.size || 0 %] patrons will be deleted</li> >+ <li>[% patrons_to_anonymize.size || 0 %] patron's checkout histories will be anonymized</li> > </ul> > > <br /> >- [% IF memberstodelete_list.size %] >+ [% IF patrons_to_delete.size %] > <fieldset><legend>What do you want to do for deleted patrons?</legend> > <input id="delete" type="radio" name="radio" value="delete" /> > <label for="delete">Permanently delete these patrons</label> >@@ -145,12 +145,12 @@ > > <br /><input id="testrun" type="radio" name="radio" value="testrun" checked="checked" /> > <label for="testrun">Do not remove any patrons (test run)</label> >- <input type="hidden" name="do_delete" value="[% memberstodelete_list.size %]" /></fieldset> >+ <input type="hidden" name="do_delete" value="[% patrons_to_delete.size %]" /></fieldset> > > [% END %] >- [% IF memberstoanonymize_list.size %] >- Checkout history for [% memberstoanonymize_list.size %] patrons will be anonymized >- <input type="hidden" name="do_anonym" value="[% memberstoanonymize_list.size %]" /> >+ [% IF patrons_to_anonymize.size %] >+ Checkout history for [% patrons_to_anonymize.size %] patrons will be anonymized >+ <input type="hidden" name="do_anonym" value="[% patrons_to_anonymize.size %]" /> > [% END %] > > <input type="hidden" name="step" value="3" /> >diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl >index 4c2f1e0..63e7c5c 100755 >--- a/tools/cleanborrowers.pl >+++ b/tools/cleanborrowers.pl >@@ -84,16 +84,16 @@ if ( $step == 2 ) { > > my %checkboxes = map { $_ => 1 } split /\0/, $params->{'checkbox'}; > >- my $membersToDelete; >+ 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 } ); >- $membersToDelete = \@patron_list_patrons; >+ $patrons_to_delete = \@patron_list_patrons; > } > else { > if ( $checkboxes{borrower} ) { >- $membersToDelete = GetBorrowersToExpunge( >+ $patrons_to_delete = GetBorrowersToExpunge( > _get_selection_params( > $not_borrowered_since, > $borrower_dateexpiry, >@@ -102,16 +102,16 @@ if ( $step == 2 ) { > ); > } > } >- _skip_borrowers_with_nonzero_balance($membersToDelete); >+ _skip_borrowers_with_nonzero_balance($patrons_to_delete); > >- my $membersToAnonymize; >+ my $members_to_anonymize; > if ( $checkboxes{issue} ) { >- $membersToAnonymize = GetBorrowersWithIssuesHistoryOlderThan($last_issue_date); >+ $members_to_anonymize = GetBorrowersWithIssuesHistoryOlderThan($last_issue_date); > } > > $template->param( >- memberstodelete_list => $membersToDelete, >- memberstoanonymize_list => $membersToAnonymize, >+ patrons_to_delete => $patrons_to_delete, >+ patrons_to_anonymize => $members_to_anonymize, > patron_list_id => $patron_list_id, > ); > } >@@ -124,29 +124,29 @@ elsif ( $step == 3 ) { > > # delete members > if ($do_delete) { >- my $membersToDelete; >+ 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 } ); >- $membersToDelete = \@patron_list_patrons; >+ $patrons_to_delete = \@patron_list_patrons; > } > else { >- $membersToDelete = GetBorrowersToExpunge( >+ $patrons_to_delete = GetBorrowersToExpunge( > _get_selection_params( > $not_borrowered_since, $borrower_dateexpiry, > $borrower_categorycode > ) > ); > } >- _skip_borrowers_with_nonzero_balance($membersToDelete); >+ _skip_borrowers_with_nonzero_balance($patrons_to_delete); > >- $totalDel = scalar(@$membersToDelete); >+ $totalDel = scalar(@$patrons_to_delete); > $radio = $params->{'radio'}; > for ( my $i = 0 ; $i < $totalDel ; $i++ ) { > $radio eq 'testrun' && last; >- my $borrowernumber = $membersToDelete->[$i]->{'borrowernumber'} >- || $membersToDelete->[$i]->get_column('borrowernumber'); >+ my $borrowernumber = $patrons_to_delete->[$i]->{'borrowernumber'} >+ || $patrons_to_delete->[$i]->get_column('borrowernumber'); > $radio eq 'trash' && MoveMemberToDeleted($borrowernumber); > C4::VirtualShelves::HandleDelBorrower($borrowernumber); > DelMember($borrowernumber); >-- >1.7.10.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