From 40a86384c24de8542608de43195d6f89f9493288 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Mon, 13 Jan 2020 13:00:43 +0100 Subject: [PATCH] Add comment in events when status is changed --- pandora_console/include/functions_events.php | 32 +++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 53005037df..aa4bb5edec 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -624,7 +624,37 @@ function events_update_status($id_evento, $status, $filter=null, $history=false) break; } - return db_process_sql($update_sql); + $result = db_process_sql($update_sql); + + if ($result) { + switch ($status) { + case EVENT_STATUS_NEW: + $status_string = 'New'; + break; + + case EVENT_STATUS_VALIDATED: + $status_string = 'Validated'; + break; + + case EVENT_STATUS_INPROCESS: + $status_string = 'In process'; + break; + + default: + $status_string = ''; + break; + } + + events_comment( + $id_evento, + '', + 'Change status to '.$status_string, + is_metaconsole() ? true : false, + $history + ); + } + + return $result; }