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