From e1b740c9aa7ee21a02d3255a764c6a76f22c262b Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 31 Mar 2016 15:53:31 +0000 Subject: [PATCH] Bug 10612: (QA followup) Rename not_borrowered_since to not_borrowed_since --- 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. -=item * Delete the borrowers who has not borrowered since a given date. see C. +=item * Delete the borrowers who has not borrowed since a given date. see C. =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', -- 2.1.4