4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Tools › Batch patron deletion/anonymization [% IF step == 2 %]› Confirm[% END %][% IF step == 3 %]› Finished[% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'calendar.inc' %]
8 <script type="text/javascript">
12 * This function check the form is correctly filled.
14 function checkForm(form) {
15 if((form.checkbox[0].checked)){
16 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)){
17 alert(_("Please enter at least one criterion for deletion!"));
21 if((form.checkbox[1].checked)){
22 if(!(form.date2.value)){
23 alert(_("please enter a date!"));
27 if(!form.checkbox[0].checked && !form.checkbox[1].checked) {
28 alert( _("Please check at least one action") );
36 * This function check the form2 is correctly filled.
38 function checkForm2(form) {
42 $(document).ready(function() {
43 $('#selectlibrary').find("input:submit").hide();
44 $('#branch').change(function() {
45 $('#selectlibrary').submit();
52 <body id="tools_cleanborrowers" class="tools">
53 [% INCLUDE 'header.inc' %]
54 [% INCLUDE 'cat-search.inc' %]
56 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% IF step == 1 %]Clean Patron Records[% ELSE %]<a href="/cgi-bin/koha/tools/cleanborrowers.pl">Clean patron records</a> › [% END %][% IF step == 2 %]Confirm[% END %][% IF step == 3 %]Finished[% END %]</div>
58 <div id="doc3" class="yui-t2">
64 <form method="get" action="/cgi-bin/koha/tools/cleanborrowers.pl" id="selectlibrary">
66 <select name="branch" id="branch" style="width:20em;">
67 <option value="*">All libraries</option>
68 [% FOREACH branch IN Branches.all( selected => current_branch ) %]
69 [% IF branch.selected %]
70 <option value="[% branch.branchcode %]" selected="selected">[% branch.branchname %]</option>
72 <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
77 [% IF current_branch == '*' %]
78 <h1>Batch patron deletion/anonymization</h1>
80 <h1>Batch patron deletion/anonymization for [% Branches.GetName( current_branch ) %]</h1>
83 <h1>Batch patron deletion/anonymization for [% Branches.GetName( Branches.GetLoggedInBranchcode ) %]</h1>
90 <p>This tool allows you to delete patrons and anonymize checkout history. For deleting patrons, any combination of limits can be used.</p>
93 <form name="f1" onsubmit="return checkForm(this);" action="/cgi-bin/koha/tools/cleanborrowers.pl" method="post">
95 <legend>Delete patrons</legend>
96 <h3><input id="checkborrower" type="checkbox" name="checkbox" value="borrower" /><label for="checkborrower"> Verify you want to delete patrons</label></h3>
98 <h5>Delete patrons who meet the following criteria:</h5>
101 <label for="date1">who have not borrowed since:</label>
102 <input size="10" id="date1" name="not_borrowed_since" type="text" class="datepicker" />
103 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
106 <label for="borrower_dateexpiry">whose expiration date is before:</label>
107 <input size="10" id="borrower_dateexpiry" name="borrower_dateexpiry" type="text" class="datepicker" />
108 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
110 [% IF Koha.Preference('TrackLastPatronActivity') %]
112 <label for="borrower_lastseen">who have not been connected since:</label>
113 <input size="10" id="borrower_lastseen" name="borrower_lastseen" type="text" class="datepicker" />
114 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
118 <label for="borrower_categorycode">whose patron category is:</label>
119 <select id="borrower_categorycode" name="borrower_categorycode">
120 <option value="" selected="selected">Any</option>
121 [% FOREACH bc IN borrower_categorycodes %]
122 [% UNLESS bc.category_type == 'S' %]
123 <option value="[% bc.categorycode %]">[% bc.description %]</option>
128 [% IF patron_lists %]
130 <label for="patron_list_id">who are in patron list: </label>
131 <select id="patron_list_id" name="patron_list_id">
132 <option value=""></option>
133 [% FOREACH pl IN patron_lists %]
134 <option value="[% pl.patron_list_id %]">[% pl.name %]</option>
143 <legend>Anonymize checkout history</legend>
144 [% UNLESS Koha.Preference('AnonymousPatron') %]
145 <div class="dialog message">The AnonymousPatron system preference is not defined. You can use this feature anyway but NULL will be used to update the checkout history.</div>
147 <h3><input id="checkissue" type="checkbox" name="checkbox" value="issue" /><label for="checkissue"> Verify you want to anonymize patron checkout history</label></h3>
151 <label for="date2">Permanently delete checkout history older than</label>
152 <input size="10" id="date2" name="last_issue_date" type="text" class="datepicker" />
153 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
158 <input type="hidden" name="step" value="2" />
159 <input type="hidden" name="branch" value="[% current_branch %]" />
161 <fieldset class="action"><input type="submit" value="Next >>" /></fieldset>
168 <!-- STEP 2 START -->
170 <form name="f2" action="/cgi-bin/koha/tools/cleanborrowers.pl" method="post" onsubmit="return checkForm2(this);">
172 <legend>Warnings</legend>
174 <li>[% patrons_to_delete.size || 0 %] patrons will be deleted</li>
175 <li>[% patrons_to_anonymize.size || 0 %] patron's checkout histories will be anonymized</li>
179 [% IF patrons_to_delete.size %]
180 <fieldset><legend>What do you want to do for deleted patrons?</legend>
181 <input id="delete" type="radio" name="radio" value="delete" />
182 <label for="delete">Permanently delete these patrons</label>
184 <br /><input id="trash" type="radio" name="radio" value="trash" />
185 <label for="trash">Move these patrons to the trash</label>
187 <br /><input id="testrun" type="radio" name="radio" value="testrun" checked="checked" />
188 <label for="testrun">Do not remove any patrons (test run)</label>
189 <input type="hidden" name="do_delete" value="[% patrons_to_delete.size %]" /></fieldset>
192 [% IF patrons_to_anonymize.size %]
193 Checkout history for [% patrons_to_anonymize.size %] patrons will be anonymized
194 <input type="hidden" name="do_anonym" value="[% patrons_to_anonymize.size %]" />
197 <input type="hidden" name="step" value="3" />
198 <input type="hidden" name="not_borrowed_since" value="[% not_borrowed_since | $KohaDates %]" />
199 <input type="hidden" name="last_issue_date" value="[% last_issue_date | $KohaDates %]" />
200 <input type="hidden" name="borrower_dateexpiry" value="[% borrower_dateexpiry | $KohaDates %]" />
201 [% IF Koha.Preference('TrackLastPatronActivity') %]
202 <input type="hidden" name="borrower_lastseen" value="[% borrower_lastseen | $KohaDates %]" />
204 <input type="hidden" name="borrower_categorycode" value="[% borrower_categorycode %]" />
205 <input type="hidden" name="patron_list_id" value="[% patron_list_id %]" />
206 <input type="hidden" name="branch" value="[% current_branch %]" />
208 <fieldset class="action"><input type="submit" value="Finish" /> <a class="cancel" href="/cgi-bin/koha/tools/cleanborrowers.pl">Cancel</a></fieldset>
215 <!-- Step 3 START -->
219 <h4>[% TotalDel %] patrons would have been removed (if it wasn't a test run)</h4>
220 <h4>No patron records have been actually removed</h4>
222 [% IF ( do_delete ) %]
224 <h4>[% TotalDel %] patrons have been successfully moved to trash</h4>
226 <h4>[% TotalDel %] patrons have been successfully deleted</h4>
229 <h4>No patron records have been removed</h4>
232 [% IF ( do_anonym ) %]
233 <h4>All checkouts older than [% last_issue_date | $KohaDates %] have been anonymized</h4>
235 <h4>No patron records have been anonymized</h4>
244 <div class="yui-b noprint">
245 [% INCLUDE 'tools-menu.inc' %]
248 [% INCLUDE 'intranet-bottom.inc' %]