Bug 26216: Remove the use of jquery.checkboxes plugin from catalog search results
authorOwen Leonard <oleonard@myacpl.org>
Fri, 14 Aug 2020 17:28:22 +0000 (17:28 +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 jquery.checkboxes plugin from the
staff interface catalog search results page.

To test, apply the patch and perform a catalog search in the staff
interface which will return results.

On the search results page test the "Select all" and "Clear all" links
at the top of the results. They should work correctly.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
koha-tmpl/intranet-tmpl/prog/js/pages/results.js

index 72cd9a0..b8b45d6 100644 (file)
     [% INCLUDE 'strings.inc' %]
     [% Asset.js("js/browser.js") | $raw %]
     [% Asset.js("lib/hc-sticky.js") | $raw %]
-    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
     [% Asset.js("js/coce.js") | $raw %]
     <script>
         var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
index 6c3a488..d9978b0 100644 (file)
@@ -164,7 +164,7 @@ $(document).ready(function() {
         }
     });
     $("#bookbag_form").ready(function(){
-        $("#bookbag_form").unCheckCheckboxes();
+        $("#bookbag_form input:checkbox").prop("checked", false);
         var bibnums = getContextBiblioNumbers();
         if (bibnums) {
             for (var i=0; i < bibnums.length; i++) {
@@ -211,18 +211,14 @@ function highlightOn() {
 
 
 function selectAll () {
-    $("#bookbag_form").checkCheckboxes();
     $("#bookbag_form").find("input[type='checkbox'][name='biblionumber']").each(function(){
-        $(this).change();
+        $(this).prop("checked", true ).change();
     } );
-    return false;
 }
 function clearAll () {
-    $("#bookbag_form").unCheckCheckboxes();
     $("#bookbag_form").find("input[type='checkbox'][name='biblionumber']").each(function(){
-        $(this).change();
+        $(this).prop("checked", false).change();
     } );
-    return false;
 }
 function placeHold () {
     var checkedItems = $(".selection:checked");