From a9e8b1113ea337e81e790b39dc72ab0587265975 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Mon, 7 Oct 2019 11:15:25 +0200 Subject: [PATCH] add default comments when change owner or status on events --- pandora_console/include/functions_api.php | 2 +- pandora_console/include/functions_events.php | 4 ++-- pandora_server/lib/PandoraFMS/Core.pm | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 899add9ec0..da3da6cdb7 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -11771,7 +11771,7 @@ function api_set_validate_event_by_id($id, $trash1=null, $trash2=null, $returnTy } else { $ack_utimestamp = time(); - events_comment($id, '', 'Change status to validated'); + events_comment($id, 'Event validated', 'Change status to validated'); $values = [ 'ack_utimestamp' => $ack_utimestamp, diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index ff0b359c72..c522f81fce 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1765,7 +1765,7 @@ function events_change_status( events_comment( $id_event, - '', + 'Event validated', 'Change status to '.$status_string, $meta, $history @@ -1857,7 +1857,7 @@ function events_change_owner( if ($force) { events_comment( $id_event, - '', + 'Change owner to '.$new_owner.'', 'Change owner to '.$new_owner, $meta, $history diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 644b983a5c..d20556ba8d 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1222,9 +1222,8 @@ sub pandora_execute_action ($$$$$$$$$;$) { # Check for _module_graph_Xh_ macros # Check for _module_graph_Xh_ macros and _module_graphth_Xh_ my $module_graph_list = {}; - my $macro_regexp = "_modulegraph_(\\d+)h_"; - my $macro_regexp2 = "_modulegraphth_(\\d+)h_"; - + my $macro_regexp = "_modulegraph_24h_"; + my $macro_regexp2 = "_modulegraphth_24h_"; # API connection my $ua = new LWP::UserAgent; eval { @@ -1260,11 +1259,12 @@ sub pandora_execute_action ($$$$$$$$$;$) { } $params->{"other_mode"} = 'url_encode_separator_%7C'; - + if (! exists($module_graph_list->{$cid}) && defined $url) { + # Get the module graph image in base 64 my $response = $ua->post($url, $params); - + if ($response->is_success) { $module_graph_list->{$cid} = $response->decoded_content();