Merge remote branch 'kc/new/enh/bug_5692' into kcmaster
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / overduerules.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Tools &rsaquo; Notice Triggers</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4
5 <script type="text/javascript">
6 //<![CDATA[
7 $(document).ready(function() {
8         $('#selectlibrary').find("input:submit").hide();
9         $('#branch').change(function() {
10                 $('#selectlibrary').submit();
11         });
12             $('#rulestabs > ul').tabs();
13 });
14 //]]>
15 </script>
16
17 </head>
18 <body>
19 [% INCLUDE 'header.inc' %]
20 [% INCLUDE 'cat-search.inc' %]
21
22 <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; Notice Triggers</div>
23
24 <div id="doc3" class="yui-t2">
25    
26    <div id="bd">
27     <div id="yui-main">
28     <div class="yui-b">
29
30         <h1>Defining [% IF ( branch ) %]overdue actions for [% branch %][% ELSE %]default overdue actions[% END %]</h1>
31         <div class="help">
32             <p>Delay is the number of days after an checkout is due before an action is triggered. </p>
33             <p>If you want Koha to trigger an action (send a letter or debar member), a delay value is required.</p>
34             <p>Columns must be filled left to right: if the first column is blank, other columns will be ignored. </p>
35         </div>
36             <form method="post" action="/cgi-bin/koha/tools/overduerules.pl" id="selectlibrary">
37             <label for="branch">Select a library:</label>
38                 <select id="branch" name="branch">
39                     <option value="">Default</option>
40                     [% FOREACH branchloo IN branchloop %]
41                         [% IF ( branchloo.selected ) %]
42                             <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
43                         [% ELSE %]
44                             <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
45                         [% END %]
46                     [% END %]
47                 </select>
48                 <input type="submit" value="Select" />
49             </form>
50             [% IF ( ERROR ) %]
51             <div class="dialog alert">
52                 <h3>Data error</h3>
53                 <p>The following errors were found. Please correct them and submit again:</p>
54                 <ul>
55                 [% IF ( ERRORDELAY ) %]
56                     <li>Delay [% ERRORDELAY %] for [% BORERR %] patron category has some unexpected characters. There should be only numerical characters. </li>
57                 [% END %]
58                 [% IF ( ERRORUSELESSDELAY ) %]
59                     <li>No letter or debar action specified for delay [% ERRORUSELESSDELAY %] for [% BORERR %] patron category.  If a delay is supplied, either a letter, debar action, or both should be specified.</li>
60                 [% END %]
61                 [% IF ( ERRORORDER ) %]
62                     <li>The first notice's delay should be less than the second, which should be less than the third for the <strong>[% BORERR %]</strong> patron category </li>
63                 [% END %]
64                 </ul>
65             </div>
66             [% END %]
67             [% IF ( table ) %]
68             <form method="post" action="/cgi-bin/koha/tools/overduerules.pl">
69                 <input type="hidden" name="op" value="save" />
70                 <input type="hidden" name="branch" value="[% branch %]" />
71                                 <h3>Rules for overdue actions: [% IF ( branch ) %][% branch %][% ELSE %] default library [% END %]</h3>
72                     [% IF ( datasaved ) %]<div class="dialog message">INPUT SAVED</div> [% END %]
73
74   <div id="rulestabs" class="toptabs">
75         <ul class="ui-tabs-nav">
76       <li><a href="#first">First</a></li>
77       <li><a href="#second">Second</a></li>
78       <li><a href="#third">Third</a></li>
79         </ul>
80
81 <div id="first"><table>
82                                         <tr><th>&nbsp;</th><th scope="col">Delay</th><th scope="col">First Letter</th><th scope="col">Debar</th></tr>
83                     [% FOREACH tabl IN table %]
84                      [% UNLESS ( loop.odd ) %]
85                                 <tr class="highlight">
86                             [% ELSE %]
87                                 <tr>
88                             [% END %]
89                             <th scope="row">[% tabl.line %]</th>
90 <td>
91                                 <input type="text" name="delay1-[% tabl.overduename %]" size="5" value="[% tabl.delay1 %]" />
92                             </td>
93 <td>
94                             [% IF ( tabl.noletter ) %]
95                                 <input type="text" name="letter1-[% tabl.overduename %]" value="[% tabl.letter1 %]" />
96                             [% ELSE %]
97                                 <select name="letter1-[% tabl.overduename %]">
98                                     <option value="">No notice</option>
99                                     [% FOREACH letterloop IN tabl.letterloop1 %]
100                                         [% IF ( letterloop.selected ) %]
101                                             <option value="[% letterloop.value %]" selected="selected">[% letterloop.lettername %]</option>
102                                         [% ELSE %]
103                                             <option value="[% letterloop.value %]">[% letterloop.lettername %]</option>
104                                         [% END %]
105                                     [% END %]
106                                 </select>
107                             [% END %]
108                             </td>
109 <td>
110                                 [% IF ( tabl.debarred1 ) %]
111                                     <input type="checkbox" name="debarred1-[% tabl.overduename %]" checked="checked" value="1" />
112                                 [% ELSE %]
113                                     <input type="checkbox" name="debarred1-[% tabl.overduename %]" value="1" />
114                                 [% END %]
115                             </td>
116                                                         </tr>
117                                                         [% END %]
118                                                         </table>
119 </div>
120
121 <div id="second"><table>
122                                         <tr><th>&nbsp;</th><th scope="col">Delay</th><th scope="col">Second Letter</th><th scope="col">Debar</th></tr>
123                     [% FOREACH tabl IN table %]
124                      [% UNLESS ( loop.odd ) %]
125                                 <tr class="highlight">
126                             [% ELSE %]
127                                 <tr>
128                             [% END %]
129                             <th scope="row">[% tabl.line %]</th>
130 <td>
131                                 <input type="text" name="delay2-[% tabl.overduename %]" size="5" value="[% tabl.delay2 %]" />
132                             </td>
133 <td>
134                             [% IF ( tabl.noletter ) %]
135                                 <input type="text" name="letter2-[% tabl.overduename %]" value="[% tabl.letter2 %]" />
136                             [% ELSE %]
137                                 <select name="letter2-[% tabl.overduename %]">
138                                     <option value="">No notice</option>
139                                         [% FOREACH letterloop IN tabl.letterloop2 %]
140                                             [% IF ( letterloop.selected ) %]
141                                                 <option value="[% letterloop.value %]" selected="selected">[% letterloop.lettername %]</option>
142                                             [% ELSE %]
143                                                 <option value="[% letterloop.value %]">[% letterloop.lettername %]</option>
144                                             [% END %]
145                                         [% END %]
146                                 </select>
147                             [% END %]
148                             </td>
149 <td>
150                                 [% IF ( tabl.debarred2 ) %]
151                                     <input type="checkbox" name="debarred2-[% tabl.overduename %]" checked="checked" value="1" />
152                                 [% ELSE %]
153                                     <input type="checkbox" name="debarred2-[% tabl.overduename %]" value="1" />
154                                 [% END %]
155                             </td>
156                                                         </tr>
157                                                         [% END %]
158                                                         </table>
159 </div>
160
161 <div id="third"><table>
162                                         <tr><th>&nbsp;</th><th scope="col">Delay</th><th scope="col">Third Letter</th><th scope="col">Debar</th></tr>
163                     [% FOREACH tabl IN table %]
164                      [% UNLESS ( loop.odd ) %]
165                                 <tr class="highlight">
166                             [% ELSE %]
167                                 <tr>
168                             [% END %]
169                             <th scope="row">[% tabl.line %]</th>
170 <td>
171                                 <input type="text" name="delay3-[% tabl.overduename %]" size="5" value="[% tabl.delay3 %]" />
172                             </td>
173 <td>
174                             [% IF ( tabl.noletter ) %]
175                                 <input type="text" name="letter3-[% tabl.overduename %]" value="[% tabl.letter3 %]" />
176                             [% ELSE %]
177                                 <select name="letter3-[% tabl.overduename %]">
178                                     <option value="">No notice</option>
179                                     [% FOREACH letterloop IN tabl.letterloop3 %]
180                                         [% IF ( letterloop.selected ) %]
181                                             <option value="[% letterloop.value %]" selected="selected">[% letterloop.lettername %]</option>
182                                         [% ELSE %]
183                                             <option value="[% letterloop.value %]">[% letterloop.lettername %]</option>
184                                         [% END %]
185                                     [% END %]
186                                 </select>
187                             [% END %]
188                             </td>
189 <td>
190                                 [% IF ( tabl.debarred3 ) %]
191                                     <input type="checkbox" name="debarred3-[% tabl.overduename %]" checked="checked" value="1" />
192                                 [% ELSE %]
193                                     <input type="checkbox" name="debarred3-[% tabl.overduename %]" value="1" />
194                                 [% END %]
195                             </td>
196                         </tr>
197                     [% END %]
198                 </table>
199 </div>
200 </div>
201
202                 <fieldset class="action"><input type="submit" value="Save Changes" /></fieldset>
203             </form>
204             [% ELSE %]
205                 <div class="warning">You don't have patron categories defined, or the patron categories are not set to receive overdue notices.</div>
206                 <div class="warning">If this is not what you were expecting, go to <a href="../admin/categorie.pl">patron categories</p></div>
207             [% END %]
208     </div>
209     </div>
210     <div class="yui-b noprint">
211         [% INCLUDE 'tools-menu.inc' %]
212     </div>
213 </div>
214 [% INCLUDE 'intranet-bottom.inc' %]