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