Bugzilla – Attachment 49770 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]
[PASSED QA] Bug 10612: (QA followup)
PASSED-QA-Bug-10612-QA-followup.patch (text/plain), 7.52 KB, created by
Katrin Fischer
on 2016-04-01 05:52:10 UTC
(
hide
)
Description:
[PASSED QA] Bug 10612: (QA followup)
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-04-01 05:52:10 UTC
Size:
7.52 KB
patch
obsolete
>From 47c268639050554aac15ccd65e1db440689a63be Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 31 Mar 2016 15:53:31 +0000 >Subject: [PATCH] [PASSED QA] Bug 10612: (QA followup) > >Rename not_borrowered_since to not_borrowed_since > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Members.pm | 4 ++-- > misc/cronjobs/delete_patrons.pl | 2 +- > t/db_dependent/Members.t | 6 +++--- > tools/cleanborrowers.pl | 22 +++++++++++----------- > 4 files changed, 17 insertions(+), 17 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index ad42335..ed82f86 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -1738,7 +1738,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, > patron_list_id => $patron_list_id, >@@ -1752,7 +1752,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 c05126f..a76d1dd 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/t/db_dependent/Members.t b/t/db_dependent/Members.t >index b590ed9..e369128 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -313,7 +313,7 @@ $patstodel = GetBorrowersToExpunge( {branchcode => $library3->{branchcode},patro > ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Staff patron not deleted by branchcode and list'); > $patstodel = GetBorrowersToExpunge( {expired_before => '2015-01-02', patron_list_id => $list1->patron_list_id() } ); > ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Staff patron not deleted by expirationdate and list'); >-$patstodel = GetBorrowersToExpunge( {not_borrowered_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } ); >+$patstodel = GetBorrowersToExpunge( {not_borrowed_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } ); > ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Staff patron not deleted by last issue date'); > > ModMember( borrowernumber => $bor1inlist, categorycode => 'CIVILIAN' ); >@@ -325,7 +325,7 @@ $patstodel = GetBorrowersToExpunge( {branchcode => $library3->{branchcode},patro > ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Guarantor patron not deleted by branchcode and list'); > $patstodel = GetBorrowersToExpunge( {expired_before => '2015-01-02', patron_list_id => $list1->patron_list_id() } ); > ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Guarantor patron not deleted by expirationdate and list'); >-$patstodel = GetBorrowersToExpunge( {not_borrowered_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } ); >+$patstodel = GetBorrowersToExpunge( {not_borrowed_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } ); > ok( scalar(@$patstodel) == 1 && $patstodel->[0]->{'borrowernumber'} eq $bor2inlist,'Guarantor patron not deleted by last issue date'); > ModMember( borrowernumber => $guarantee->{borrowernumber}, guarantorid=>'' ); > >@@ -350,7 +350,7 @@ $patstodel = GetBorrowersToExpunge( {category_code => 'CIVILIAN',patron_list_id > is( scalar(@$patstodel),2,'Borrowers without issues deleted by category_code and list'); > $patstodel = GetBorrowersToExpunge( {expired_before => '2015-01-02',patron_list_id => $list1->patron_list_id() } ); > is( scalar(@$patstodel),2,'Borrowers without issues deleted by expiration_date and list'); >-$patstodel = GetBorrowersToExpunge( {not_borrowered_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } ); >+$patstodel = GetBorrowersToExpunge( {not_borrowed_since => '2016-01-02', patron_list_id => $list1->patron_list_id() } ); > is( scalar(@$patstodel),2,'Borrowers without issues deleted by last issue date'); > > >diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl >index 0214729..d108d53 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 > >@@ -52,9 +52,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} >@@ -86,7 +86,7 @@ if ( $step == 2 ) { > if ( $checkboxes{borrower} ) { > $patrons_to_delete = GetBorrowersToExpunge( > _get_selection_params( >- $not_borrowered_since, >+ $not_borrowed_since, > $borrower_dateexpiry, > $borrower_categorycode, > $patron_list_id, >@@ -117,7 +117,7 @@ elsif ( $step == 3 ) { > if ($do_delete) { > my $patrons_to_delete = GetBorrowersToExpunge( > _get_selection_params( >- $not_borrowered_since, $borrower_dateexpiry, >+ $not_borrowed_since, $borrower_dateexpiry, > $borrower_categorycode, $patron_list_id > ) > ); >@@ -163,7 +163,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(), >@@ -183,14 +183,14 @@ sub _skip_borrowers_with_nonzero_balance { > } > > sub _get_selection_params { >- my ($not_borrowered_since, $borrower_dateexpiry, $borrower_categorycode, $patron_list_id) = @_; >+ my ($not_borrowed_since, $borrower_dateexpiry, $borrower_categorycode, $patron_list_id) = @_; > > 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', >-- >1.9.1
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