Bug 7720: add options for controlling display of an item's home and/or holdings location
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / cleanborrowers.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Tools &rsaquo; Batch patron deletion/anonymization [% IF step == 2 %]&rsaquo; Confirm[% END %][% IF step == 3 %]&rsaquo; Finished[% END %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'calendar.inc' %]
6 <script type="text/javascript">
7 // <![CDATA[
8         /**
9          *  checkForm(form)
10          *  This function check the form is correctly filled.
11          */
12           function checkForm(form) {
13               if((form.checkbox[0].checked)){
14                   if ( (!form.date1.value) && (!form.borrower_dateexpiry.value) && (!form.borrower_categorycode.value) ){
15                     alert(_("Please enter at least one criterion for deletion!"));
16                     return false;
17                   }
18               }
19               if((form.checkbox[1].checked)){
20                   if(!(form.date2.value)){
21                       alert(_("please enter a date !"));
22                       return false;
23                   }
24               }
25               if(!form.checkbox[0].checked && !form.checkbox[1].checked) {
26                 alert( _("Please check at least one action") );
27                 return false;
28               }
29               return true;
30           }
31
32         /**
33          *  checkForm2(form)
34          *  This function check the form2 is correctly filled.
35          */
36           function checkForm2(form) {
37               return true;
38           }
39      // ]]>
40 </script>
41
42 </head>
43 <body id="tools_cleanborrowers" class="tools">
44 [% INCLUDE 'header.inc' %]
45 [% INCLUDE 'cat-search.inc' %]
46
47 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>  &rsaquo; [% IF step == 1 %]Clean Patron Records[% ELSE %]<a href="/cgi-bin/koha/tools/cleanborrowers.pl">Clean patron records</a> &rsaquo; [% END %][% IF step == 2 %]Confirm[% END %][% IF step == 3 %]Finished[% END %]</div>
48
49 <div id="doc3" class="yui-t2">
50
51    <div id="bd">
52     <div id="yui-main">
53     <div class="yui-b">
54
55 <h1>Batch patron deletion/anonymization</h1>
56 <div class="help">
57     <p>This tool allows you to delete patrons and anonymize checkout history. For deleting patrons, any combination of limits can be used.</p>
58 </div>
59 [% IF step == 1 %]
60 <!-- step 1 START -->
61 <div id="step1">
62     <form name="f1" onsubmit="return checkForm(this);" action="/cgi-bin/koha/tools/cleanborrowers.pl" method="post">
63     <fieldset>
64     <legend>Delete patrons</legend>
65         <h3><input id="checkborrower" type="checkbox" name="checkbox" value="borrower" /><label for="checkborrower"> Verify you want to delete patrons</label></h3>
66         <br />
67         <h5>Delete patrons who meet the following criteria:</h5>
68         <ul>
69                 <li>
70                     <label for="date1">who have not borrowed since:</label>
71                     <input size="10" id="date1" name="not_borrowed_since" type="text" class="datepicker" />
72                     <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
73                 </li>
74                 <li>
75                     <label for="borrower_dateexpiry">whose expiration date is before:</label>
76                     <input size="10" id="borrower_dateexpiry" name="borrower_dateexpiry" type="text" class="datepicker" />
77                     <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
78                 </li>
79                 <li>
80                     <label for="borrower_categorycode">whose patron category is:</label>
81                     <select id="borrower_categorycode" name="borrower_categorycode">
82                         <option value="" selected="selected">Any</option>
83                         [% FOREACH bc IN borrower_categorycodes %]
84                             [% UNLESS ( bc.categorycode == 'S' || bc.category_type == 'S' ) %]
85                                 <option value="[% bc.categorycode %]">[% bc.description %]</option>
86                             [% END %]
87                         [% END %]
88                     </select>
89                 </li>
90             </ul>
91         </fieldset>
92         <fieldset>
93         <legend>Anonymize checkout history</legend>
94         <h3><input id="checkissue" type="checkbox" name="checkbox" value="issue" /><label for="checkissue"> Verify you want to anonymize patron checkout history</label></h3>
95         <br />
96         <ul>
97             <li>
98                 <label for="date2">Permanently delete checkout history older than</label>
99                 <input size="10" id="date2" name="last_issue_date" type="text" class="datepicker" />
100                 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
101             </li>
102         </ul>
103
104             <!-- hidden here -->
105             <input type="hidden" name="step" value="2" />
106             </fieldset>
107             <fieldset class="action"><input type="submit" value="Next &gt;&gt;" /></fieldset>
108     </form>
109 </div>
110 <!-- step 1 END -->
111 [% END %]
112
113 [% IF step == 2 %]
114 <!-- STEP 2 START -->
115 <div id="step2">
116         <form name="f2" action="/cgi-bin/koha/tools/cleanborrowers.pl" method="post" onsubmit="return checkForm2(this);">
117     <fieldset>
118         <legend>Warnings</legend>
119         <ul>
120             <li>[% IF ( totalToDelete ) %][% totalToDelete %] [% ELSE %]0 [% END %] patrons will be deleted</li>
121             <li>[% IF ( totalToAnonymize ) %][% totalToAnonymize %] [% ELSE %]0 [% END %] checkout history will be anonymized</li>
122         </ul>
123
124         <br />
125             [% IF ( totalToDelete ) %]
126                 <fieldset><legend>What do you want to do for deleted patrons?</legend>
127                 <input id="delete" type="radio" name="radio" value="delete" />
128                 <label for="delete">Permanently delete these patrons</label>
129
130                 <br /><input id="trash" type="radio" name="radio" value="trash" />
131                 <label for="trash">Move these patrons to the trash</label>
132
133                 <br /><input id="testrun" type="radio" name="radio" value="testrun" checked="checked" />
134                 <label for="testrun">Do not remove any patrons (test run)</label>
135                 <input type="hidden" name="do_delete" value="[% totalToDelete %]" /></fieldset>
136
137             [% END %]
138             [% IF ( totalToAnonymize ) %]
139                 Checkout history for [% totalToAnonymize %] patrons will be anonymized
140                 <input type="hidden" name="do_anonym" value="[% totalToAnonymize %]" />
141             [% END %]
142
143             <input type="hidden" name="step" value="3" />
144             <input type="hidden" name="not_borrowed_since" value="[% not_borrowed_since | $KohaDates %]" />
145             <input type="hidden" name="last_issue_date" value="[% last_issue_date | $KohaDates %]" />
146             <input type="hidden" name="borrower_dateexpiry" value="[% borrower_dateexpiry | $KohaDates %]" />
147             <input type="hidden" name="borrower_categorycode" value="[% borrower_categorycode %]" />
148     </fieldset>
149     <fieldset class="action"><input type="submit" value="Finish" /> <a class="cancel" href="/cgi-bin/koha/tools/cleanborrowers.pl">Cancel</a></fieldset>
150         </form>
151 </div>
152 <!-- STEP 2 END -->
153 [% END %]
154
155 [% IF step == 3 %]
156 <!-- Step 3 START -->
157
158     <div id="step3">
159         [% IF ( testrun ) %]
160             <h4>[% TotalDel %] patrons would have been removed (if it wasn't a test run)</h4>
161             <h4>No patron records have been actually removed</h4>
162         [% ELSE %]
163             [% IF ( do_delete ) %]
164                 [% IF ( trash ) %]
165                     <h4>[% TotalDel %] patrons have been successfully moved to trash</h4>
166                 [% ELSE %]
167                     <h4>[% TotalDel %] patrons have been successfully deleted</h4>
168                 [% END %]
169             [% ELSE %]
170                 <h4>No patron records have been removed</h4>
171             [% END %]
172         [% END %]
173         [% IF ( do_anonym ) %]
174             <h4>All patrons with checkouts older than [% last_issue_date | $KohaDates %] have been anonymized</h4>
175         [% ELSE %]
176             <h4>No patron records have been anonymized</h4>
177         [% END %]
178
179     </div>
180 <!-- Step 3 END -->
181 [% END %]
182
183 </div>
184 </div>
185 <div class="yui-b noprint">
186 [% INCLUDE 'tools-menu.inc' %]
187 </div>
188 </div>
189 [% INCLUDE 'intranet-bottom.inc' %]