From 1f4b7fddc0428b57a4856277c690a66369435938 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Thu, 11 May 2017 09:29:08 +0200 Subject: [PATCH] Added more specified alert to update modules and agents when no one field change --- .../godmode/massive/massive_edit_agents.php | 2 +- .../godmode/massive/massive_edit_modules.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 26942b9c4a..6d60f0bdb1 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -183,7 +183,7 @@ if ($update_agents) { ui_print_result_message ($result !== false, __('Agents updated successfully') . '(' . $n_edited . ')', - __('Agents cannot be updated')); + __('Agents cannot be updated (maybe there was no field to update)')); } $id_group = 0; diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index bfc3aab6de..fb7e89ae3f 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -110,6 +110,9 @@ if ($update) { $success += (int)$result; } } + if ($success == 0) { + $error_msg = __("Error updating the modules from a module type"); + } } else if ($force == 'group') { $agents_ = array_keys(agents_get_group_agents($group_select, false, 'none')); @@ -129,6 +132,9 @@ if ($update) { $success += (int)$result; } } + if ($success == 0) { + $error_msg = __("Error updating the modules from an agent group"); + } } } else { @@ -146,11 +152,14 @@ if ($update) { } } + if ($success == 0) { + $error_msg = __("Error updating the modules (maybe there was no field to update)"); + } } ui_print_result_message ($success > 0, __('Successfully updated') . "(" . $success . "/" . $count . ")", - __('Could not be updated')); + $error_msg); $info = 'Modules: ' . json_encode($modules_) . ' Agents: ' . json_encode($agents_); if ($success > 0) {