From 131753cfba5e7d24e3efa7993c3c30830f2892b3 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Mon, 12 Jun 2017 14:34:03 +0200 Subject: [PATCH] Inprove event title format and alias rather name - #523 --- pandora_console/include/functions_events.php | 2 +- pandora_server/lib/PandoraFMS/DB.pm | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 63535b6d6b..4d3f0d4800 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -2336,7 +2336,7 @@ function events_page_general ($event) { $data = array(); $data[0] = __('Event name'); - $event["evento"] = str_replace ( 'event_line_jump' , '
' , $event["evento"]); + $event["evento"] = str_replace ( ' ' , '
' , $event["evento"]); $data[1] = io_safe_output($event["evento"]); $table_general->data[] = $data; diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm index 7774048357..88a53d4008 100644 --- a/pandora_server/lib/PandoraFMS/DB.pm +++ b/pandora_server/lib/PandoraFMS/DB.pm @@ -52,6 +52,7 @@ our @EXPORT = qw( get_agent_addr_id get_agent_id get_agent_address + get_agent_alias get_agent_group get_agent_name get_agent_module_id @@ -287,6 +288,18 @@ sub get_agent_name ($$) { WHERE id_agente = ?", $agent_id); } +######################################################################## +## SUB get_agent_alias (agent_id) +## Return agent alias, given "agent_id" +######################################################################## +sub get_agent_alias ($$) { + my ($dbh, $agent_id) = @_; + + return get_db_value ($dbh, "SELECT alias + FROM tagente + WHERE id_agente = ?", $agent_id); +} + ######################################################################## ## SUB agents_get_modules (agent_id, fields, filters) ## Return the list of modules, given "agent_id"