Bug 15758: Koha::Libraries - Remove GetBranchesLoop
[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                     [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
48                 </select>
49                 <input type="submit" value="Select" />
50             </form>
51             [% IF ( ERROR ) %]
52             <div class="dialog alert">
53                 <h3>Data error</h3>
54                 <p>The following errors were found. Please correct them and submit again:</p>
55                 <ul>
56                 [% IF ( ERRORDELAY ) %]
57                     <li>Delay [% ERRORDELAY %] for [% BORERR %] patron category has some unexpected characters. There should be only numerical characters. </li>
58                 [% END %]
59                 [% IF ( ERRORUSELESSDELAY ) %]
60                     <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>
61                 [% END %]
62                 [% IF ( ERRORORDER ) %]
63                     <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>
64                 [% END %]
65                 </ul>
66             </div>
67             [% END %]
68             [% IF ( table ) %]
69             <form method="post" action="/cgi-bin/koha/tools/overduerules.pl">
70                 <input type="hidden" name="op" value="save" />
71                 <input type="hidden" name="branch" value="[% branch %]" />
72                 <h3>Rules for overdue actions: [% IF ( branch ) %][% Branches.GetName( branch ) %][% ELSE %] default library [% END %]</h3>
73                     [% IF ( datasaved ) %]<div class="dialog message">Changes saved.</div> [% END %]
74
75   <div id="rulestabs" class="toptabs">
76     <ul class="ui-tabs-nav">
77       [% FOR tab IN tabs %]
78           <li><a href="#[% tab.id %]" class="tab [% tab.id %]" data-number="[% tab.number %]"></a></li>
79       [% END %]
80     </ul>
81     [% FOR tab IN tabs %]
82       <div id="[% tab.id %]">
83         <table>
84           <thead>
85             <tr>
86               <th>&nbsp;</th>
87               <th scope="col">Delay</th>
88               <th scope="col">Letter</th>
89               <th scope="col">Restrict</th>
90               [% FOREACH mtt IN message_transport_types %]
91                 <th scpre="col">
92                   [% SWITCH mtt %]
93                   [% CASE 'email' %]
94                     Email
95                   [% CASE 'print' %]
96                     Print
97                   [% CASE 'sms' %]
98                     SMS
99                   [% CASE 'feed' %]
100                     Feed
101                   [% CASE 'phone' %]
102                     Phone
103                   [% CASE %]
104                     [% mtt %]
105                   [% END %]
106                 </th>
107               [% END %]
108             </tr>
109           </thead>
110           <tbody>
111           [% FOREACH value IN tab.values %]
112             <tr>
113               <th scope="row">[% value.line %]</th>
114               <td>
115               <input type="text" name="delay[% tab.number %]-[% value.overduename %]" size="5" value="[% value.delay %]" />
116               </td>
117               <td>
118                 <select name="letter[% tab.number %]-[% value.overduename %]">
119                   <option value="">No notice</option>
120                   [% FOREACH letter IN letters %]
121                     [% IF letter.code == value.selected_lettercode %]
122                       <option value="[% letter.code %]" selected="selected">[% letter.name %]</option>
123                     [% ELSE %]
124                       <option value="[% letter.code %]">[% letter.name %]</option>
125                     [% END %]
126                   [% END %]
127                 </select>
128               </td>
129               <td>
130               [% IF ( value.debarred ) %]
131                 <input type="checkbox" name="debarred[% tab.number %]-[% value.overduename %]" checked="checked" value="1" />
132               [% ELSE %]
133                 <input type="checkbox" name="debarred[% tab.number %]-[% value.overduename %]" value="1" />
134               [% END %]
135               </td>
136               [% FOREACH mtt IN value.message_transport_types %]
137                 <td>
138                   [% IF mtt.selected %]
139                     <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" checked="checked" />
140                   [% ELSE %]
141                     [% IF mtt.value == "sms" and not Koha.Preference("SMSSendDriver") %]
142                       <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" disabled="disabled" />
143                     [% ELSIF mtt.value == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
144                       <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" disabled="disabled" />
145                     [% ELSE %]
146                       <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" />
147                     [% END %]
148                   [% END %]
149                 </td>
150               [% END %]
151             </tr>
152           [% END %]
153           </tbody>
154         </table>
155       </div>
156     [% END %]
157
158
159 </div>
160
161                 <fieldset class="action"><input type="submit" value="Save changes" /></fieldset>
162             </form>
163             [% ELSE %]
164                 <div class="warning">You don't have patron categories defined, or the patron categories are not set to receive overdue notices.</div>
165                 <div class="warning">If this is not what you were expecting, go to <a href="../admin/categories.pl">patron categories</p></div>
166             [% END %]
167     </div>
168     </div>
169     <div class="yui-b noprint">
170         [% INCLUDE 'tools-menu.inc' %]
171     </div>
172 </div>
173 [% INCLUDE 'intranet-bottom.inc' %]