Merge branch '1266-Checkbox-All-modules-en-operaciones-masivas-4472-onenet' into 'develop'
Prevent select any and others options at the same time for agents/modules multis… See merge request !829
This commit is contained in:
commit
df8210924c
|
@ -788,6 +788,39 @@ $(document).ready (function () {
|
|||
$("#module_type").trigger("change");
|
||||
}
|
||||
});
|
||||
|
||||
$('#agents').change(function(e){
|
||||
for(var i=0;i<document.forms["form_modules"].agents.length;i++) {
|
||||
|
||||
if(document.forms["form_modules"].agents[0].selected == true){
|
||||
var any = true;
|
||||
}
|
||||
if(i != 0 && document.forms["form_modules"].agents[i].selected){
|
||||
var others = true;
|
||||
}
|
||||
if(any && others){
|
||||
document.forms["form_modules"].agents[i].selected = false;
|
||||
document.forms["form_modules"].agents[0].selected = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#module').change(function(e){
|
||||
for(var i=0;i<document.forms["form_modules"].module.length;i++) {
|
||||
|
||||
if(document.forms["form_modules"].module[0].selected == true){
|
||||
var any = true;
|
||||
}
|
||||
if(i != 0 && document.forms["form_modules"].module[i].selected){
|
||||
var others = true;
|
||||
}
|
||||
if(any && others){
|
||||
document.forms["form_modules"].module[i].selected = false;
|
||||
document.forms["form_modules"].module[0].selected = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
|
|
@ -1087,6 +1087,39 @@ $(document).ready (function () {
|
|||
selector = $("#form_edit input[name=selection_mode]:checked").val();
|
||||
$("#id_agents").trigger("change");
|
||||
});
|
||||
|
||||
$('#agents').change(function(e){
|
||||
for(var i=0;i<document.forms["form_edit"].agents.length;i++) {
|
||||
|
||||
if(document.forms["form_edit"].agents[0].selected == true){
|
||||
var any = true;
|
||||
}
|
||||
if(i != 0 && document.forms["form_edit"].agents[i].selected){
|
||||
var others = true;
|
||||
}
|
||||
if(any && others){
|
||||
document.forms["form_edit"].agents[i].selected = false;
|
||||
document.forms["form_edit"].agents[0].selected = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#module').change(function(e){
|
||||
for(var i=0;i<document.forms["form_edit"].module.length;i++) {
|
||||
|
||||
if(document.forms["form_edit"].module[0].selected == true){
|
||||
var any = true;
|
||||
}
|
||||
if(i != 0 && document.forms["form_edit"].module[i].selected){
|
||||
var others = true;
|
||||
}
|
||||
if(any && others){
|
||||
document.forms["form_edit"].module[i].selected = false;
|
||||
document.forms["form_edit"].module[0].selected = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function disabled_status () {
|
||||
|
|
Loading…
Reference in New Issue