Bug 26153: Remove the use of jquery.checkboxes plugin from items lost report
authorOwen Leonard <oleonard@myacpl.org>
Wed, 5 Aug 2020 18:24:08 +0000 (18:24 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 19 Aug 2020 06:24:39 +0000 (08:24 +0200)
This patch removes the use of the jquery.checkboxes plugin from the
lost items report page and replaces it with custom JS.

To test, apply the patch and go to Reports -> Lost items.

- Run the report with parameters which will return multiple results.
- On the results page Create a CSV export profile if there's none.
- On the results page test the "Select all" and "Clear all"
  links at the top of the results. The controls should work correctly.

Signed-off-by: Didier Gautheron <didier.gautheron@biblibre.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/reports/itemslost.tt

index 9f0ec54..5e89226 100644 (file)
     [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
     [% INCLUDE 'columns_settings.inc' %]
     [% Asset.js("js/table_filters.js") | $raw %]
-    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
     <script>
         $(document).ready(function() {
             var columns_settings = [% TablesSettings.GetColumns( 'reports', 'lostitems', 'lostitems-table', 'json' ) | $raw %];
 
             $(".SelectAll").on("click",function(e){
                 e.preventDefault();
-                $("#lostitems-table").checkCheckboxes();
+                $("#lostitems-table input:checkbox").each(function(){
+                    $(this).prop("checked", true);
+                });
                 itemSelectionBuildActionLinks();
             });
 
             $(".ClearAll").on("click",function(e){
                 e.preventDefault();
-                $("#lostitems-table").unCheckCheckboxes();
+                $("#lostitems-table input:checkbox").each(function(){
+                    $(this).prop("checked", false);
+                });
                 itemSelectionBuildActionLinks();
             });
         });