From 9eb20fc82dcb8e1bded2b353fc61c98983f77f13 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 22 Jul 2026 10:26:40 +0200 Subject: [PATCH] Bug 43110: (bug 28308 follow-up) Disable checkboxes on the detail view Checkboxes must be disabled on the detail page as we cannot submit the changes. Test plan: 1 - Edit a patron, set a value for advance notices, do not check any transports 2 - View the details for the patron: http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=5 3 - Note the checkboxes are disabled QA: The logic is a bit weird as messaging_form_inactive is not set if the pref is off, but the table is not displayed in this case. Signed-off-by: Nick Clemens Signed-off-by: Lucas Gass --- .../en/includes/messaging-preference-form.inc | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc index 324f8aa54b..6b7c489618 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -338,21 +338,23 @@ [% END %] - + function updateCheckboxes() { + const isDisabled = !selectElement.value; + if (smsCheckbox) smsCheckbox.disabled = isDisabled; + if (emailCheckbox) emailCheckbox.disabled = isDisabled; + if (digestCheckbox) digestCheckbox.disabled = isDisabled; + } + updateCheckboxes(); + selectElement.addEventListener("change", updateCheckboxes); + }); + +[% END %]