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"><i class="fa fa-home"></i></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" value="Continue" class="button" />
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">
131 <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
132 | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
134 <table id="checkouts">
141 <th>Home library</th>
142 <th>Checked out on</th>
143 <th>Checked out from</th>
144 <th>New due date</th>
148 [% FOR checkout IN checkouts %]
150 <td><input type="checkbox" name="issue_id" value="[% checkout.issue_id | html %]" /></td>
151 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
152 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
153 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
154 <td>[% checkout.item.home_branch.branchname | html %]</td>
155 <td>[% checkout.issuedate | $KohaDates %]</td>
156 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
158 [% new_due_dates.shift | $KohaDates as_due_date => 1 %]
163 </table> <!-- /#checkouts -->
164 <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will modify all selected checkouts!</div>
165 <fieldset class="action">
166 <input type="hidden" name="op" value="modify" />
167 <input type="hidden" name="new_hard_due_date" value="[% new_hard_due_date | $KohaDates dateformat => 'iso' %]" />
168 <input type="hidden" name="due_date_days" value="[% due_date_days | html %]" />
169 <input type="submit" value="Modify selected checkouts" class="button" />
170 <a class="cancel" href="/cgi-bin/koha/tools/batch_extend_due_dates.pl">Cancel</a>
172 </form> <!-- /#process -->
174 <div class="dialog message">
175 No checkouts for the selected filters.
178 [% ELSIF view == 'report' %]
179 <div class="dialog message">
180 Due dates have been modified!
183 <table id="checkouts_result">
189 <th>Home library</th>
190 <th>Checked out on</th>
191 <th>Checked out from</th>
195 [% FOR checkout IN checkouts %]
197 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
198 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
199 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
200 <td>[% checkout.item.home_branch.branchname | html %]</td>
201 <td>[% checkout.issuedate | $KohaDates %]</td>
202 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
206 </table> <!-- /#checkouts_result -->
209 </div> <!-- /.col-sm-10.col-sm-push-2 -->
211 <div class="col-sm-2 col-sm-pull-10">
213 [% INCLUDE 'tools-menu.inc' %]
215 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
216 </div> <!-- /.row -->
218 [% MACRO jsinclude BLOCK %]
219 [% Asset.js("js/tools-menu.js") | $raw %]
220 [% INCLUDE 'calendar.inc' %]
221 [% INCLUDE 'datatables.inc' %]
222 [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
224 $(document).ready(function() {
226 $("#selectall").click(function(e){
228 $("#checkouts input[type='checkbox']").each(function(){
229 $(this).prop("checked", true);
233 $("#clearall").click(function(e){
235 $("#checkouts input[type='checkbox']").each(function(){
236 $(this).prop("checked", false);
240 $("#selectall").click();
242 $("#checkouts").dataTable($.extend(true, {}, dataTablesDefaults, {
244 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
245 { "aTargets": [1], "sType": "num-html" }
252 $("#checkouts_result").dataTable($.extend(true, {}, dataTablesDefaults, {
254 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
255 { "aTargets": [1], "sType": "num-html" }
262 $("#extend_due_dates_form").on('submit', function(e) {
263 var new_hard_due_date = $("#new_hard_due_date").val();
264 var due_date_days = $("#due_date_days").val();
265 if (new_hard_due_date && due_date_days ) {
267 alert(_("You must fill only one of the two due date options"));
269 } else if ( !new_hard_due_date && !due_date_days ) {
271 alert(_("You must fill at least one of the two due date options"));
278 $("#process").on('submit', function(e) {
279 if ($("input[type=checkbox][name='issue_id']:checked").length == 0) {
281 alert(_("Please select at least one checkout to process"));
291 [% INCLUDE 'intranet-bottom.inc' %]