Merge branch 'ent-9194-Bug-modulos-deshabilitados' into 'develop'

fixed bug when disabling modules and disabled modules count

See merge request artica/pandorafms!5074
This commit is contained in:
Diego Muñoz-Reja 2022-09-02 11:04:28 +00:00
commit 75720da969
2 changed files with 18 additions and 2 deletions

View File

@ -137,7 +137,16 @@ $table->data[] = $tdata;
// Modules by status.
$tdata = [];
$tdata[0] = reporting_get_stats_modules_status($data, 180, 100);
$data_agents = [
__('Critical') => $data['monitor_critical'],
__('Warning') => $data['monitor_warning'],
__('Normal') => $data['monitor_ok'],
__('Unknown') => $data['monitor_unknown'],
__('Not init') => $data['monitor_not_init'],
];
$tdata[0] = reporting_get_stats_modules_status($data, 180, 100, false, $data_agents);
$table->rowclass[] = '';
$table->data[] = $tdata;

View File

@ -466,7 +466,14 @@ if ($module_action === 'delete') {
$id_agent_module_disable
);
if (db_process_sql($sql)) {
$id_agent_changed[] = modules_get_agentmodule_agent($id_agent_module_disable);
$agent_update_result = db_process_sql_update(
'tagente',
['update_module_count' => 1],
['id_agente' => $id_agent_changed]
);
if (db_process_sql($sql) !== false && $agent_update_result !== false) {
$updated_count++;
}
}