Bug 11763: (follow-up) do not display anything in actions column if user cannot manag...
[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               [% IF ( value.noletter ) %]
124                 <input type="text" name="letter[% tab.number %]-[% value.overduename %]" value="[% value.letter %]" />
125               [% ELSE %]
126                 <select name="letter[% tab.number %]-[% value.overduename %]">
127                   <option value="">No notice</option>
128                   [% FOREACH letterloop IN value.letterloop %]
129                     [% IF ( letterloop.selected ) %]
130                       <option value="[% letterloop.value %]" selected="selected">[% letterloop.lettername %]</option>
131                     [% ELSE %]
132                       <option value="[% letterloop.value %]">[% letterloop.lettername %]</option>
133                     [% END %]
134                   [% END %]
135                 </select>
136               [% END %]
137               </td>
138               <td>
139               [% IF ( value.debarred ) %]
140                 <input type="checkbox" name="debarred[% tab.number %]-[% value.overduename %]" checked="checked" value="1" />
141               [% ELSE %]
142                 <input type="checkbox" name="debarred[% tab.number %]-[% value.overduename %]" value="1" />
143               [% END %]
144               </td>
145               [% FOREACH mtt IN value.message_transport_types %]
146                 <td>
147                   [% IF mtt.selected %]
148                     <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" checked="checked" />
149                   [% ELSE %]
150                     [% IF mtt.value == "sms" and not Koha.Preference("SMSSendDriver") %]
151                       <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" disabled="disabled" />
152                     [% ELSIF mtt.value == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
153                       <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" disabled="disabled" />
154                     [% ELSE %]
155                       <input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" />
156                     [% END %]
157                   [% END %]
158                 </td>
159               [% END %]
160             </tr>
161           [% END %]
162           </tbody>
163         </table>
164       </div>
165     [% END %]
166
167
168 </div>
169
170                 <fieldset class="action"><input type="submit" value="Save changes" /></fieldset>
171             </form>
172             [% ELSE %]
173                 <div class="warning">You don't have patron categories defined, or the patron categories are not set to receive overdue notices.</div>
174                 <div class="warning">If this is not what you were expecting, go to <a href="../admin/categorie.pl">patron categories</p></div>
175             [% END %]
176     </div>
177     </div>
178     <div class="yui-b noprint">
179         [% INCLUDE 'tools-menu.inc' %]
180     </div>
181 </div>
182 [% INCLUDE 'intranet-bottom.inc' %]