system = $system;
}
public function show() {
$table = null;
//$table->width = '100%';
$table->head = array();
$table->head[0] = __('Module');
$table->head[1] = __('Template');
$table->head[2] = __('Action');
$table->head[2] = '' . __('Last') . '';
$table->head[3] = '' . __('S') . '';
$table->align = array();
$table->align[3] = 'right';
$table->align[2] = 'center';
$table->data = array();
$table->rowclass = array();
$groups = users_get_groups($this->system->getConfig('id_user'));
$idGroups = array_keys($groups);
$agents = agents_get_group_agents($idGroups);
$alertsSimple = agents_get_alerts_simple($agents);
$rowPair = false;
$iterator = 0;
foreach ($alertsSimple as $alert) {
if ($rowPair)
$table->rowclass[$iterator] = 'rowPair';
else
$table->rowclass[$iterator] = 'rowOdd';
$rowPair = !$rowPair;
$iterator++;
$data = array();
$idAgent = modules_get_agentmodule_agent($alert["id_agent_module"]);
$data[] = '' . ui_print_truncate_text(modules_get_agentmodule_name($alert["id_agent_module"]), 20, true, true) . '';
$template = io_safe_output(alerts_get_alert_template ($alert['id_alert_template']));
$data[] = ui_print_truncate_text(io_safe_output($template['name']), 20, true, true);
$data[] = ui_print_timestamp ($alert["last_fired"], true, array('units' => 'tiny'));
$status = STATUS_ALERT_NOT_FIRED;
$title = "";
if ($alert["times_fired"] > 0) {
$status = STATUS_ALERT_FIRED;
$title = __('Alert fired').' '.$alert["times_fired"].' '.__('times');
}
elseif ($alert["disabled"] > 0) {
$status = STATUS_ALERT_DISABLED;
$title = __('Alert disabled');
}
else {
$status = STATUS_ALERT_NOT_FIRED;
$title = __('Alert not fired');
}
$data[] = str_replace(array('images/status_sets', '
data[] = $data;
}
html_print_table($table);
}
}
?>