Bug 30994: Typo: item was on loan. couldn't be returned.
[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>Overdue notice/status triggers &rsaquo; Tools &rsaquo; Koha</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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
16     <ol>
17         <li>
18             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
19         </li>
20         <li>
21             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
22         </li>
23         <li>
24             <a href="#" aria-current="page">
25                 Overdue notice/status triggers
26             </a>
27         </li>
28     </ol>
29 </nav>
30
31 <div class="main container-fluid">
32     <div class="row">
33         <div class="col-sm-10 col-sm-push-2">
34             <main>
35
36         <h1>Defining [% IF ( branch ) %]overdue actions for [% Branches.GetName( branch ) | html %][% ELSE %]default overdue actions[% END %]</h1>
37         <div class="help">
38             <p>Delay is the number of days after a 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                     [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
47                 </select>
48                 <input type="submit" value="Select" />
49             </form>
50             [% IF ( ERROR ) %]
51             <div class="dialog alert">
52                 <h3>Data error</h3>
53                 <p>The following errors were found. Please correct them and submit again:</p>
54                 <ul>
55                 [% IF ( ERRORDELAY ) %]
56                     <li>Delay [% ERRORDELAY | html %] for [% BORERR | html %] patron category has some unexpected characters. There should be only numerical characters. </li>
57                 [% END %]
58                 [% IF ( ERRORUSELESSDELAY ) %]
59                     <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>
60                 [% END %]
61                 [% IF ( ERRORORDER ) %]
62                     <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>
63                 [% END %]
64                 </ul>
65             </div>
66             [% END %]
67             [% IF ( table ) %]
68             <form method="post" action="/cgi-bin/koha/tools/overduerules.pl">
69                 <input type="hidden" name="op" value="save" />
70                 <input type="hidden" name="branch" value="[% branch | html %]" />
71                 <h3>Rules for overdue actions: [% IF ( branch ) %][% Branches.GetName( branch ) | html %][% ELSE %] default library [% END %]</h3>
72                     [% IF ( datasaved ) %]<div class="dialog message">Changes saved.</div> [% END %]
73
74                 <div id="rulestabs" class="toptabs">
75                     <ul class="nav nav-tabs" role="tablist">
76                         [% FOR tab IN tabs %]
77                             <li role="presentation">
78                                 <a href="#[% tab.id | uri %]" class="tab [% tab.id | html %]" data-number="[% tab.number | html %]" aria-controls="[% tab.id | uri %]" role="tab" data-toggle="tab"></a>
79                             </li>
80                         [% END %]
81                     </ul>
82                     <div class="tab-content">
83                         [% FOR tab IN tabs %]
84                             <div id="[% tab.id | html %]" role="tabpanel" class="tab-pane">
85                                 <table>
86                                     <thead>
87                                         <tr>
88                                         <th>&nbsp;</th>
89                                         <th scope="col">Delay</th>
90                                         <th scope="col">Letter</th>
91                                         <th scope="col">Restrict</th>
92                                             [% FOREACH mtt IN message_transport_types %]
93                                                 [% NEXT IF mtt == 'itiva' AND !Koha.Preference('TalkingTechItivaPhoneNotification') %]
94                                                 [% NEXT IF mtt == 'phone' AND !Koha.Preference('PhoneNotification') %]
95                                                 <th scope="col">
96                                                     [% SWITCH mtt %]
97                                                     [% CASE 'email' %]<span>Email</span>
98                                                     [% CASE 'print' %]<span>Print</span>
99                                                     [% CASE 'sms' %]<span>SMS</span>
100                                                     [% CASE 'feed' %]<span>Feed</span>
101                                                     [% CASE 'itiva' %]<span>Phone (i-tiva)</span>
102                                                     [% CASE 'phone' %]<span>Phone</span>
103                                                     [% CASE %]<span>[% mtt | html %]</span>
104                                                     [% END %]
105                                                 </th>
106                                             [% END %]
107                                         </tr>
108                                     </thead>
109                                     <tbody>
110                                         [% FOREACH value IN tab.values %]
111                                             <tr>
112                                                 <th scope="row">[% value.line | html %]</th>
113                                                 <td>
114                                                     <input type="text" inputmode="numeric" pattern="[0-9]*" name="delay[% tab.number | html %]-[% value.overduename | html %]" value="[% value.delay | html %]" />
115                                                 </td>
116                                                 <td>
117                                                     <select name="letter[% tab.number | html %]-[% value.overduename | html %]">
118                                                         <option value="">No notice</option>
119                                                         [% FOREACH letter IN letters %]
120                                                             [% IF letter.code == value.selected_lettercode %]
121                                                             <option value="[% letter.code | html %]" selected="selected">[% letter.name | html %]</option>
122                                                             [% ELSE %]
123                                                             <option value="[% letter.code | html %]">[% letter.name | html %]</option>
124                                                             [% END %]
125                                                         [% END %]
126                                                     </select>
127                                                 </td>
128                                                 <td>
129                                                     [% IF ( value.debarred ) %]
130                                                         <input type="checkbox" name="debarred[% tab.number | html %]-[% value.overduename | html %]" checked="checked" value="1" />
131                                                     [% ELSE %]
132                                                         <input type="checkbox" name="debarred[% tab.number | html %]-[% value.overduename | html %]" value="1" />
133                                                     [% END %]
134                                                 </td>
135                                                 [% FOREACH mtt IN value.message_transport_types %]
136                                                     [% NEXT IF mtt.value == 'itiva' AND !Koha.Preference('TalkingTechItivaPhoneNotification') %]
137                                                     [% NEXT IF mtt.value == 'phone' AND !Koha.Preference('PhoneNotification') %]
138                                                     <td>
139                                                         [% IF mtt.selected %]
140                                                             <input type="checkbox" name="mtt[% tab.number | html %]-[% value.overduename | html %]" value="[% mtt.value | html %]" checked="checked" />
141                                                         [% ELSE %]
142                                                             [% IF mtt.value == "sms" and not Koha.Preference("SMSSendDriver") %]
143                                                                 <input type="checkbox" name="mtt[% tab.number | html %]-[% value.overduename | html %]" value="[% mtt.value | html %]" disabled="disabled" />
144                                                             [% ELSE %]
145                                                                 <input type="checkbox" name="mtt[% tab.number | html %]-[% value.overduename | html %]" value="[% mtt.value | html %]" />
146                                                             [% END %]
147                                                         [% END %]
148                                                     </td>
149                                                 [% END # /FOREACH mtt %]
150                                             </tr>
151                                         [% END # /FOREACH value %]
152                                     </tbody>
153                                 </table>
154                             </div> <!-- /.tab-pane -->
155                         [% END # /FOR tabs %]
156                     </div> <!-- /.tab-content -->
157                 </div>
158
159                 <fieldset class="action"><input type="submit" value="Save changes" /></fieldset>
160             </form>
161             [% ELSE %]
162                 <div class="warning">You don't have patron categories defined, or the patron categories are not set to receive overdue notices.</div>
163                 <div class="warning">If this is not what you were expecting, go to <a href="../admin/categories.pl">patron categories</p></div>
164             [% END %]
165
166             </main>
167         </div> <!-- /.col-sm-10.col-sm-push-2 -->
168
169         <div class="col-sm-2 col-sm-pull-10">
170             <aside>
171                 [% INCLUDE 'tools-menu.inc' %]
172             </aside>
173         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
174      </div> <!-- /.row -->
175
176 [% MACRO jsinclude BLOCK %]
177     [% Asset.js("js/tools-menu.js") | $raw %]
178     <script>
179         var tab_map = { "1" : _("First"), "2" : _("Second"), "3" : _("Third")};
180         $(document).ready(function() {
181             $('#selectlibrary').find("input:submit").hide();
182             $('#branch').change(function() {
183                 $('#selectlibrary').submit();
184             });
185             $("li>a.tab").each( function(){
186                 var id = $(this).attr("data-number");
187                 $(this).html(tab_map[id]);
188             });
189             if( $("#rulestabs .tab-pane.active").length < 1 ){
190                 $("#rulestabs a:first").tab("show");
191             }
192         });
193     </script>
194 [% END %]
195
196 [% INCLUDE 'intranet-bottom.inc' %]