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