5aa1865361d71a3446e38d503948e91dc0951c7c
[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) && (!form.borrower_dateexpiry.value) && (!form.borrower_categorycode.value) ){
14                     alert(_("Please enter at least one criterion for deletion!"));
15                     return false;
16                   }
17               }
18               if((form.checkbox[1].checked)){
19                   if(!(form.date2.value)){
20                       alert(_("please enter a date !"));
21                       return false;
22                   }
23               }
24               return true;
25           }
26           
27         /**
28          *  checkForm2(form)
29          *  This function check the form2 is correctly filled.
30          */
31           function checkForm2(form) {
32               return true;
33           }
34      // ]]>
35 </script>
36
37 </head>
38 <body id="tools_cleanborrowers" class="tools">
39 [% INCLUDE 'header.inc' %]
40 [% INCLUDE 'cat-search.inc' %]
41
42 <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>
43
44 <div id="doc3" class="yui-t2">
45    
46    <div id="bd">
47         <div id="yui-main">
48         <div class="yui-b">
49
50 <h1>Delete some old patrons/Anonymize some check-out history</h1>
51
52 [% IF ( step1 ) %]
53 <!-- step 1 START -->
54 <div id="step1">
55     <form name="f1" onsubmit="return checkForm(this);" action="/cgi-bin/koha/tools/cleanborrowers.pl" method="post">
56     <fieldset>
57     <legend>What do you want to do ?</legend>
58         <h3><input id="checkborrower" type="checkbox" name="checkbox" value="borrower" /><label for="checkborrower"> Delete borrowers</label></h3>
59
60         <label for="date1">Who have not borrowed since:</label>
61         <input size="10" id="date1" name="filterdate1" type="text" class="datepicker" />
62         <span class="hint">[% INCLUDE 'date-format.inc' %]</span></p>
63
64         <label for="borrower_dateexpiry">Whose expiration date is before:</label>
65         <input size="10" id=borrower_dateexpiry" name="borrower_dateexpiry" type="text" class="datepicker" />
66         <span class="hint">[% INCLUDE 'date-format.inc' %]</span></p>
67
68         <label for="borrower_categorycode">Whose patron category is:</label>
69         <select id="borrower_categorycode" name="borrower_categorycode">
70             <option value="" selected="selected">Any</option>
71             [% FOREACH bc IN borrower_categorycodes %]
72                 [% UNLESS bc.categorycode == 'S' %]
73                     <option value="[% bc.categorycode %]">[% bc.description %]</option>
74                 [% END %]
75             [% END %]
76         </select>
77
78         <h3><input id="checkissue" type="checkbox" name="checkbox" value="issue" /><label for="checkissue"> Anonymize history</label></h3>
79         <label for="date2">Anonymize check-out history older than</label>
80         <input size="10" id="date2" name="filterdate2" type="text" class="datepicker" />
81         <span class="hint">[% INCLUDE 'date-format.inc' %]</span></p>
82
83             <!-- hidden here -->
84             <input type="hidden" name="step2" value="1" />
85                         </fieldset>
86             <fieldset class="action"><input type="submit" value="Next &gt;&gt;" /></fieldset>
87     </form>
88 </div>
89 <!-- step 1 END -->
90 [% END %]
91
92 [% IF ( step2 ) %]
93 <!-- STEP 2 START -->
94 <div id="step2">
95         <form name="f2" action="/cgi-bin/koha/tools/cleanborrowers.pl" method="post" onsubmit="return checkForm2(this);">
96     <fieldset>
97         <legend>Warnings</legend>
98
99                 <ul>
100                         <li>[% IF ( totalToDelete ) %][% totalToDelete %] [% ELSE %]0 [% END %] patrons will be deleted</li>
101                         <li>[% IF ( totalToAnonymize ) %][% totalToAnonymize %] [% ELSE %]0 [% END %] check-out history will be anonymized</li>
102                 </ul>
103
104         <br />
105             [% IF ( totalToDelete ) %]
106                 <fieldset><legend>What do you want to do for deleted patrons?</legend>
107                 <label for="delete">Permanently delete these patrons</label>
108                 <input id="delete" type="radio" name="radio" value="delete" checked="checked" />
109                 
110                 <label for="trash">Move these patrons to the trash</label>
111                 <input id="trash" type="radio" name="radio" value="trash" />
112                 <input type="hidden" name="do_delete" value="[% totalToDelete %]" /></fieldset>
113
114             [% END %]
115             [% IF ( totalToAnonymize ) %]
116
117                 Check-out history for [% totalToAnonymize %] patrons will be anonymized
118                 <input type="hidden" name="do_anonym" value="[% totalToAnonymize %]" />
119             [% END %]
120                
121             <input type="hidden" name="step3" value="1" />
122             <input type="hidden" name="filterdate1" value="[% filterdate1 %]" />
123             <input type="hidden" name="filterdate2" value="[% filterdate2 %]" />
124             <input type="hidden" name="borrower_dateexpiry" value="[% borrower_dateexpiry %]" />
125             <input type="hidden" name="borrower_categorycode" value="[% borrower_categorycode %]" />
126     </fieldset>
127         <fieldset class="action"><input type="submit" value="Finish" /> <a class="cancel" href="/cgi-bin/koha/tools/cleanborrowers.pl">Cancel</a></fieldset>
128         </form>
129 </div>
130 <!-- STEP 2 END -->
131 [% END %]
132
133 [% IF ( step3 ) %]
134 <!-- Step 3 START -->
135
136     <div id="step3">
137
138           [% IF ( do_delete ) %]
139                 [% IF ( trash ) %]
140                     <h4>[% TotalDel %] patrons have been successfully moved to trash</h4>
141                 [% ELSE %]
142                     <h4>[% TotalDel %] patrons have been successfully deleted</h4>
143                 [% END %]
144                         [% ELSE %]
145                                 <h4>No patron records have been removed</h4>
146             [% END %]
147             [% IF ( do_anonym ) %]
148                 <h4>All patrons with checkouts older than [% filterdate1 %] have been anonymized</h4>
149                         [% ELSE %]
150                                 <h4>No patron records have been anonymized</h4>
151             [% END %]
152
153     </div>
154 <!-- Step 3 END -->
155 [% END %]
156
157 </div>
158 </div>
159 <div class="yui-b noprint">
160 [% INCLUDE 'tools-menu.inc' %]
161 </div>
162 </div>
163 [% INCLUDE 'intranet-bottom.inc' %]