Bug 35378: 'This authority type is used {count} times' missing dot
[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 [% PROCESS 'i18n.inc' %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% FILTER collapse %]
9     [% t("Overdue notice/status triggers") | html %] &rsaquo;
10     [% t("Tools") | html %] &rsaquo;
11     [% t("Koha") | html %]
12 [% END %]</title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 </head>
15
16 <body id="tools_overduerules" class="tools">
17 [% WRAPPER 'header.inc' %]
18     [% INCLUDE 'cat-search.inc' %]
19 [% END %]
20
21 [% WRAPPER 'sub-header.inc' %]
22     [% WRAPPER breadcrumbs %]
23         [% WRAPPER breadcrumb_item %]
24             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
25         [% END %]
26         [% WRAPPER breadcrumb_item bc_active= 1 %]
27             <span>Overdue notice/status triggers</span>
28         [% END %]
29     [% END #/ WRAPPER breadcrumbs %]
30 [% END #/ WRAPPER sub-header.inc %]
31
32 <div class="main container-fluid">
33     <div class="row">
34         <div class="col-sm-10 col-sm-push-2">
35             <main>
36
37         <h1>Defining [% IF ( branch ) %]overdue actions for [% Branches.GetName( branch ) | html %][% 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" class="btn btn-primary" 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 | html %] for [% BORERR | html %] 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 | html %] for [% BORERR | html %] 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 | html %]</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 | html %]" />
72                     <h3>Rules for overdue actions: [% IF ( branch ) %][% Branches.GetName( branch ) | html %][% ELSE %] default library [% END %]</h3>
73                         [% IF ( datasaved ) %]<div class="dialog message">Changes saved.</div> [% END %]
74
75                     [% WRAPPER tabs id= "rulestabs" %]
76                         [% WRAPPER tabs_nav %]
77                             [% FOR tab IN tabs %]
78                                 [% WRAPPER tab_item tabname= tab.id %][% END %]
79                             [% END %]
80                         [% END # /WRAPPER tabs_nav %]
81
82                         [% WRAPPER tab_panels %]
83                             [% FOR tab IN tabs %]
84                                 [% WRAPPER tab_panel tabname=tab.id %]
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>[% tp('Message transport type', 'Print') | html %]</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 %] ( [% letter.code | html %] )</option>
122                                                                 [% ELSE %]
123                                                                 <option value="[% letter.code | html %]">[% letter.name | html %] ( [% letter.code | 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                                 [% END # /tab_panel# %]
155                             [% END %]
156                         [% END # /WRAPPER tab_panels %]
157                     [% END # /WRAPPER tabs %]
158
159                     <fieldset class="action"><input type="submit" class="btn btn-primary" 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 = { "0" : _("First"), "1" : _("Second"), "2" : _("Third")};
180         $(document).ready(function() {
181             $('#selectlibrary').find("input:submit").hide();
182             $('#branch').change(function() {
183                 $('#selectlibrary').submit();
184             });
185             $("#rulestabs li > a").each( function( i ){
186                 $(this).html(tab_map[ i ]);
187             });
188             if( $("#rulestabs .tab-pane.active").length < 1 ){
189                 $("#rulestabs a:first").tab("show");
190             }
191         });
192     </script>
193 [% END %]
194
195 [% INCLUDE 'intranet-bottom.inc' %]