Bug 2696: Fine payments should show what was paid for
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / overduerules.tt
1 [% USE Asset %]
2 [% USE Koha %]
3 [% USE Branches %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Tools &rsaquo; Overdue notice/status triggers</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9
10 <body id="tools_overduerules" class="tools">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'cat-search.inc' %]
13
14 <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; Overdue notice/status triggers</div>
15
16 <div id="doc3" class="yui-t2">
17    
18    <div id="bd">
19     <div id="yui-main">
20     <div class="yui-b">
21
22         <h1>Defining [% IF ( branch ) %]overdue actions for [% Branches.GetName( branch ) %][% ELSE %]default overdue actions[% END %]</h1>
23         <div class="help">
24             <p>Delay is the number of days after a checkout is due before an action is triggered. </p>
25             <p>If you want Koha to trigger an action (send a letter or restrict a member), a delay value is required.</p>
26             <p>Columns must be filled left to right: if the first column is blank, other columns will be ignored. </p>
27         </div>
28             <form method="post" action="/cgi-bin/koha/tools/overduerules.pl" id="selectlibrary">
29             <label for="branch">Select a library:</label>
30                 <select id="branch" name="branch">
31                     <option value="">Default</option>
32                     [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
33                 </select>
34                 <input type="submit" value="Select" />
35             </form>
36             [% IF ( ERROR ) %]
37             <div class="dialog alert">
38                 <h3>Data error</h3>
39                 <p>The following errors were found. Please correct them and submit again:</p>
40                 <ul>
41                 [% IF ( ERRORDELAY ) %]
42                     <li>Delay [% ERRORDELAY %] for [% BORERR %] patron category has some unexpected characters. There should be only numerical characters. </li>
43                 [% END %]
44                 [% IF ( ERRORUSELESSDELAY ) %]
45                     <li>No letter or restriction action specified for delay [% ERRORUSELESSDELAY %] for [% BORERR %] patron category.  If a delay is supplied, either a letter, restrict action, or both should be specified.</li>
46                 [% END %]
47                 [% IF ( ERRORORDER ) %]
48                     <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>
49                 [% END %]
50                 </ul>
51             </div>
52             [% END %]
53             [% IF ( table ) %]
54             <form method="post" action="/cgi-bin/koha/tools/overduerules.pl">
55                 <input type="hidden" name="op" value="save" />
56                 <input type="hidden" name="branch" value="[% branch %]" />
57                 <h3>Rules for overdue actions: [% IF ( branch ) %][% Branches.GetName( branch ) %][% ELSE %] default library [% END %]</h3>
58                     [% IF ( datasaved ) %]<div class="dialog message">Changes saved.</div> [% END %]
59
60   <div id="rulestabs" class="toptabs">
61     <ul class="ui-tabs-nav">
62       [% FOR tab IN tabs %]
63           <li><a href="#[% tab.id %]" class="tab [% tab.id %]" data-number="[% tab.number %]"></a></li>
64       [% END %]
65     </ul>
66     [% FOR tab IN tabs %]
67       <div id="[% tab.id %]">
68         <table>
69           <thead>
70             <tr>
71               <th>&nbsp;</th>
72               <th scope="col">Delay</th>
73               <th scope="col">Letter</th>
74               <th scope="col">Restrict</th>
75               [% FOREACH mtt IN message_transport_types %]
76                 <th scpre="col">
77                   [% SWITCH mtt %]
78                   [% CASE 'email' %]
79                     Email
80                   [% CASE 'print' %]
81                     Print
82                   [% CASE 'sms' %]
83                     SMS
84                   [% CASE 'feed' %]
85                     Feed
86                   [% CASE 'phone' %]
87                     Phone
88                   [% CASE %]
89                     [% mtt %]
90                   [% END %]
91                 </th>
92               [% END %]
93             </tr>
94           </thead>
95           <tbody>
96           [% FOREACH value IN tab.values %]
97             <tr>
98               <th scope="row">[% value.line %]</th>
99               <td>
100               <input type="number" min="1" name="delay[% tab.number %]-[% value.overduename %]" value="[% value.delay %]" />
101               </td>
102               <td>
103                 <select name="letter[% tab.number %]-[% value.overduename %]">
104                   <option value="">No notice</option>
105                   [% FOREACH letter IN letters %]
106                     [% IF letter.code == value.selected_lettercode %]
107                       <option value="[% letter.code %]" selected="selected">[% letter.name %]</option>
108                     [% ELSE %]
109                       <option value="[% letter.code %]">[% letter.name %]</option>
110                     [% END %]
111                   [% END %]
112                 </select>
113               </td>
114               <td>
115               [% IF ( value.debarred ) %]
116                 <input type="checkbox" name="debarred[% tab.number %]-[% value.overduename %]" checked="checked" value="1" />
117               [% ELSE %]
118                 <input type="checkbox" name="debarred[% tab.number %]-[% value.overduename %]" value="1" />
119               [% END %]
120               </td>
121               [% FOREACH mtt IN value.message_transport_types %]
122                 <td>
123                   [% IF mtt.selected %]
124                     <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" checked="checked" />
125                   [% ELSE %]
126                     [% IF mtt.value == "sms" and not Koha.Preference("SMSSendDriver") %]
127                       <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" disabled="disabled" />
128                     [% ELSIF mtt.value == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
129                       <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" disabled="disabled" />
130                     [% ELSE %]
131                       <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" />
132                     [% END %]
133                   [% END %]
134                 </td>
135               [% END %]
136             </tr>
137           [% END %]
138           </tbody>
139         </table>
140       </div>
141     [% END %]
142
143
144 </div>
145
146                 <fieldset class="action"><input type="submit" value="Save changes" /></fieldset>
147             </form>
148             [% ELSE %]
149                 <div class="warning">You don't have patron categories defined, or the patron categories are not set to receive overdue notices.</div>
150                 <div class="warning">If this is not what you were expecting, go to <a href="../admin/categories.pl">patron categories</p></div>
151             [% END %]
152     </div>
153     </div>
154     <div class="yui-b noprint">
155         [% INCLUDE 'tools-menu.inc' %]
156     </div>
157 </div>
158
159 [% MACRO jsinclude BLOCK %]
160     [% Asset.js("js/tools-menu.js") %]
161     <script type="text/javascript">
162         var tab_map = { "1" : _("First"), "2" : _("Second"), "3" : _("Third")};
163         $(document).ready(function() {
164             $('#selectlibrary').find("input:submit").hide();
165             $('#branch').change(function() {
166                 $('#selectlibrary').submit();
167             });
168             $("li>a.tab").each( function(){
169                 var id = $(this).attr("data-number");
170                 $(this).html(tab_map[id]);
171             });
172             $('#rulestabs').tabs();
173         });
174     </script>
175 [% END %]
176
177 [% INCLUDE 'intranet-bottom.inc' %]