Bug 26201: Remove the use of jquery.checkboxes plugin from batch extend due dates...
authorOwen Leonard <oleonard@myacpl.org>
Thu, 13 Aug 2020 12:34:19 +0000 (12:34 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 18 Aug 2020 13:45:49 +0000 (15:45 +0200)
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>

koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_extend_due_dates.tt

index e572b2b..3736f99 100644 (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>
     [% 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" }
                 "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" }