From e8c76f4e6c9c4a17eec87d41ec7021ee9fda8b7e Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 21 Jul 2010 14:46:35 +0000 Subject: [PATCH] 2010-07-21 Miguel de Dios * godmode/groups/configure_group.php: fixed to negate the posibility to hang the father into childrens or same. Fixes: #3032553 * godmode/groups/group_list.php: fixed the delete a group with children, the children move to grandparent. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3050 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 9 +++++++++ pandora_console/godmode/groups/configure_group.php | 8 +++++++- pandora_console/godmode/groups/group_list.php | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d0fa524704..2120a7e519 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2010-07-21 Miguel de Dios + + * godmode/groups/configure_group.php: fixed to negate the posibility to hang + the father into childrens or same. + Fixes: #3032553 + + * godmode/groups/group_list.php: fixed the delete a group with children, the + children move to grandparent. + 2010-07-21 Raúl Mateos * images/pandora_logo_header.png, images/custom_logo/pandora_logo_header.*, diff --git a/pandora_console/godmode/groups/configure_group.php b/pandora_console/godmode/groups/configure_group.php index ffef118999..181f3e3d92 100644 --- a/pandora_console/godmode/groups/configure_group.php +++ b/pandora_console/godmode/groups/configure_group.php @@ -78,7 +78,13 @@ $sql = 'SELECT id_grupo, nombre FROM tgrupo '; if ($id_group) $sql .= sprintf ('WHERE id_grupo != %d', $id_group); $groups = get_user_groups(); -$table->data[2][1] = print_select_groups(false, "AR", true, 'id_parent', 0, '', '', '', true); +if ($id_group) { + $table->data[2][1] = print_select_groups(false, "AR", true, 'id_parent', 0, + '', '', '', true, false, true, '', false, false, false, $id_group); +} +else { + $table->data[2][1] = print_select_groups(false, "AR", true, 'id_parent', 0, '', '', '', true); +} $table->data[2][1] .= ' '; if ($id_parent) { echo ''; diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index a84b86d9c0..353387c9e4 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -142,6 +142,10 @@ if ($delete_group) { $agent = process_sql ($sql); if(!$agent){ + + $group = get_db_row_filter('tgrupo', array('id_grupo' => $id_group)); + + process_sql_update('tgrupo', array('parent' => $group['parent']), array('parent' => $id_group)); $sql = sprintf ('DELETE FROM tgroup_stat WHERE id_group = %d', $id_group); $result = process_sql ($sql);