Merge pull request #16030 from atm-adrien/FIX/Linked_extrafields_10.0

FIX : Linked extrafields lists
This commit is contained in:
Laurent Destailleur 2021-01-22 13:35:56 +01:00 committed by GitHub
commit d23e6646ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7136,12 +7136,36 @@ abstract class CommonObject
var parent = $(this).find("option[parent]:first").attr("parent");
var infos = parent.split(":");
var parent_list = infos[0];
//Hide daughters lists
if ($("#"+child_list).val() == 0 && $("#"+parent_list).val() == 0){
$("#"+child_list).hide();
//Show mother lists
} else if ($("#"+parent_list).val() != 0){
$("#"+parent_list).show();
}
//Show the child list if the parent list value is selected
$("select[name=\""+parent_list+"\"]").click(function() {
if ($(this).val() != 0){
$("#"+child_list).show()
}
});
//When we change parent list
$("select[name=\""+parent_list+"\"]").change(function() {
showOptions(child_list, parent_list, orig_select[child_list]);
//Select the value 0 on child list after a change on the parent list
$("#"+child_list).val(0).trigger("change");
//Hide child lists if the parent value is set to 0
if ($(this).val() == 0){
$("#"+child_list).hide();
}
$("select[name=\""+parent_list+"\"]").change(function() {
showOptions(child_list, parent_list, orig_select[child_list]);
});
});
}
setListDependencies();
});
</script>'."\n";