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 <div id="breadcrumbs">
21 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
22 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
23 <a href="/cgi-bin/koha/tools/batch_extend_due_dates.pl">Batch extend due dates</a>
26 <div class="main container-fluid">
28 <div class="col-sm-10 col-sm-push-2">
31 <h1>Batch extend due dates</h1>
34 <div class="dialog message">
36 [% FOREACH message IN messages %]
37 [% IF message.type == 'success' %]
38 <div><i class="fa fa-check success"></i>
39 [% ELSIF message.type == 'warning' %]
40 <div><i class="fa fa-warning warn"></i>
41 [% ELSIF message.type == 'error' %]
42 <div><i class="fa fa-exclamation error"></i>
44 [% IF message.error %]
45 (The error was: [% message.error | html %]. See the Koha logfile for more information).
50 </div> <!-- .dialog.message -->
53 [% IF view == 'form' %]
54 <form method="post" action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" id="extend_due_dates_form">
55 <fieldset class="rows">
56 <legend>Checkout criteria:</legend>
59 <label for="categorycodes">Patrons' categories: </label>
60 [% SET categories = Categories.all() %]
61 <select id="categorycodes" name="categorycodes" multiple="multiple">
62 [% FOREACH cat IN categories %]
63 <option value="[% cat.categorycode | html %]">[% cat.description | html %]</option>
69 <label for="branchcodes">Libraries: </label>
70 <select name="branchcodes" id="branchcodes" multiple="multiple">
71 [% PROCESS options_for_libraries libraries => Branches.all() %]
76 <label for="from_due_date">Due date from: </label>
77 <input type="text" size="10" id="from" name="from_due_date" class="datepickerfrom" />
81 <label for="to_due_date">Due date to:</label>
82 <input type="text" size="10" id="to" name="to_due_date" class="datepickerto" />
86 <fieldset class="rows">
87 <legend>New due date:</legend>
90 <label for="new_hard_due_date">Hard due date: </label>
91 <input type="text" size="10" id="new_hard_due_date" name="new_hard_due_date" class="datepicker" />
95 <label for="due_date_days">Or add number of days:</label>
96 <input type="text" size="10" id="due_date_days" name="due_date_days"/>
100 <fieldset class="action">
101 <input type="hidden" name="op" value="list" />
102 <input type="submit" value="Continue" class="button" />
103 <a class="cancel" href="/cgi-bin/koha/tools/tools-home.pl">Cancel</a>
105 </form> <!-- /#extend_due_dates_form -->
106 [% ELSIF view == 'list' %]
107 [% IF checkouts.count %]
108 <form action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" method="post" id="process">
110 <a id="selectall" href="#"><i class="fa fa-check"></i> Select all</a>
111 | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a>
113 <table id="checkouts">
120 <th>Home library</th>
121 <th>Checked out on</th>
122 <th>Checked out from</th>
123 <th>New due date</th>
127 [% FOR checkout IN checkouts %]
129 <td><input type="checkbox" name="issue_id" value="[% checkout.issue_id | html %]" /></td>
130 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
131 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
132 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
133 <td>[% checkout.item.home_branch.branchname | html %]</td>
134 <td>[% checkout.issuedate | $KohaDates %]</td>
135 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
137 [% new_due_dates.shift | $KohaDates as_due_date => 1 %]
142 </table> <!-- /#checkouts -->
143 <div class="note"><i class="fa fa-exclamation"></i> Reminder: this action will modify all selected checkouts!</div>
144 <fieldset class="action">
145 <input type="hidden" name="op" value="modify" />
146 <input type="hidden" name="new_hard_due_date" value="[% new_hard_due_date | $KohaDates %]" />
147 <input type="hidden" name="due_date_days" value="[% due_date_days | html %]" />
148 <input type="submit" value="Modify selected checkouts" class="button" />
149 <a class="cancel" href="/cgi-bin/koha/tools/batch_extend_due_dates.pl">Cancel</a>
151 </form> <!-- /#process -->
153 <div class="dialog message">
154 No checkouts for the selected filters.
157 [% ELSIF view == 'report' %]
158 <div class="dialog message">
159 Due dates have been modified!
162 <table id="checkouts_result">
168 <th>Home library</th>
169 <th>Checked out on</th>
170 <th>Checked out from</th>
174 [% FOR checkout IN checkouts %]
176 <td>[% checkout.date_due | $KohaDates as_due_date => 1 %]</td>
177 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout.item.biblio.biblionumber | uri %]">[% checkout.item.biblio.title | html %]</a></td>
178 <td>[% ItemTypes.GetDescription( checkout.item.effective_itemtype ) | html %]</td>
179 <td>[% checkout.item.home_branch.branchname | html %]</td>
180 <td>[% checkout.issuedate | $KohaDates %]</td>
181 <td>[% Branches.GetName( checkout.branchcode ) | html %]</td>
185 </table> <!-- /#checkouts_result -->
188 </div> <!-- /.col-sm-10.col-sm-push-2 -->
190 <div class="col-sm-2 col-sm-pull-10">
192 [% INCLUDE 'tools-menu.inc' %]
194 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
195 </div> <!-- /.row -->
197 [% MACRO jsinclude BLOCK %]
198 [% Asset.js("js/tools-menu.js") | $raw %]
199 [% INCLUDE 'calendar.inc' %]
200 [% INCLUDE 'datatables.inc' %]
201 [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
203 $(document).ready(function() {
205 $("#selectall").click(function(e){
207 $("#checkouts input[type='checkbox']").each(function(){
208 $(this).prop("checked", true);
212 $("#clearall").click(function(e){
214 $("#checkouts input[type='checkbox']").each(function(){
215 $(this).prop("checked", false);
219 $("#selectall").click();
221 $("#checkouts").dataTable($.extend(true, {}, dataTablesDefaults, {
223 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
224 { "aTargets": [1], "sType": "num-html" }
231 $("#checkouts_result").dataTable($.extend(true, {}, dataTablesDefaults, {
233 { "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
234 { "aTargets": [1], "sType": "num-html" }
241 $("#extend_due_dates_form").on('submit', function(e) {
242 var new_hard_due_date = $("#new_hard_due_date").val();
243 var due_date_days = $("#due_date_days").val();
244 if (new_hard_due_date && due_date_days ) {
246 alert(_("You must fill only one of the two due date options"));
248 } else if ( !new_hard_due_date && !due_date_days ) {
250 alert(_("You must fill at least one of the two due date options"));
257 $("#process").on('submit', function(e) {
258 if ($("input[type=checkbox][name='issue_id']:checked").length == 0) {
260 alert(_("Please select at least one checkout to process"));
270 [% INCLUDE 'intranet-bottom.inc' %]