From 6992ea572d378a98a0af10347d733632101c60fa Mon Sep 17 00:00:00 2001 From: Kyle M Hall 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 --- .../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 @@
Warnings
    -
  • [% memberstodelete_list.size || 0 %] patrons will be deleted
  • -
  • [% memberstoanonymize_list.size || 0 %] patron's checkout histories will be anonymized
  • +
  • [% patrons_to_delete.size || 0 %] patrons will be deleted
  • +
  • [% patrons_to_anonymize.size || 0 %] patron's checkout histories will be anonymized

- [% IF memberstodelete_list.size %] + [% IF patrons_to_delete.size %]
What do you want to do for deleted patrons? @@ -145,12 +145,12 @@
-
+
[% END %] - [% IF memberstoanonymize_list.size %] - Checkout history for [% memberstoanonymize_list.size %] patrons will be anonymized - + [% IF patrons_to_anonymize.size %] + Checkout history for [% patrons_to_anonymize.size %] patrons will be anonymized + [% END %] 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