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:
vgilc 2017-10-04 11:06:39 +02:00
commit df8210924c
2 changed files with 66 additions and 0 deletions

View File

@ -788,6 +788,39 @@ $(document).ready (function () {
$("#module_type").trigger("change"); $("#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> </script>

View File

@ -1087,6 +1087,39 @@ $(document).ready (function () {
selector = $("#form_edit input[name=selection_mode]:checked").val(); selector = $("#form_edit input[name=selection_mode]:checked").val();
$("#id_agents").trigger("change"); $("#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 () { function disabled_status () {