From be7c705d3bfba2044d4656e86b9e94c537c26945 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 21 Sep 2020 10:59:56 +0000 Subject: [PATCH] Bug 26497: "Hide all columns" throws Javascript error on aqplan.pl This patch updates the JavaScript for checking and unchecking checkboxes on the Acquisitions planning page so that it doesn't require the checkboxes plugin. To test, apply the patch and go to Administration -> Budgets -> Budget details -> Planning. On the planning page, test the "Show all columns" and "Hide all columns" checkboxes. They should work correctly to show and hide the correct columns. Signed-off-by: Henry Bolshaw Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt | 4 ++-- koha-tmpl/intranet-tmpl/prog/js/acq.js | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt index 08a03e7dc0..00c56d3c5b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt @@ -139,8 +139,8 @@ [% UNLESS ( budget_line.budget_lock ) %] - - + + [% ELSE %]
not owned
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/acq.js b/koha-tmpl/intranet-tmpl/prog/js/acq.js index e12be33513..7f6bdd7e43 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/acq.js +++ b/koha-tmpl/intranet-tmpl/prog/js/acq.js @@ -364,14 +364,18 @@ function showColumn(num){ } function showAllColumns(){ - $("#selections").checkCheckboxes(); + $("#selections").find("input:checkbox").each(function () { + $(this).prop("checked", true); + }); $("#selections span").addClass("selected"); $("#plan td:nth-child(2),#plan tr th:nth-child(2)").nextAll().show(); $("#hideall").prop("checked", false).parent().removeClass("selected"); } function hideAllColumns(){ var allCols = $("#plan th").length; - $("#selections").unCheckCheckboxes(); + $("#selections").find("input:checkbox").each(function () { + $(this).prop("checked", false); + }); $("#selections span").removeClass("selected"); $("#plan td:nth-child(2),#plan th:nth-child(2)").nextUntil("th:nth-child("+(allCols-1)+"),td:nth-child("+(allCols-1)+")").hide(); // hide all but the last two columns $("#hideall").prop("checked", true).parent().addClass("selected"); -- 2.39.5