From caa3539c4ffee232e20f9fa3d4f738375321283f Mon Sep 17 00:00:00 2001 From: danielmaya Date: Wed, 29 Nov 2017 15:54:00 +0100 Subject: [PATCH] Fixed group recursion in bulk operation --- pandora_console/godmode/massive/massive_edit_agents.php | 4 ++-- pandora_console/include/functions_users.php | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 1b77093025..ebcb7e557f 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -259,7 +259,7 @@ $table->data[0][0] = __('Group'); $table->data[0][1] = html_print_select_groups(false, "AW", true, 'id_group', $id_group, false, '', '', true); $table->data[0][2] = __('Group recursion'); -$table->data[0][3] = html_print_checkbox ("recursion", 1, $recursion, +$table->data[0][3] = html_print_checkbox ("recursion2", 1, $recursion, true, false); @@ -625,7 +625,7 @@ $(document).ready (function () { $("select#id_os").pandoraSelectOS (); var recursion; - $("#checkbox-recursion").click(function () { + $("#checkbox-recursion2").click(function () { recursion = this.checked ? 1 : 0; $("#id_group").trigger("change"); }); diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php index 957c8c569e..85819ead10 100755 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -254,7 +254,11 @@ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup $user_groups[$group[$keys_field]] = $group['nombre']; } } - + + if (!empty($id_groups)) { + $user_groups = array_intersect_key($user_groups,array_flip($id_groups)); + } + return $user_groups; }