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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
25 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
28 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
31 <a href="#" aria-current="page">Batch extend due dates</a>
37 <div class="main container-fluid">
39 <div class="col-sm-10 col-sm-push-2">
42 <h1>Batch extend due dates</h1>
45 <div class="dialog message">
47 [% FOREACH message IN messages %]
48 [% IF message.type == 'success' %]
49 <div><i class="fa fa-check success"></i>
50 [% ELSIF message.type == 'warning' %]
51 <div><i class="fa fa-warning warn"></i>
52 [% ELSIF message.type == 'error' %]
53 <div><i class="fa fa-exclamation error"></i>
55 [% IF message.error %]
56 <span>(The error was: [% message.error | html %]. See the Koha logfile for more information).</span>
61 </div> <!-- .dialog.message -->
64 [% IF view == 'form' %]
65 <form method="post" action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" id="extend_due_dates_form">
66 <fieldset class="rows">
67 <legend>Checkout criteria:</legend>
70 <label for="categorycodes">Patrons' categories: </label>
71 [% SET categories = Categories.all() %]
72 <select id="categorycodes" name="categorycodes" multiple="multiple">
73 [% FOREACH cat IN categories %]
74 <option value="[% cat.categorycode | html %]">[% cat.description | html %]</option>
80 <label for="branchcodes">Libraries: </label>
81 <select name="branchcodes" id="branchcodes" multiple="multiple">
82 [% PROCESS options_for_libraries libraries => Branches.all() %]
87 <label for="from_due_date">Due date from: </label>
88 <input type="text" size="10" id="from" name="from_due_date" class="flatpickr" data-date_to="to" />
92 <label for="to_due_date">Due date to:</label>
93 <input type="text" size="10" id="to" name="to_due_date" class="flatpickr" />
97 <fieldset class="rows">
98 <legend>New due date:</legend>
101 <label for="new_hard_due_date">Hard due date: </label>
102 <input type="text" size="10" id="new_hard_due_date" name="new_hard_due_date" class="flatpickr" />
106 <label for="due_date_days">Or add number of days:</label>
107 <input type="text" size="10" id="due_date_days" name="due_date_days"/>
111 <fieldset class="rows">
112 <legend>Options:</legend>
115 <label for="preview_results">Preview results:</label>
116 <input type="checkbox" name="preview_results" id="preview_results" checked />
117 <span class="hint">This is not recommended when changing very large numbers of due dates.</span>
121 <fieldset class="action">
122 <input type="hidden" name="op" value="list" />
123 <input type="submit" class="btn btn-primary" value="Continue" />
124 <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
126 </form> <!-- /#extend_due_dates_form -->
127 [% ELSIF view == 'list' %]
128 [% IF checkouts.count %]
129 <form action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" method="post" id="process">
130 <div class="page-section">
131 <div class="btn-toolbar selections-toolbar">
132 <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
133 | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
135 <table id="checkouts">
142 <th>Home library</th>
143 <th>Checked out on</th>
144 <th>Checked out from</th>
145 <th>New due date</th>
149 [% FOR checkout IN checkouts %]
151 <td><input type="checkbox" name="issue_id" value="[% checkout.issue_id | html %]" /></td>
152 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
153 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
154 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
155 <td>[% checkout.item.home_branch.branchname | html %]</td>
156 <td>[% checkout.issuedate | $KohaDates %]</td>
157 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
159 [% new_due_dates.shift | $KohaDates as_due_date => 1 %]
164 </table> <!-- /#checkouts -->
165 </div> <!-- /.page-section -->
166 <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will modify all selected checkouts!</div>
167 <fieldset class="action">
168 <input type="hidden" name="op" value="modify" />
169 <input type="hidden" name="new_hard_due_date" value="[% new_hard_due_date | $KohaDates dateformat => 'iso' %]" />
170 <input type="hidden" name="due_date_days" value="[% due_date_days | html %]" />
171 <input type="submit" class="btn btn-primary" value="Modify selected checkouts" />
172 <a class="cancel" href="/cgi-bin/koha/tools/batch_extend_due_dates.pl">Cancel</a>
174 </form> <!-- /#process -->
176 <div class="dialog message">
177 No checkouts for the selected filters.
180 [% ELSIF view == 'report' %]
181 <div class="dialog message">
182 Due dates have been modified!
185 <div class="page-section">
186 <table id="checkouts_result">
192 <th>Home library</th>
193 <th>Checked out on</th>
194 <th>Checked out from</th>
198 [% FOR checkout IN checkouts %]
200 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
201 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
202 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
203 <td>[% checkout.item.home_branch.branchname | html %]</td>
204 <td>[% checkout.issuedate | $KohaDates %]</td>
205 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
209 </table> <!-- /#checkouts_result -->
210 </div> <!-- /.page-section -->
213 </div> <!-- /.col-sm-10.col-sm-push-2 -->
215 <div class="col-sm-2 col-sm-pull-10">
217 [% INCLUDE 'tools-menu.inc' %]
219 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
220 </div> <!-- /.row -->
222 [% MACRO jsinclude BLOCK %]
223 [% Asset.js("js/tools-menu.js") | $raw %]
224 [% INCLUDE 'calendar.inc' %]
225 [% INCLUDE 'datatables.inc' %]
226 [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
228 $(document).ready(function() {
230 $("#selectall").click(function(e){
232 $("#checkouts input[type='checkbox']").each(function(){
233 $(this).prop("checked", true);
237 $("#clearall").click(function(e){
239 $("#checkouts input[type='checkbox']").each(function(){
240 $(this).prop("checked", false);
244 $("#selectall").click();
246 $("#checkouts").dataTable($.extend(true, {}, dataTablesDefaults, {
248 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
249 { "aTargets": [1], "sType": "num-html" }
256 $("#checkouts_result").dataTable($.extend(true, {}, dataTablesDefaults, {
258 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
259 { "aTargets": [1], "sType": "num-html" }
266 $("#extend_due_dates_form").on('submit', function(e) {
267 var new_hard_due_date = $("#new_hard_due_date").val();
268 var due_date_days = $("#due_date_days").val();
269 if (new_hard_due_date && due_date_days ) {
271 alert(_("You must fill only one of the two due date options"));
273 } else if ( !new_hard_due_date && !due_date_days ) {
275 alert(_("You must fill at least one of the two due date options"));
282 $("#process").on('submit', function(e) {
283 if ($("input[type=checkbox][name='issue_id']:checked").length == 0) {
285 alert(_("Please select at least one checkout to process"));
295 [% INCLUDE 'intranet-bottom.inc' %]