mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
fixed bug in meta alert view: action field (other than default) not showing
This commit is contained in:
parent
75a38fadc2
commit
b5c378d589
@ -1305,13 +1305,25 @@ function alerts_delete_alert_agent_module_action ($id_alert_agent_module_action)
|
|||||||
*
|
*
|
||||||
* @return mixed Actions associated or false if something goes wrong.
|
* @return mixed Actions associated or false if something goes wrong.
|
||||||
*/
|
*/
|
||||||
function alerts_get_alert_agent_module_actions ($id_alert_agent_module, $fields = false) {
|
function alerts_get_alert_agent_module_actions ($id_alert_agent_module, $fields = false, $server_id = -1) {
|
||||||
if (empty ($id_alert_agent_module))
|
if (empty ($id_alert_agent_module))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$actions = db_get_all_rows_filter ('talert_template_module_actions',
|
if (defined('METACONSOLE')) {
|
||||||
array ('id_alert_template_module' => $id_alert_agent_module),
|
$server = db_get_row ('tmetaconsole_setup', 'id', $server_id);
|
||||||
$fields);
|
|
||||||
|
if (metaconsole_connect($server) == NOERR) {
|
||||||
|
$actions = db_get_all_rows_filter ('talert_template_module_actions',
|
||||||
|
array ('id_alert_template_module' => $id_alert_agent_module),
|
||||||
|
$fields);
|
||||||
|
|
||||||
|
metaconsole_restore_db ();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$actions = db_get_all_rows_filter ('talert_template_module_actions',
|
||||||
|
array ('id_alert_template_module' => $id_alert_agent_module),
|
||||||
|
$fields);
|
||||||
|
}
|
||||||
|
|
||||||
if ($actions === false)
|
if ($actions === false)
|
||||||
return array ();
|
return array ();
|
||||||
|
@ -823,10 +823,6 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f
|
|||||||
else
|
else
|
||||||
return array ("", "", "", "", "", "", "");
|
return array ("", "", "", "", "", "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get agent id
|
|
||||||
$id_agent = modules_get_agentmodule_agent ($alert['id_agent_module']);
|
|
||||||
$agente = db_get_row ('tagente', 'id_agente', $id_agent);
|
|
||||||
$template = alerts_get_alert_template ($alert['id_alert_template']);
|
$template = alerts_get_alert_template ($alert['id_alert_template']);
|
||||||
$description = io_safe_output($template['name']);
|
$description = io_safe_output($template['name']);
|
||||||
|
|
||||||
@ -917,7 +913,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f
|
|||||||
ui_print_truncate_text (io_safe_output($description), 'description', false, true, true, '[…]', 'font-size: 7.1pt') .
|
ui_print_truncate_text (io_safe_output($description), 'description', false, true, true, '[…]', 'font-size: 7.1pt') .
|
||||||
$disabledHtmlEnd;
|
$disabledHtmlEnd;
|
||||||
|
|
||||||
$actions = alerts_get_alert_agent_module_actions ($alert['id'], false);
|
$actions = alerts_get_alert_agent_module_actions ($alert['id'], false, $alert['server_data']['id']);
|
||||||
|
|
||||||
if (!empty($actions)) {
|
if (!empty($actions)) {
|
||||||
$actionText = '<div><ul class="action_list">';
|
$actionText = '<div><ul class="action_list">';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user