diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index c1c4a91cef..d47f9e17e4 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -404,7 +404,8 @@ if (!empty($groups)) { $symbolBranchs = ' symbol_branch_' . $group['parent']; - $data = groups_get_group_to_list($group, $groups_count, $symbolBranchs); + $has_children = isset($sons[$group['id_grupo']]); + $data = groups_get_group_to_list($group, $groups_count, $symbolBranchs, $has_children); array_push ($table->data, $data); $table->rowstyle[$iterator] = ''; if ($group['id_grupo'] != 0) { diff --git a/pandora_console/include/functions_groups.php b/pandora_console/include/functions_groups.php index 42b39f2f28..ada8e71a14 100644 --- a/pandora_console/include/functions_groups.php +++ b/pandora_console/include/functions_groups.php @@ -2122,7 +2122,7 @@ function groups_agent_disabled ($group_array) { * @return mixed Row with html_print_table format * */ -function groups_get_group_to_list($group, $groups_count, &$symbolBranchs) { +function groups_get_group_to_list($group, $groups_count, &$symbolBranchs, $has_children = false) { $tabulation = str_repeat('    ', $group['deep']); if ($group['id_grupo'] == 0) { @@ -2160,11 +2160,16 @@ function groups_get_group_to_list($group, $groups_count, &$symbolBranchs) { 'id_group=' . $group['id_grupo'] . '">' . html_print_image("images/config.png", true, array("alt" => __('Edit'), "title" => __('Edit'), "border" => '0')); //Check if there is only a group to unable delete it if ($groups_count > 2) { + $confirm_message = __('Are you sure?'); + if ($has_children) { + $confirm_message = __('The child groups will be updated to use the parent id of the deleted group') . ". " . $confirm_message; + } + $data[5] .= '  ' . '' . html_print_image("images/cross.png", true, array("alt" => __('Delete'), "border" => '0')); + 'delete_group=1" onClick="if (!confirm(\' '.$confirm_message.'\')) return false;">' . html_print_image("images/cross.png", true, array("alt" => __('Delete'), "border" => '0')); } else { $data[5] .= '  ' . @@ -2193,7 +2198,9 @@ function groups_print_group_sons($group, $sons, &$branch_classes, $groups_count, foreach($sons[$group['id_grupo']] as $key => $g) { $symbolBranchs .= ' symbol_branch_' . $g['parent']; - $data = groups_get_group_to_list($g, $groups_count, $symbolBranchs); + $has_children = isset($sons[$g['id_grupo']]); + + $data = groups_get_group_to_list($g, $groups_count, $symbolBranchs, $has_children); array_push ($table->data, $data); $branch_classes[$g['id_grupo']] = $branch_classes[$g['parent']] . ' branch_' . $g['parent'];