Bug 26201: Remove the use of jquery.checkboxes plugin from batch extend due dates page

This patch removes the use of the jquery.checkboxes plugin from the
batch extend due dates page.

Unrelated change: Removed 'enctype="multipart/form-data"' from the form
because there is no file upload.

To test, apply the patch and go to Tools -> Batch extend due dates.

 - Submit the form with parameters which will return a set of multiple
   checkouts.
 - On the results page, test the "Select all" and "Clear all" links to
   confirm that they work correctly.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Owen Leonard 2020-08-13 12:34:19 +00:00 committed by Jonathan Druart
parent 9371685b97
commit 467e491a25

View file

@ -51,7 +51,7 @@
[% END %]
[% IF view == 'form' %]
<form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" id="extend_due_dates_form">
<form method="post" action="/cgi-bin/koha/tools/batch_extend_due_dates.pl" id="extend_due_dates_form">
<fieldset class="rows">
<legend>Checkout criteria:</legend>
<ol>
@ -198,22 +198,27 @@
[% Asset.js("js/tools-menu.js") | $raw %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
[% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
<script>
$(document).ready(function() {
$("#selectall").click(function(e) {
$("#selectall").click(function(e){
e.preventDefault();
$("#checkouts").checkCheckboxes();
$("#checkouts input[type='checkbox']").each(function(){
$(this).prop("checked", true);
});
});
$("#clearall").click(function(e) {
$("#clearall").click(function(e){
e.preventDefault();
$("#checkouts").unCheckCheckboxes();
$("#checkouts input[type='checkbox']").each(function(){
$(this).prop("checked", false);
});
});
$("#selectall").click();
$("table#checkouts").dataTable($.extend(true, {}, dataTablesDefaults, {
$("#checkouts").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
{ "aTargets": [1], "sType": "num-html" }
@ -223,7 +228,7 @@
"bPaginate": false
}));
$("table#checkouts_result").dataTable($.extend(true, {}, dataTablesDefaults, {
$("#checkouts_result").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [0, 3], "bSortable": false, "bSearchable": false },
{ "aTargets": [1], "sType": "num-html" }