Merge pull request #16030 from atm-adrien/FIX/Linked_extrafields_10.0
FIX : Linked extrafields lists
This commit is contained in:
commit
d23e6646ed
@ -7136,12 +7136,36 @@ abstract class CommonObject
|
|||||||
var parent = $(this).find("option[parent]:first").attr("parent");
|
var parent = $(this).find("option[parent]:first").attr("parent");
|
||||||
var infos = parent.split(":");
|
var infos = parent.split(":");
|
||||||
var parent_list = infos[0];
|
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() {
|
$("select[name=\""+parent_list+"\"]").change(function() {
|
||||||
showOptions(child_list, parent_list, orig_select[child_list]);
|
showOptions(child_list, parent_list, orig_select[child_list]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setListDependencies();
|
setListDependencies();
|
||||||
});
|
});
|
||||||
</script>'."\n";
|
</script>'."\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user