Bug 26983: Fix [un]select all links in inventory
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 2 Dec 2020 09:26:25 +0000 (10:26 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 8 Jan 2021 14:21:51 +0000 (15:21 +0100)
The select/unselect all links took into account only the items displayed
when the page was loaded (so 20).

Test plan:
1. Go to Tools-> Inventory-> Do a Search to produce more than 20 results
2. Select 50, 100 or All entries to show
3. click on Select All
=> All items must be selected, not only the first 20

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt

index e9cdad3..a6fe072 100644 (file)
                 return false;
             });
 
-            var checkboxes = $("#inventoryt input:checkbox");
             $(".checkall").click(function(e){
                 e.preventDefault();
-                checkboxes.each(function(){
+                $("#inventoryt input:checkbox").each(function(){
                     $(this).prop("checked", true);
                 });
             });
             $(".clearall").click(function(e){
                 e.preventDefault();
-                checkboxes.each(function(){
+                $("#inventoryt input:checkbox").each(function(){
                     $(this).prop("checked", false);
                 });
             });