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