Bugzilla – Attachment 51410 Details for
Bug 16276
When automatically deleting expired borrowers, make sure they didn't log in recently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16276: Make the batch patron deletion tool deal with last_seen
Bug-16276-Make-the-batch-patron-deletion-tool-deal.patch (text/plain), 5.94 KB, created by
Nicolas Legrand
on 2016-05-11 10:27:38 UTC
(
hide
)
Description:
Bug 16276: Make the batch patron deletion tool deal with last_seen
Filename:
MIME Type:
Creator:
Nicolas Legrand
Created:
2016-05-11 10:27:38 UTC
Size:
5.94 KB
patch
obsolete
>From 204d3b3d6b68b56861cf17a0f9a2265c50214e39 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sun, 24 Apr 2016 17:51:56 +0100 >Subject: [PATCH] Bug 16276: Make the batch patron deletion tool deal with > last_seen > >This patch adds the same change as the previous one to the batch patron >deletion tool. > >If the pref TrackLastPatronActivity is enabled, the librarians will be >able to delete patrons who do not have been connected since a given >time. > >Test plan: >Define a date for the "who have not been connected since" options and >confirm that it works as expected. > >Sponsored-by: BULAC - http://www.bulac.fr/ >Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> > >https://bugs.koha-community.org/show_bug.cgi?id=12276 >--- > .../intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt | 12 +++++++++++- > tools/cleanborrowers.pl | 15 +++++++++++++-- > 2 files changed, 24 insertions(+), 3 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 9e68141..ac65949 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >@@ -12,7 +12,7 @@ > */ > function checkForm(form) { > if((form.checkbox[0].checked)){ >- if ( (!form.date1.value) && (!form.borrower_dateexpiry.value) && (!form.borrower_categorycode.value) && (!form.patron_list_id.value)){ >+ if ( (!form.date1.value) && (!form.borrower_dateexpiry.value) [% IF Koha.Preference('TrackLastPatronActivity') %]&& (!form.borrower_lastseen.value) [% END %]&& (!form.borrower_categorycode.value) && (!form.patron_list_id.value)){ > alert(_("Please enter at least one criterion for deletion!")); > return false; > } >@@ -77,6 +77,13 @@ > <input size="10" id="borrower_dateexpiry" name="borrower_dateexpiry" type="text" class="datepicker" /> > <span class="hint">[% INCLUDE 'date-format.inc' %]</span> > </li> >+ [% IF Koha.Preference('TrackLastPatronActivity') %] >+ <li> >+ <label for="borrower_lastseen">who have not been connected since:</label> >+ <input size="10" id="borrower_lastseen" name="borrower_lastseen" type="text" class="datepicker" /> >+ <span class="hint">[% INCLUDE 'date-format.inc' %]</span> >+ </li> >+ [% END %] > <li> > <label for="borrower_categorycode">whose patron category is:</label> > <select id="borrower_categorycode" name="borrower_categorycode"> >@@ -160,6 +167,9 @@ > <input type="hidden" name="not_borrowed_since" value="[% not_borrowed_since | $KohaDates %]" /> > <input type="hidden" name="last_issue_date" value="[% last_issue_date | $KohaDates %]" /> > <input type="hidden" name="borrower_dateexpiry" value="[% borrower_dateexpiry | $KohaDates %]" /> >+ [% IF Koha.Preference('TrackLastPatronActivity') %] >+ <input type="hidden" name="borrower_lastseen" value="[% borrower_lastseen | $KohaDates %]" /> >+ [% END %] > <input type="hidden" name="borrower_categorycode" value="[% borrower_categorycode %]" /> > <input type="hidden" name="patron_list_id" value="[% patron_list_id %]" /> > </fieldset> >diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl >index d108d53..cc2c3bc 100755 >--- a/tools/cleanborrowers.pl >+++ b/tools/cleanborrowers.pl >@@ -64,6 +64,10 @@ my $borrower_dateexpiry = > $params->{borrower_dateexpiry} > ? dt_from_string $params->{borrower_dateexpiry} > : undef; >+my $borrower_lastseen = >+ $params->{borrower_lastseen} >+ ? dt_from_string $params->{borrower_lastseen} >+ : undef; > my $patron_list_id = $params->{patron_list_id}; > > my $borrower_categorycode = $params->{'borrower_categorycode'} || q{}; >@@ -88,6 +92,7 @@ if ( $step == 2 ) { > _get_selection_params( > $not_borrowed_since, > $borrower_dateexpiry, >+ $borrower_lastseen, > $borrower_categorycode, > $patron_list_id, > ) >@@ -117,7 +122,7 @@ elsif ( $step == 3 ) { > if ($do_delete) { > my $patrons_to_delete = GetBorrowersToExpunge( > _get_selection_params( >- $not_borrowed_since, $borrower_dateexpiry, >+ $not_borrowed_since, $borrower_dateexpiry, $borrower_lastseen, > $borrower_categorycode, $patron_list_id > ) > ); >@@ -165,6 +170,7 @@ $template->param( > step => $step, > not_borrowed_since => $not_borrowed_since, > borrower_dateexpiry => $borrower_dateexpiry, >+ borrower_lastseen => $borrower_lastseen, > last_issue_date => $last_issue_date, > borrower_categorycodes => GetBorrowercategoryList(), > borrower_categorycode => $borrower_categorycode, >@@ -183,7 +189,7 @@ sub _skip_borrowers_with_nonzero_balance { > } > > sub _get_selection_params { >- my ($not_borrowed_since, $borrower_dateexpiry, $borrower_categorycode, $patron_list_id) = @_; >+ my ($not_borrowed_since, $borrower_dateexpiry, $borrower_lastseen, $borrower_categorycode, $patron_list_id) = @_; > > my $params = {}; > $params->{not_borrowed_since} = output_pref({ >@@ -196,6 +202,11 @@ sub _get_selection_params { > dateformat => 'iso', > dateonly => 1 > }) if $borrower_dateexpiry; >+ $params->{last_seen} = output_pref({ >+ dt => $borrower_lastseen, >+ dateformat => 'iso', >+ dateonly => 1 >+ }) if $borrower_lastseen; > $params->{category_code} = $borrower_categorycode if $borrower_categorycode; > $params->{patron_list_id} = $patron_list_id if $patron_list_id; > >-- >2.1.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 16276
:
50615
|
50616
|
50617
|
50618
|
50619
|
50620
|
51191
|
51407
|
51408
|
51409
|
51410
|
51411
|
51412
|
54588
|
54589
|
54590
|
54591
|
54592
|
54612
|
54613
|
54614
|
54615
|
54616
|
54617
|
54618
|
54619
|
54620
|
54621
|
54622
|
54623
|
54624
|
54625
|
55495
|
55496
|
55497
|
55498
|
55499
|
55500
|
55501