Bugzilla – Attachment 59298 Details for
Bug 17949
[3.22.x] Batch patron deletion tool is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17949: Fix batch patron deletion tool
Bug-17949-Fix-batch-patron-deletion-tool.patch (text/plain), 5.03 KB, created by
Julian Maurice
on 2017-01-20 08:53:20 UTC
(
hide
)
Description:
Bug 17949: Fix batch patron deletion tool
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2017-01-20 08:53:20 UTC
Size:
5.03 KB
patch
obsolete
>From b07c29dd4e725f7b65a65878886af96500db6b6b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 31 Mar 2016 15:53:31 +0000 >Subject: [PATCH] Bug 17949: Fix batch patron deletion tool > >The filter 'who have not borrowed since' was ignored > >Reword 'not_borrowered_since' to 'not_borrowed_since' > >This patch is originally a followup of bug 10612 > >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > C4/Members.pm | 4 ++-- > misc/cronjobs/delete_patrons.pl | 2 +- > tools/cleanborrowers.pl | 22 +++++++++++----------- > 3 files changed, 14 insertions(+), 14 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index e15301c2a8..f832b08e2d 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -1983,7 +1983,7 @@ sub GetHideLostItemsPreference { > =head2 GetBorrowersToExpunge > > $borrowers = &GetBorrowersToExpunge( >- not_borrowered_since => $not_borrowered_since, >+ not_borrowed_since => $not_borrowed_since, > expired_before => $expired_before, > category_code => $category_code, > branchcode => $branchcode >@@ -1996,7 +1996,7 @@ sub GetHideLostItemsPreference { > sub GetBorrowersToExpunge { > my $params = shift; > >- my $filterdate = $params->{'not_borrowered_since'}; >+ my $filterdate = $params->{'not_borrowed_since'}; > my $filterexpiry = $params->{'expired_before'}; > my $filtercategory = $params->{'category_code'}; > my $filterbranch = $params->{'branchcode'} || >diff --git a/misc/cronjobs/delete_patrons.pl b/misc/cronjobs/delete_patrons.pl >index c05126f268..19483e9964 100755 >--- a/misc/cronjobs/delete_patrons.pl >+++ b/misc/cronjobs/delete_patrons.pl >@@ -40,7 +40,7 @@ cronlogaction(); > > my $members = GetBorrowersToExpunge( > { >- not_borrowered_since => $not_borrowed_since, >+ not_borrowed_since => $not_borrowed_since, > expired_before => $expired_before, > category_code => $category_code, > branchcode => $branchcode, >diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl >index 7888b990f2..3ed3254006 100755 >--- a/tools/cleanborrowers.pl >+++ b/tools/cleanborrowers.pl >@@ -25,7 +25,7 @@ This script allows to do 2 things. > > =item * Anonymise the borrowers' issues if issue is older than a given date. see C<datefilter1>. > >-=item * Delete the borrowers who has not borrowered since a given date. see C<datefilter2>. >+=item * Delete the borrowers who has not borrowed since a given date. see C<datefilter2>. > > =back > >@@ -51,9 +51,9 @@ my $cgi = new CGI; > my $params = $cgi->Vars; > > my $step = $params->{step} || 1; >-my $not_borrowered_since = # the date which filter on issue history. >- $params->{not_borrowered_since} >- ? dt_from_string $params->{not_borrowered_since} >+my $not_borrowed_since = # the date which filter on issue history. >+ $params->{not_borrowed_since} >+ ? dt_from_string $params->{not_borrowed_since} > : undef; > my $last_issue_date = # the date which filter on borrowers last issue. > $params->{last_issue_date} >@@ -84,7 +84,7 @@ if ( $step == 2 ) { > my $membersToDelete; > if ( $checkboxes{borrower} ) { > $membersToDelete = GetBorrowersToExpunge( >- _get_selection_params($not_borrowered_since, $borrower_dateexpiry, $borrower_categorycode) >+ _get_selection_params($not_borrowed_since, $borrower_dateexpiry, $borrower_categorycode) > ); > _skip_borrowers_with_nonzero_balance( $membersToDelete ); > $totalDel = scalar @$membersToDelete; >@@ -114,7 +114,7 @@ elsif ( $step == 3 ) { > # delete members > if ($do_delete) { > my $membersToDelete = GetBorrowersToExpunge( >- _get_selection_params($not_borrowered_since, $borrower_dateexpiry, $borrower_categorycode) >+ _get_selection_params($not_borrowed_since, $borrower_dateexpiry, $borrower_categorycode) > ); > _skip_borrowers_with_nonzero_balance( $membersToDelete ); > $totalDel = scalar(@$membersToDelete); >@@ -149,7 +149,7 @@ elsif ( $step == 3 ) { > > $template->param( > step => $step, >- not_borrowered_since => $not_borrowered_since, >+ not_borrowed_since => $not_borrowed_since, > borrower_dateexpiry => $borrower_dateexpiry, > last_issue_date => $last_issue_date, > borrower_categorycodes => GetBorrowercategoryList(), >@@ -169,14 +169,14 @@ sub _skip_borrowers_with_nonzero_balance { > } > > sub _get_selection_params { >- my ($not_borrowered_since, $borrower_dateexpiry, $borrower_categorycode) = @_; >+ my ($not_borrowed_since, $borrower_dateexpiry, $borrower_categorycode) = @_; > > my $params = {}; >- $params->{not_borrowered_since} = output_pref({ >- dt => $not_borrowered_since, >+ $params->{not_borrowed_since} = output_pref({ >+ dt => $not_borrowed_since, > dateformat => 'iso', > dateonly => 1 >- }) if $not_borrowered_since; >+ }) if $not_borrowed_since; > $params->{expired_before} = output_pref({ > dt => $borrower_dateexpiry, > dateformat => 'iso', >-- >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 17949
: 59298