From 579793fa66b0b12af4c6931bb25d826fb2adda55 Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 16 Nov 2015 15:52:11 +0100 Subject: [PATCH] Fixed problems with bulk actions with modules. Tiquet: #2963 (cherry picked from commit ca0ec7364c86b036bc28e5017a0b8ea56d195732) --- .../godmode/massive/massive_edit_modules.php | 17 ++++------------- pandora_console/include/functions_modules.php | 2 +- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 8d4a7413b4..903f800f33 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -139,20 +139,11 @@ if ($update) { $modules_ = array(); foreach ($modules_ as $module_) { - $filter = array('id_agente' => $agent_); - if (!is_numeric($module_)) - $filter['nombre'] = $module_; - else - $filter['id_agente_modulo'] = $module_; + $result = process_manage_edit ($module_, $agent_); + $count++; + $success += (int)$result; - $exists = (bool) db_get_value_filter('id_agente', 'tagente_modulo', $filter); - - if ($exists) { - $result = process_manage_edit ($module_, $agent_); - $count++; - $success += (int)$result; - } } } } @@ -1095,7 +1086,7 @@ function process_manage_edit ($module_name, $agents_select = null) { foreach ($modules as $module) { $result = modules_update_agent_module( $module['id_agente_modulo'], $values, true, $update_tags); - + if (is_error($result)) { return false; diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 940662fe1c..67f1602015 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -441,7 +441,7 @@ function modules_update_agent_module ($id, $values, } } else { - if ($result_disable == ERR_GENERIC ){ + if ( ERR_GENERIC === $result_disable ){ return ERR_DB; } else{