Merge branch 'bug_8660' into 3.12-master
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / cleanborrowers.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; Clean patron records [% IF ( step2 ) %]&rsaquo; Confirm[% END %][% IF ( step3 ) %]&rsaquo; Finished[% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <script type="text/javascript">
6 // <![CDATA[
7         /**
8          *  checkForm(form)
9          *  This function check the form is correctly filled.
10          */
11           function checkForm(form) {
12               if((form.checkbox[0].checked)){
13                   if(!(form.date1.value)){
14                     alert(_("please enter a date !"));
15                     document.form.date1.focus();
16                     return false;
17                   }
18               }
19               if((form.checkbox[1].checked)){
20                   if(!(form.date2.value)){
21                       alert(_("please enter a date !"));
22                       document.form.date2.focus();
23                       return false;
24                   }
25               }
26               return true;
27           }
28           
29         /**
30          *  checkForm2(form)
31          *  This function check the form2 is correctly filled.
32          */
33           function checkForm2(form) {
34               return true;
35           }
36      // ]]>
37 </script>
38
39 </head>
40 <body id="tools_cleanborrowers" class="tools">
41 [% INCLUDE 'header.inc' %]
42 [% INCLUDE 'cat-search.inc' %]
43
44 <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 ( step1 ) %]Clean Patron Records[% ELSE %]<a href="/cgi-bin/koha/tools/cleanborrowers.pl">Clean patron records</a> &rsaquo; [% END %][% IF ( step2 ) %]Confirm[% END %][% IF ( step3 ) %]Finished[% END %]</div>
45
46 <div id="doc3" class="yui-t2">
47    
48    <div id="bd">
49         <div id="yui-main">
50         <div class="yui-b">
51
52 <h1>Delete some old patrons/Anonymize some check-out history</h1>
53
54 [% IF ( step1 ) %]
55 <!-- step 1 START -->
56 <div id="step1">
57     <form name="f1" onsubmit="return checkForm(this);" action="/cgi-bin/koha/tools/cleanborrowers.pl" method="post">
58     <fieldset>
59     <legend>What do you want to do ?</legend>
60         <p><input id="checkborrower" type="checkbox" name="checkbox" value="borrower" checked="checked" />
61         <label for="checkborrower">Delete borrower who has not borrowed since:</label>
62         <input size="10" id="date1" name="filterdate1" value="[% filterdate1 %]" type="text" class="datepicker" />
63         <span class="hint">[% INCLUDE 'date-format.inc' %]</span></p>
64
65         <p><input id="checkissue" type="checkbox" name="checkbox" value="issue" checked="checked" />
66         <label for="checkissue">Anonymize check-out history older than</label>
67         <input size="10" id="date2" name="filterdate2" value="[% filterdate2 %]" type="text" class="datepicker" />
68         <span class="hint">[% INCLUDE 'date-format.inc' %]</span></p>
69
70             <!-- hidden here -->
71             <input type="hidden" name="step2" value="1" />
72                         </fieldset>
73             <fieldset class="action"><input type="submit" value="Next &gt;&gt;" /></fieldset>
74     </form>
75 </div>
76 <!-- step 1 END -->
77 [% END %]
78
79 [% IF ( step2 ) %]
80 <!-- STEP 2 START -->
81 <div id="step2">
82         <form name="f2" action="/cgi-bin/koha/tools/cleanborrowers.pl" method="post" onsubmit="return checkForm2(this);">
83     <fieldset>
84         <legend>Warnings</legend>
85
86                 <ul>
87                         <li>[% IF ( totalToDelete ) %][% totalToDelete %] [% ELSE %]0 [% END %] patrons will be deleted</li>
88                         <li>[% IF ( totalToAnonymize ) %][% totalToAnonymize %] [% ELSE %]0 [% END %] check-out history will be anonymized</li>
89                 </ul>
90
91         <br />
92             [% IF ( totalToDelete ) %]
93                 <fieldset><legend>What do you want to do for deleted patrons?</legend>
94                 <label for="delete">Permanently delete these patrons</label>
95                 <input id="delete" type="radio" name="radio" value="delete" checked="checked" />
96                 
97                 <label for="trash">Move these patrons to the trash</label>
98                 <input id="trash" type="radio" name="radio" value="trash" />
99                 <input type="hidden" name="do_delete" value="[% totalToDelete %]" /></fieldset>
100
101             [% END %]
102             [% IF ( totalToAnonymize ) %]
103
104                 Check-out history for [% totalToAnonymize %] patrons will be anonymized
105                 <input type="hidden" name="do_anonym" value="[% totalToAnonymize %]" />
106             [% END %]
107                
108             <input type="hidden" name="step3" value="1" />
109             <input type="hidden" name="filterdate1" value="[% filterdate1 %]" />
110             <input type="hidden" name="filterdate2" value="[% filterdate2 %]" />
111     </fieldset>
112         <fieldset class="action"><input type="submit" value="Finish" /> <a class="cancel" href="/cgi-bin/koha/tools/cleanborrowers.pl">Cancel</a></fieldset>
113         </form>
114 </div>
115 <!-- STEP 2 END -->
116 [% END %]
117
118 [% IF ( step3 ) %]
119 <!-- Step 3 START -->
120
121     <div id="step3">
122
123           [% IF ( do_delete ) %]
124                 [% IF ( trash ) %]
125                     <h4>[% TotalDel %] patrons have been successfully moved to trash</h4>
126                 [% ELSE %]
127                     <h4>[% TotalDel %] patrons have been successfully deleted</h4>
128                 [% END %]
129                         [% ELSE %]
130                                 <h4>No patron records have been removed</h4>
131             [% END %]
132             [% IF ( do_anonym ) %]
133                 <h4>All patrons with checkouts older than [% filterdate1 %] have been anonymized</h4>
134                         [% ELSE %]
135                                 <h4>No patron records have been anonymized</h4>
136             [% END %]
137
138     </div>
139 <!-- Step 3 END -->
140 [% END %]
141
142 </div>
143 </div>
144 <div class="yui-b noprint">
145 [% INCLUDE 'tools-menu.inc' %]
146 </div>
147 </div>
148 [% INCLUDE 'intranet-bottom.inc' %]