From 9632b36551697f983ea08376079c803edc7adce2 Mon Sep 17 00:00:00 2001 From: marcos Date: Wed, 15 Jul 2020 23:36:21 +0200 Subject: [PATCH] changed event in progress method --- pandora_console/include/functions_api.php | 10 +++------- pandora_server/util/pandora_manage.pl | 8 ++++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 0bd21d7562..28150d82aa 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -16157,16 +16157,15 @@ function api_get_event_mcid($server_id, $console_event_id, $trash2, $returnType) * Function to set events in progress status. * * @param [int] $event_id Id event (Node or Meta). - * @param [int] $server_id Id node event in tmetaconsole_event (optional). * @param [string] $trash2 don't use. * @param [string] $returnType * * Example - * http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_in_progress&return_type=json&id=0&id2=0&apipass=1234&user=admin&pass=pandora + * http://127.0.0.1/pandora_console/include/api.php?op=set&op2=event_in_progress&return_type=json&id=0&apipass=1234&user=admin&pass=pandora * * @return void */ -function api_set_event_in_progress($event_id, $server_id, $trash2, $returnType) +function api_set_event_in_progress($event_id, $trash2, $returnType) { global $config; @@ -16174,10 +16173,7 @@ function api_set_event_in_progress($event_id, $server_id, $trash2, $returnType) $event = db_process_sql_update( 'tmetaconsole_event', ['estado' => 2], - [ - 'server_id' => $server_id, - 'id_evento' => $event_id, - ] + ['id_evento' => $event_id] ); if ($event !== false) { returnData($returnType, ['type' => 'string', 'data' => $event]); diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5f428706f2..d4aefe4cdf 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -245,7 +245,7 @@ sub help_screen{ help_screen_line('--export_json_visual_console', ' [] []', 'Creates a json with the visual console elements information'); print "\nEVENTS\n\n" unless $param ne ''; - help_screen_line('--event_in_progress', ' ', 'Set event in progress'); + help_screen_line('--event_in_progress', ' ', 'Set event in progress'); print "\n"; exit; @@ -7714,7 +7714,7 @@ sub pandora_manage_main ($$$) { param_check($ltotal, 1, 0); cli_reset_agent_counts(); }elsif ($param eq '--event_in_progress') { - param_check($ltotal, 2, 0); + param_check($ltotal, 1, 0); cli_event_in_progress(); } else { @@ -8373,11 +8373,11 @@ sub cli_reset_agent_counts() { ############################################################################## sub cli_event_in_progress() { - my ($event_id, $server_id) = @ARGV[2..3]; + my $event_id = @ARGV[2]; # Call the API. my $result = api_call( - $conf, 'set', 'event_in_progress', $event_id, $server_id + $conf, 'set', 'event_in_progress', $event_id ); print "\n$result\n";