3 [% PROCESS 'i18n.inc' %]
9 [% PROCESS 'html_helpers.inc' %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>[% FILTER collapse %]
12 [% IF ( view == 'list' ) %]
13 [% t("Confirm selection") | html %] ›
14 [% ELSIF ( view == 'report' ) %]
15 [% t("Results") | html %] ›
17 [% t("Batch extend due dates") | html %] ›
18 [% t("Tools") | html %] ›
19 [% t("Koha") | html %]
21 [% INCLUDE 'doc-head-close.inc' %]
22 [% Asset.css("css/humanmsg.css") | $raw %]
25 <body id="tools_batch_extend_due_dates" class="tools">
26 [% WRAPPER 'header.inc' %]
27 [% INCLUDE 'cat-search.inc' %]
30 [% WRAPPER 'sub-header.inc' %]
31 [% WRAPPER breadcrumbs %]
32 [% WRAPPER breadcrumb_item %]
33 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
35 [% IF ( view == 'list' || view == 'report' ) %]
36 [% WRAPPER breadcrumb_item %]
37 <a href="/cgi-bin/koha/tools/batch_extend_due_dates.pl">Batch extend due dates</a>
40 [% WRAPPER breadcrumb_item bc_active= 1 %]
41 <span>Batch extend due dates</span>
44 [% IF ( view == 'list' ) %]
45 [% WRAPPER breadcrumb_item bc_active= 1 %]
46 [% t("Confirm selection") | html %]
48 [% ELSIF ( view == 'report' ) %]
49 [% WRAPPER breadcrumb_item bc_active= 1 %]
50 [% t("Results") | html %]
53 [% END #/ WRAPPER breadcrumbs %]
54 [% END #/ WRAPPER sub-header.inc %]
56 <div class="main container-fluid">
58 <div class="col-sm-10 col-sm-push-2">
61 <h1>Batch extend due dates</h1>
64 <div class="dialog message">
66 [% FOREACH message IN messages %]
67 [% IF message.type == 'success' %]
68 <div><i class="fa fa-check success"></i>
69 [% ELSIF message.type == 'warning' %]
70 <div><i class="fa-solid fa-triangle-exclamation warn"></i>
71 [% ELSIF message.type == 'error' %]
72 <div><i class="fa fa-exclamation error"></i>
74 [% IF message.error %]
75 <span>(The error was: [% message.error | html %]. See the Koha logfile for more information).</span>
80 </div> <!-- .dialog.message -->
83 [% IF view == 'form' %]
84 <form method="post" action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" id="extend_due_dates_form">
85 <fieldset class="rows">
86 <legend>Checkout criteria:</legend>
89 <label for="categorycodes">Patrons' categories: </label>
90 [% SET categories = Categories.all() %]
91 <select id="categorycodes" name="categorycodes" multiple="multiple">
92 [% FOREACH cat IN categories %]
93 <option value="[% cat.categorycode | html %]">[% cat.description | html %]</option>
99 <label for="itemtypescodes">Item types: </label>
100 [% SET itemtypes = ItemTypes.Get() %]
101 <select id="itemtypecodes" name="itemtypecodes" multiple="multiple">
102 [% FOREACH itemtype IN itemtypes %]
103 <option value="[% itemtype.itemtype | html %]">[% itemtype.description | html%]</option>
109 <label for="branchcodes">Libraries: </label>
110 <select name="branchcodes" id="branchcodes" multiple="multiple">
111 [% PROCESS options_for_libraries libraries => Branches.all() %]
116 <label for="from_due_date">Due date from: </label>
117 <input type="text" size="10" id="from" name="from_due_date" class="flatpickr" data-date_to="to" />
121 <label for="to_due_date">Due date to:</label>
122 <input type="text" size="10" id="to" name="to_due_date" class="flatpickr" />
126 <fieldset class="rows">
127 <legend>New due date:</legend>
130 <label for="new_hard_due_date">Hard due date: </label>
131 <input type="text" size="10" id="new_hard_due_date" name="new_hard_due_date" class="flatpickr" />
135 <label for="due_date_days">Or add number of days:</label>
136 <input type="text" size="10" id="due_date_days" name="due_date_days"/>
140 <fieldset class="rows">
141 <legend>Options:</legend>
144 <label for="preview_results">Preview results:</label>
145 <input type="checkbox" name="preview_results" id="preview_results" checked />
146 <span class="hint">This is not recommended when changing very large numbers of due dates.</span>
150 <fieldset class="action">
151 <input type="hidden" name="op" value="list" />
152 <input type="submit" class="btn btn-primary" value="Continue" />
153 <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
155 </form> <!-- /#extend_due_dates_form -->
156 [% ELSIF view == 'list' %]
157 [% IF checkouts.count %]
158 <form action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" method="post" id="process">
159 <div class="page-section">
160 <div class="btn-toolbar selections-toolbar">
161 <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
162 | <a id="clearall" href="#"><i class="fa fa-times"></i> Clear all</a>
164 <table id="checkouts">
171 <th>Home library</th>
172 <th>Checked out on</th>
173 <th>Checked out from</th>
174 <th>New due date</th>
178 [% FOR checkout IN checkouts %]
180 <td><input type="checkbox" name="issue_id" value="[% checkout.issue_id | html %]" /></td>
181 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
182 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
183 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
184 <td>[% checkout.item.home_branch.branchname | html %]</td>
185 <td>[% checkout.issuedate | $KohaDates %]</td>
186 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
188 [% new_due_dates.shift | $KohaDates as_due_date => 1 %]
193 </table> <!-- /#checkouts -->
194 </div> <!-- /.page-section -->
195 <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will modify all selected checkouts!</div>
196 <fieldset class="action">
197 <input type="hidden" name="op" value="modify" />
198 <input type="hidden" name="new_hard_due_date" value="[% new_hard_due_date | $KohaDates dateformat => 'iso' %]" />
199 <input type="hidden" name="due_date_days" value="[% due_date_days | html %]" />
200 <input type="submit" class="btn btn-primary" value="Modify selected checkouts" />
201 <a class="cancel" href="/cgi-bin/koha/tools/batch_extend_due_dates.pl">Cancel</a>
203 </form> <!-- /#process -->
205 <div class="dialog message">
206 No checkouts for the selected filters.
209 [% ELSIF view == 'report' %]
212 <div class="dialog message">
213 Due dates have been modified!
216 <div class="page-section">
217 <table id="checkouts_result">
223 <th>Home library</th>
224 <th>Checked out on</th>
225 <th>Checked out from</th>
229 [% FOR checkout IN checkouts %]
231 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
232 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
233 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
234 <td>[% checkout.item.home_branch.branchname | html %]</td>
235 <td>[% checkout.issuedate | $KohaDates %]</td>
236 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
240 </table> <!-- /#checkouts_result -->
241 </div> <!-- /.page-section -->
244 </div> <!-- /.col-sm-10.col-sm-push-2 -->
246 <div class="col-sm-2 col-sm-pull-10">
248 [% INCLUDE 'tools-menu.inc' %]
250 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
251 </div> <!-- /.row -->
253 [% MACRO jsinclude BLOCK %]
254 [% Asset.js("js/tools-menu.js") | $raw %]
255 [% INCLUDE 'calendar.inc' %]
256 [% INCLUDE 'datatables.inc' %]
257 [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
259 $(document).ready(function() {
261 $("#selectall").click(function(e){
263 $("#checkouts input[type='checkbox']").each(function(){
264 $(this).prop("checked", true);
268 $("#clearall").click(function(e){
270 $("#checkouts input[type='checkbox']").each(function(){
271 $(this).prop("checked", false);
275 $("#selectall").click();
277 $("#checkouts").dataTable($.extend(true, {}, dataTablesDefaults, {
279 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
280 { "aTargets": [1], "sType": "num-html" }
287 $("#checkouts_result").dataTable($.extend(true, {}, dataTablesDefaults, {
289 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
290 { "aTargets": [1], "sType": "num-html" }
297 $("#extend_due_dates_form").on('submit', function(e) {
298 var new_hard_due_date = $("#new_hard_due_date").val();
299 var due_date_days = $("#due_date_days").val();
300 if (new_hard_due_date && due_date_days ) {
302 alert(_("You must fill only one of the two due date options"));
304 } else if ( !new_hard_due_date && !due_date_days ) {
306 alert(_("You must fill at least one of the two due date options"));
313 $("#process").on('submit', function(e) {
314 if ($("input[type=checkbox][name='issue_id']:checked").length == 0) {
316 alert(_("Please select at least one checkout to process"));
326 [% INCLUDE 'intranet-bottom.inc' %]