Ent 5537 cambio en botones de select all de ventanas de seleccion de agentes

This commit is contained in:
Daniel Maya 2021-03-01 10:00:22 +00:00 committed by Daniel Rodriguez
parent 078ab1657f
commit 6175d91298
2 changed files with 39 additions and 12 deletions

View File

@ -1492,9 +1492,9 @@ function snmp_browser_print_create_module_massive($target='agent', $snmp_conf, $
true
);
$table->data[2][0] = __($target_item.' available').html_print_input_image('select_all_left', 'images/tick.png', 1, '', true, ['title' => __('Select all')]);
$table->data[2][0] = '<b>'.__($target_item.' available').'</b><br> '.__('Select all').html_print_checkbox_switch('select_all_left', 1, false, true);
$table->data[2][1] = '';
$table->data[2][2] = __($target_item.' to apply').html_print_input_image('select_all_right', 'images/tick.png', 1, '', true, ['title' => __('Select all')]);
$table->data[2][2] = '<b>'.__($target_item.' to apply').'</b><br> '.__('Select all').html_print_checkbox_switch('select_all_right', 1, false, true);
$table->data[3][0] = html_print_select(
[],

View File

@ -321,21 +321,48 @@ function add_module_massive_controller(target = 'agent')
});
// Select all Items.
$("input[name='select_all_left']").click(function () {
$("#checkbox-select_all_left").change(function () {
if ($("#checkbox-select_all_left").prop('checked') == true) {
$('#id_item option').map(function() {
$(this).prop('selected', true);
});
} else {
$('#id_item option').map(function() {
$(this).prop('selected', false);
});
}
return false;
});
$("input[name='select_all_right']").click(function () {
$("#checkbox-select_all_right").change(function () {
if ($("#checkbox-select_all_right").prop('checked') == true) {
$('#id_item2 option').map(function() {
$(this).prop('selected', true);
});
} else {
$('#id_item2 option').map(function() {
$(this).prop('selected', false);
});
}
return false;
});
$("#id_item").click(function(e) {
if ($("#checkbox-select_all_left").prop('checked') == true) {
$("#checkbox-select_all_left").prop('checked', false);
}
});
$("#id_item2").click(function(e) {
if ($("#checkbox-select_all_right").prop('checked') == true) {
$("#checkbox-select_all_right").prop('checked', false);
}
});
$(".p-switch").css('display', 'table');
// Select items.
$("#right").click (function () {
jQuery.each($("select[name='id_item[]'] option:selected"), function (key, value) {