Added new checkbox in massive agents deletion to select only the disabled agents

This commit is contained in:
Arturo Gonzalez 2016-09-09 16:26:29 +02:00
parent 080ec373d7
commit 26e43e5252
2 changed files with 18 additions and 1 deletions

View File

@ -120,6 +120,10 @@ $table->data[1][0] = __('Status');
$table->data[1][1] = html_print_select($status_list, 'status_agents', 'selected', $table->data[1][1] = html_print_select($status_list, 'status_agents', 'selected',
'', __('All'), AGENT_STATUS_ALL, true); '', __('All'), AGENT_STATUS_ALL, true);
$table->data[1][2] = __('Only disabled agents');
$table->data[1][3] = html_print_checkbox ("disabled", 1, $disabled,
true, false);
$table->data[2][0] = __('Agents'); $table->data[2][0] = __('Agents');
$table->data[2][0] .= '<span id="agent_loading" class="invisible">'; $table->data[2][0] .= '<span id="agent_loading" class="invisible">';
$table->data[2][0] .= html_print_image('images/spinner.png', true); $table->data[2][0] .= html_print_image('images/spinner.png', true);
@ -170,6 +174,14 @@ ui_require_jquery_file ('pandora.controls');
$("#id_group").trigger("change"); $("#id_group").trigger("change");
}); });
var disabled;
$("#checkbox-disabled").click(function () {
disabled = this.checked ? 1 : 0;
$("#id_group").trigger("change");
});
$("#id_group").pandoraSelectGroupAgent ({ $("#id_group").pandoraSelectGroupAgent ({
status_agents: function () { status_agents: function () {
return $("#status_agents").val(); return $("#status_agents").val();
@ -178,6 +190,9 @@ ui_require_jquery_file ('pandora.controls');
privilege: "AW", privilege: "AW",
recursion: function() { recursion: function() {
return recursion; return recursion;
},
disabled: function() {
return disabled;
} }
}); });

View File

@ -42,7 +42,9 @@
"id_group" : this.value, "id_group" : this.value,
"recursion" : config.recursion, "recursion" : config.recursion,
"filter_agents_json" : config.filter_agents_json, "filter_agents_json" : config.filter_agents_json,
"disabled" : config.disabled ? 1 : 0, "disabled" : (typeof config.disabled === "function")
? (config.disabled() ? 1 : 0)
: (config.disabled ? 1 : 0),
"status_agents" : config.status_agents, "status_agents" : config.status_agents,
"add_alert_bulk_op" : config.add_alert_bulk_op, "add_alert_bulk_op" : config.add_alert_bulk_op,
"privilege" : config.privilege, "privilege" : config.privilege,