From 868319a463631a27a5703e477c4387b6f37d4517 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 (cherry picked from commit be7c705d3bfba2044d4656e86b9e94c537c26945) Signed-off-by: Lucas Gass (cherry picked from commit 870369ae5732cc05ac681c70c8ef5191c9946497) Signed-off-by: Aleisha Amohia --- koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt | 2 +- koha-tmpl/intranet-tmpl/prog/js/acq.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 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 be2c58c4e5..5c5c5d7b7a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tt @@ -138,7 +138,7 @@ [% 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