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 <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1137511e63)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit afb52c1eaa)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2023-06-07 11:31:20 +02:00 committed by Matt Blenkinsop
parent f23ca87c3d
commit dd8c487a50

View file

@ -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();
});
</script>
[% END %]