From 1137511e63e9b6fd0b1d52f34fb35b0ffb8dc363 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 7 Jun 2023 11:31:20 +0200 Subject: [PATCH] Bug 33581: Disable sample holiday if libraries are not selected If libraries are not selected we should not try to insert holidays, or the installer will fail with a missing FK. This patch simply disable and uncheck the checkbox when libraries are not going to be inserted. Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- .../intranet-tmpl/prog/en/modules/installer/step3.tt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt index 126c18ecc5..18d442093a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -463,6 +463,15 @@ $( container ).find("input").prop("checked", state); $( container ).find(".selectall,.deselectall").toggle(); }); + function update_sample_libraries_holidays(){ + let checked = $("#sample_libraries").prop("checked"); + $("#sample_libraries_holidays").prop("disabled", !checked); + if (!checked) { + $("#sample_libraries_holidays").prop("checked", false); + } + }; + $("#sample_libraries").on("change", update_sample_libraries_holidays); + $("#sample_libraries").change(); }); [% END %] -- 2.39.5