Bug 26213: Remove the use of jquery.checkboxes plugin when adding orders from MARC...
authorOwen Leonard <oleonard@myacpl.org>
Fri, 14 Aug 2020 14:18:00 +0000 (14:18 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 18 Aug 2020 13:45:48 +0000 (15:45 +0200)
This patch removes the use of the jquery.checkboxes plugin from the page
for adding orders to a basket from a staged MARC file.

This patch fixes an unreported bug wherein the "select all" and "clear
all" controls affected not only MARC record checkboxes but also the
"show inactive funds" checkboxes.

To test, apply the patch and go to Acquisitions.

- Go to Vendor -> Add to basket -> From a staged file.
- Select a staged file with multiple records.
- Test the "Select all" and "Clear all" links at the top of the "Select
  to import" tab. They should work correctly to select and deselect
  checkboxes corresponding to staged MARC records.

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/acqui/addorderiso2709.tt
koha-tmpl/intranet-tmpl/prog/js/addorderiso2709.js

index 0e07f20..ebe364e 100644 (file)
@@ -15,7 +15,6 @@
 [%# As long as cataloging plugins rely on <script> tags added inline, JS must be in the header %]
 [% Asset.js("js/acquisitions-menu.js") | $raw %]
 [% INCLUDE 'datatables.inc' %]
-[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
 [% Asset.js("js/acq.js") | $raw %]
 [% Asset.js("js/funds_sorts.js") | $raw %]
 [% Asset.js("js/addorderiso2709.js") | $raw %]
index 8382532..04b8851 100644 (file)
@@ -37,15 +37,13 @@ $(document).ready(function() {
     $("div.biblio.unselected select").prop('disabled', false);
     $("div.biblio.unselected input").prop('disabled', false);
 
-    $("#checkAll").click(function(){
-        $("#Aform").checkCheckboxes();
-        $("input:checkbox[name='import_record_id']").change();
-        return false;
+    $("#checkAll").click(function(e){
+        e.preventDefault();
+        $("input:checkbox[name='import_record_id']").prop("checked", true).change();
     });
-    $("#unCheckAll").click(function(){
-        $("#Aform").unCheckCheckboxes();
-        $("input:checkbox[name='import_record_id']").change();
-        return false;
+    $("#unCheckAll").click(function(e){
+        e.preventDefault();
+        $("input:checkbox[name='import_record_id']").prop("checked", false).change();
     });
 
     $("input#add_order").on("click", function(e){