8 [% PROCESS 'html_helpers.inc' %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Koha › Tools › Batch extend due dates</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 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'cat-search.inc' %]
20 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
23 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
26 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
29 <a href="#" aria-current="page">Batch extend due dates</a>
34 <div class="main container-fluid">
36 <div class="col-sm-10 col-sm-push-2">
39 <h1>Batch extend due dates</h1>
42 <div class="dialog message">
44 [% FOREACH message IN messages %]
45 [% IF message.type == 'success' %]
46 <div><i class="fa fa-check success"></i>
47 [% ELSIF message.type == 'warning' %]
48 <div><i class="fa fa-warning warn"></i>
49 [% ELSIF message.type == 'error' %]
50 <div><i class="fa fa-exclamation error"></i>
52 [% IF message.error %]
53 (The error was: [% message.error | html %]. See the Koha logfile for more information).
58 </div> <!-- .dialog.message -->
61 [% IF view == 'form' %]
62 <form method="post" action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" id="extend_due_dates_form">
63 <fieldset class="rows">
64 <legend>Checkout criteria:</legend>
67 <label for="categorycodes">Patrons' categories: </label>
68 [% SET categories = Categories.all() %]
69 <select id="categorycodes" name="categorycodes" multiple="multiple">
70 [% FOREACH cat IN categories %]
71 <option value="[% cat.categorycode | html %]">[% cat.description | html %]</option>
77 <label for="branchcodes">Libraries: </label>
78 <select name="branchcodes" id="branchcodes" multiple="multiple">
79 [% PROCESS options_for_libraries libraries => Branches.all() %]
84 <label for="from_due_date">Due date from: </label>
85 <input type="text" size="10" id="from" name="from_due_date" class="datepickerfrom" />
89 <label for="to_due_date">Due date to:</label>
90 <input type="text" size="10" id="to" name="to_due_date" class="datepickerto" />
94 <fieldset class="rows">
95 <legend>New due date:</legend>
98 <label for="new_hard_due_date">Hard due date: </label>
99 <input type="text" size="10" id="new_hard_due_date" name="new_hard_due_date" class="datepicker" />
103 <label for="due_date_days">Or add number of days:</label>
104 <input type="text" size="10" id="due_date_days" name="due_date_days"/>
108 <fieldset class="rows">
109 <legend>Options:</legend>
112 <label for="preview_results">Preview results:</label>
113 <input type="checkbox" name="preview_results" id="preview_results" checked />
114 <span class="hint">This is not recommended when changing very large numbers of due dates.</span>
118 <fieldset class="action">
119 <input type="hidden" name="op" value="list" />
120 <input type="submit" value="Continue" class="button" />
121 <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
123 </form> <!-- /#extend_due_dates_form -->
124 [% ELSIF view == 'list' %]
125 [% IF checkouts.count %]
126 <form action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" method="post" id="process">
128 <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
129 | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
131 <table id="checkouts">
138 <th>Home library</th>
139 <th>Checked out on</th>
140 <th>Checked out from</th>
141 <th>New due date</th>
145 [% FOR checkout IN checkouts %]
147 <td><input type="checkbox" name="issue_id" value="[% checkout.issue_id | html %]" /></td>
148 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
149 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
150 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
151 <td>[% checkout.item.home_branch.branchname | html %]</td>
152 <td>[% checkout.issuedate | $KohaDates %]</td>
153 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
155 [% new_due_dates.shift | $KohaDates as_due_date => 1 %]
160 </table> <!-- /#checkouts -->
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 %]" />
165 <input type="hidden" name="due_date_days" value="[% due_date_days | html %]" />
166 <input type="submit" value="Modify selected checkouts" class="button" />
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 <table id="checkouts_result">
186 <th>Home library</th>
187 <th>Checked out on</th>
188 <th>Checked out from</th>
192 [% FOR checkout IN checkouts %]
194 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
195 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
196 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
197 <td>[% checkout.item.home_branch.branchname | html %]</td>
198 <td>[% checkout.issuedate | $KohaDates %]</td>
199 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
203 </table> <!-- /#checkouts_result -->
206 </div> <!-- /.col-sm-10.col-sm-push-2 -->
208 <div class="col-sm-2 col-sm-pull-10">
210 [% INCLUDE 'tools-menu.inc' %]
212 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
213 </div> <!-- /.row -->
215 [% MACRO jsinclude BLOCK %]
216 [% Asset.js("js/tools-menu.js") | $raw %]
217 [% INCLUDE 'calendar.inc' %]
218 [% INCLUDE 'datatables.inc' %]
219 [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
221 $(document).ready(function() {
223 $("#selectall").click(function(e){
225 $("#checkouts input[type='checkbox']").each(function(){
226 $(this).prop("checked", true);
230 $("#clearall").click(function(e){
232 $("#checkouts input[type='checkbox']").each(function(){
233 $(this).prop("checked", false);
237 $("#selectall").click();
239 $("#checkouts").dataTable($.extend(true, {}, dataTablesDefaults, {
241 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
242 { "aTargets": [1], "sType": "num-html" }
249 $("#checkouts_result").dataTable($.extend(true, {}, dataTablesDefaults, {
251 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
252 { "aTargets": [1], "sType": "num-html" }
259 $("#extend_due_dates_form").on('submit', function(e) {
260 var new_hard_due_date = $("#new_hard_due_date").val();
261 var due_date_days = $("#due_date_days").val();
262 if (new_hard_due_date && due_date_days ) {
264 alert(_("You must fill only one of the two due date options"));
266 } else if ( !new_hard_due_date && !due_date_days ) {
268 alert(_("You must fill at least one of the two due date options"));
275 $("#process").on('submit', function(e) {
276 if ($("input[type=checkbox][name='issue_id']:checked").length == 0) {
278 alert(_("Please select at least one checkout to process"));
288 [% INCLUDE 'intranet-bottom.inc' %]