Bugzilla – Attachment 55498 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.90 KB, created by
Jonathan Druart
on 2016-09-12 15:07:32 UTC
(
hide
)
Description:
Bug 16276: Make the batch patron deletion tool deal with last_seen
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-09-12 15:07:32 UTC
Size:
5.90 KB
patch
obsolete
>From bcf6f92e37bbcdf9aa7fff1501fd4f6e29eb6900 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 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt | 12 +++++++++++- > tools/cleanborrowers.pl | 14 +++++++++++++- > 2 files changed, 24 insertions(+), 2 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 7ff66d6..dc78a06 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt >@@ -13,7 +13,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; > } >@@ -107,6 +107,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"> >@@ -191,6 +198,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 %]" /> > <input type="hidden" name="branch" value="[% current_branch %]" /> >diff --git a/tools/cleanborrowers.pl b/tools/cleanborrowers.pl >index 5d392a5..1b7e0f8 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{}; >@@ -92,6 +96,7 @@ if ( $step == 2 ) { > _get_selection_params( > $not_borrowed_since, > $borrower_dateexpiry, >+ $borrower_lastseen, > $borrower_categorycode, > $patron_list_id, > $branch >@@ -128,6 +133,7 @@ elsif ( $step == 3 ) { > _get_selection_params( > $not_borrowed_since, > $borrower_dateexpiry, >+ $borrower_lastseen, > $borrower_categorycode, > $patron_list_id, > $branch >@@ -179,6 +185,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 => $patron_categories, > borrower_categorycode => $borrower_categorycode, >@@ -197,7 +204,7 @@ sub _skip_borrowers_with_nonzero_balance { > } > > sub _get_selection_params { >- my ($not_borrowed_since, $borrower_dateexpiry, >+ my ($not_borrowed_since, $borrower_dateexpiry, $borrower_lastseen, > $borrower_categorycode, $patron_list_id, $branch) = @_; > > my $params = {}; >@@ -211,6 +218,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.8.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 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