8 [% PROCESS 'html_helpers.inc' %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Batch extend due dates › Tools › Koha</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 [% Asset.css("css/humanmsg.css") | $raw %]
16 <body id="tools_batch_extend_due_dates" 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>Batch extend due dates</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">
37 <h1>Batch extend due dates</h1>
40 <div class="dialog message">
42 [% FOREACH message IN messages %]
43 [% IF message.type == 'success' %]
44 <div><i class="fa fa-check success"></i>
45 [% ELSIF message.type == 'warning' %]
46 <div><i class="fa-solid fa-triangle-exclamation warn"></i>
47 [% ELSIF message.type == 'error' %]
48 <div><i class="fa fa-exclamation error"></i>
50 [% IF message.error %]
51 <span>(The error was: [% message.error | html %]. See the Koha logfile for more information).</span>
56 </div> <!-- .dialog.message -->
59 [% IF view == 'form' %]
60 <form method="post" action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" id="extend_due_dates_form">
61 <fieldset class="rows">
62 <legend>Checkout criteria:</legend>
65 <label for="categorycodes">Patrons' categories: </label>
66 [% SET categories = Categories.all() %]
67 <select id="categorycodes" name="categorycodes" multiple="multiple">
68 [% FOREACH cat IN categories %]
69 <option value="[% cat.categorycode | html %]">[% cat.description | html %]</option>
75 <label for="branchcodes">Libraries: </label>
76 <select name="branchcodes" id="branchcodes" multiple="multiple">
77 [% PROCESS options_for_libraries libraries => Branches.all() %]
82 <label for="from_due_date">Due date from: </label>
83 <input type="text" size="10" id="from" name="from_due_date" class="flatpickr" data-date_to="to" />
87 <label for="to_due_date">Due date to:</label>
88 <input type="text" size="10" id="to" name="to_due_date" class="flatpickr" />
92 <fieldset class="rows">
93 <legend>New due date:</legend>
96 <label for="new_hard_due_date">Hard due date: </label>
97 <input type="text" size="10" id="new_hard_due_date" name="new_hard_due_date" class="flatpickr" />
101 <label for="due_date_days">Or add number of days:</label>
102 <input type="text" size="10" id="due_date_days" name="due_date_days"/>
106 <fieldset class="rows">
107 <legend>Options:</legend>
110 <label for="preview_results">Preview results:</label>
111 <input type="checkbox" name="preview_results" id="preview_results" checked />
112 <span class="hint">This is not recommended when changing very large numbers of due dates.</span>
116 <fieldset class="action">
117 <input type="hidden" name="op" value="list" />
118 <input type="submit" class="btn btn-primary" value="Continue" />
119 <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
121 </form> <!-- /#extend_due_dates_form -->
122 [% ELSIF view == 'list' %]
123 [% IF checkouts.count %]
124 <form action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" method="post" id="process">
125 <div class="page-section">
126 <div class="btn-toolbar selections-toolbar">
127 <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
128 | <a id="clearall" href="#"><i class="fa fa-times"></i> Clear all</a>
130 <table id="checkouts">
137 <th>Home library</th>
138 <th>Checked out on</th>
139 <th>Checked out from</th>
140 <th>New due date</th>
144 [% FOR checkout IN checkouts %]
146 <td><input type="checkbox" name="issue_id" value="[% checkout.issue_id | html %]" /></td>
147 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
148 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
149 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
150 <td>[% checkout.item.home_branch.branchname | html %]</td>
151 <td>[% checkout.issuedate | $KohaDates %]</td>
152 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
154 [% new_due_dates.shift | $KohaDates as_due_date => 1 %]
159 </table> <!-- /#checkouts -->
160 </div> <!-- /.page-section -->
161 <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will modify all selected checkouts!</div>
162 <fieldset class="action">
163 <input type="hidden" name="op" value="modify" />
164 <input type="hidden" name="new_hard_due_date" value="[% new_hard_due_date | $KohaDates dateformat => 'iso' %]" />
165 <input type="hidden" name="due_date_days" value="[% due_date_days | html %]" />
166 <input type="submit" class="btn btn-primary" value="Modify selected checkouts" />
167 <a class="cancel" href="/cgi-bin/koha/tools/batch_extend_due_dates.pl">Cancel</a>
169 </form> <!-- /#process -->
171 <div class="dialog message">
172 No checkouts for the selected filters.
175 [% ELSIF view == 'report' %]
176 <div class="dialog message">
177 Due dates have been modified!
180 <div class="page-section">
181 <table id="checkouts_result">
187 <th>Home library</th>
188 <th>Checked out on</th>
189 <th>Checked out from</th>
193 [% FOR checkout IN checkouts %]
195 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
196 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
197 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
198 <td>[% checkout.item.home_branch.branchname | html %]</td>
199 <td>[% checkout.issuedate | $KohaDates %]</td>
200 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
204 </table> <!-- /#checkouts_result -->
205 </div> <!-- /.page-section -->
208 </div> <!-- /.col-sm-10.col-sm-push-2 -->
210 <div class="col-sm-2 col-sm-pull-10">
212 [% INCLUDE 'tools-menu.inc' %]
214 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
215 </div> <!-- /.row -->
217 [% MACRO jsinclude BLOCK %]
218 [% Asset.js("js/tools-menu.js") | $raw %]
219 [% INCLUDE 'calendar.inc' %]
220 [% INCLUDE 'datatables.inc' %]
221 [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
223 $(document).ready(function() {
225 $("#selectall").click(function(e){
227 $("#checkouts input[type='checkbox']").each(function(){
228 $(this).prop("checked", true);
232 $("#clearall").click(function(e){
234 $("#checkouts input[type='checkbox']").each(function(){
235 $(this).prop("checked", false);
239 $("#selectall").click();
241 $("#checkouts").dataTable($.extend(true, {}, dataTablesDefaults, {
243 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
244 { "aTargets": [1], "sType": "num-html" }
251 $("#checkouts_result").dataTable($.extend(true, {}, dataTablesDefaults, {
253 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
254 { "aTargets": [1], "sType": "num-html" }
261 $("#extend_due_dates_form").on('submit', function(e) {
262 var new_hard_due_date = $("#new_hard_due_date").val();
263 var due_date_days = $("#due_date_days").val();
264 if (new_hard_due_date && due_date_days ) {
266 alert(_("You must fill only one of the two due date options"));
268 } else if ( !new_hard_due_date && !due_date_days ) {
270 alert(_("You must fill at least one of the two due date options"));
277 $("#process").on('submit', function(e) {
278 if ($("input[type=checkbox][name='issue_id']:checked").length == 0) {
280 alert(_("Please select at least one checkout to process"));
290 [% INCLUDE 'intranet-bottom.inc' %]