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