5 [% PROCESS 'i18n.inc' %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% FILTER collapse %]
9 [% t("Overdue notice/status triggers") | html %] ›
10 [% t("Tools") | html %] ›
11 [% t("Koha") | html %]
13 [% INCLUDE 'doc-head-close.inc' %]
16 <body id="tools_overduerules" class="tools">
17 [% WRAPPER 'header.inc' %]
18 [% INCLUDE 'cat-search.inc' %]
21 [% WRAPPER 'sub-header.inc' %]
22 [% WRAPPER breadcrumbs %]
23 [% WRAPPER breadcrumb_item %]
24 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
26 [% WRAPPER breadcrumb_item bc_active= 1 %]
27 <span>Overdue notice/status triggers</span>
29 [% END #/ WRAPPER breadcrumbs %]
30 [% END #/ WRAPPER sub-header.inc %]
32 <div class="main container-fluid">
34 <div class="col-sm-10 col-sm-push-2">
36 [% INCLUDE 'messages.inc' %]
38 <h1>Defining [% IF ( branch ) %]overdue actions for [% Branches.GetName( branch ) | html %][% ELSE %]default overdue actions[% END %]</h1>
40 <p>Delay is the number of days after a checkout is due before an action is triggered. </p>
41 <p>If you want Koha to trigger an action (send a letter or restrict a member), a delay value is required.</p>
42 <p>Columns must be filled left to right: if the first column is blank, other columns will be ignored. </p>
44 <form method="get" action="/cgi-bin/koha/tools/overduerules.pl" id="selectlibrary">
45 <label for="branch">Select a library:</label>
46 <select id="branch" name="branch">
47 <option value="">Default</option>
48 [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
50 <input type="submit" class="btn btn-primary" value="Select" />
53 <div class="dialog alert">
55 <p>The following errors were found. Please correct them and submit again:</p>
57 [% IF ( ERRORDELAY ) %]
58 <li>Delay [% ERRORDELAY | html %] for [% BORERR | html %] patron category has some unexpected characters. There should be only numerical characters. </li>
60 [% IF ( ERRORUSELESSDELAY ) %]
61 <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>
63 [% IF ( ERRORORDER ) %]
64 <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>
70 <form method="post" id="overduerulesf" action="/cgi-bin/koha/tools/overduerules.pl">
71 [% INCLUDE 'csrf-token.inc' %]
72 <input type="hidden" name="op" value="cud-save" />
73 <input type="hidden" name="branch" value="[% branch | html %]" />
74 <h3>Rules for overdue actions: [% IF ( branch ) %][% Branches.GetName( branch ) | html %][% ELSE %] default library [% END %]</h3>
75 [% IF ( datasaved ) %]<div class="dialog message">Changes saved.</div> [% END %]
77 [% WRAPPER tabs id= "rulestabs" %]
78 [% WRAPPER tabs_nav %]
80 [% WRAPPER tab_item tabname= tab.id %][% END %]
82 [% END # /WRAPPER tabs_nav %]
84 [% WRAPPER tab_panels %]
86 [% WRAPPER tab_panel tabname=tab.id %]
87 <table class="overduerulest" id="overduerulest-[% tab.id | html %]">
90 <th>Patron category</th>
91 <th class="NoSort" scope="col">Delay</th>
92 <th class="NoSort" scope="col">Letter</th>
93 <th class="NoSort" scope="col">Restrict</th>
94 [% FOREACH mtt IN message_transport_types %]
95 [% NEXT IF mtt == 'itiva' AND !Koha.Preference('TalkingTechItivaPhoneNotification') %]
96 [% NEXT IF mtt == 'phone' AND !Koha.Preference('PhoneNotification') %]
97 <th class="NoSort" scope="col">
99 [% CASE 'email' %]<span>Email</span>
100 [% CASE 'print' %]<span>[% tp('Message transport type', 'Print') | html %]</span>
101 [% CASE 'sms' %]<span>SMS</span>
102 [% CASE 'feed' %]<span>Feed</span>
103 [% CASE 'itiva' %]<span>Phone (i-tiva)</span>
104 [% CASE 'phone' %]<span>Phone</span>
105 [% CASE %]<span>[% mtt | html %]</span>
112 [% FOREACH value IN tab.values %]
114 <th scope="row">[% value.line | html %]</th>
116 <input type="text" inputmode="numeric" pattern="[0-9]*" name="delay[% tab.number | html %]-[% value.overduename | html %]" value="[% value.delay | html %]" />
119 <select name="letter[% tab.number | html %]-[% value.overduename | html %]">
120 <option value="">No notice</option>
121 [% FOREACH letter IN letters %]
122 [% IF letter.code == value.selected_lettercode %]
123 <option value="[% letter.code | html %]" selected="selected">[% letter.name | html %] ( [% letter.code | html %] )</option>
125 <option value="[% letter.code | html %]">[% letter.name | html %] ( [% letter.code | html %] )</option>
131 [% IF ( value.debarred ) %]
132 <input type="checkbox" name="debarred[% tab.number | html %]-[% value.overduename | html %]" checked="checked" value="1" />
134 <input type="checkbox" name="debarred[% tab.number | html %]-[% value.overduename | html %]" value="1" />
137 [% FOREACH mtt IN value.message_transport_types %]
138 [% NEXT IF mtt.value == 'itiva' AND !Koha.Preference('TalkingTechItivaPhoneNotification') %]
139 [% NEXT IF mtt.value == 'phone' AND !Koha.Preference('PhoneNotification') %]
141 [% IF mtt.selected %]
142 <input type="checkbox" name="mtt[% tab.number | html %]-[% value.overduename | html %]" value="[% mtt.value | html %]" checked="checked" />
144 [% IF mtt.value == "sms" and not Koha.Preference("SMSSendDriver") %]
145 <input type="checkbox" name="mtt[% tab.number | html %]-[% value.overduename | html %]" value="[% mtt.value | html %]" disabled="disabled" />
147 <input type="checkbox" name="mtt[% tab.number | html %]-[% value.overduename | html %]" value="[% mtt.value | html %]" />
151 [% END # /FOREACH mtt %]
153 [% END # /FOREACH value %]
156 [% END # /tab_panel# %]
158 [% END # /WRAPPER tab_panels %]
159 [% END # /WRAPPER tabs %]
161 <fieldset class="action"><input type="submit" class="btn btn-primary" value="Save changes" /></fieldset>
164 <div class="warning">You don't have patron categories defined, or the patron categories are not set to receive overdue notices.</div>
165 <div class="warning">If this is not what you were expecting, go to <a href="../admin/categories.pl">patron categories</p></div>
169 </div> <!-- /.col-sm-10.col-sm-push-2 -->
171 <div class="col-sm-2 col-sm-pull-10">
173 [% INCLUDE 'tools-menu.inc' %]
175 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
176 </div> <!-- /.row -->
178 [% MACRO jsinclude BLOCK %]
179 [% Asset.js("js/tools-menu.js") | $raw %]
180 [% INCLUDE 'datatables.inc' %]
182 var tab_map = { "0" : _("First"), "1" : _("Second"), "2" : _("Third")};
183 $(document).ready(function() {
184 $('#selectlibrary').find("input:submit").hide();
185 $('#branch').change(function() {
186 $('#selectlibrary').submit();
188 $("#rulestabs li > a").each( function( i ){
189 $(this).html(tab_map[ i ]);
191 if( $("#rulestabs .tab-pane.active").length < 1 ){
192 $("#rulestabs a:first").tab("show");
194 $(".overduerulest").dataTable($.extend(true, {}, dataTablesDefaults, {
196 { "targets": [ "NoSort" ], "orderable": false, "searchable": false },
198 "dom": '<"top pager"f>rt<"clear">',
202 $("#overduerulesf").on("submit", function(e){
203 $(".overduerulest").DataTable().search('').draw();
211 [% INCLUDE 'intranet-bottom.inc' %]