diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2bda90f7db..3447e0a8e3 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2008-09-11 Evi Vanoost + + * godmode/groups/group_list.php, godmode/groups/configure_group.php: + Fixed a bug where the group parent wouldn't be added to a group. + 2008-09-10 Evi Vanoost * include/languages/pt_br.po: Removed the file from repository. The diff --git a/pandora_console/godmode/groups/configure_group.php b/pandora_console/godmode/groups/configure_group.php index 8d6710f06b..5c28c36b60 100644 --- a/pandora_console/godmode/groups/configure_group.php +++ b/pandora_console/godmode/groups/configure_group.php @@ -42,7 +42,7 @@ if ($id_group) { if ($group) { $name = $group["nombre"]; $icon = $group["icon"].'.png'; - $alerts_isabled = $group["disabled"]; + $alerts_disabled = $group["disabled"]; $id_parent = $group["parent"]; } else { echo "

".__('There was a problem loading group')."

"; @@ -64,6 +64,7 @@ $table->width = '450px'; $table->data = array (); $table->data[0][0] = __('Name'); $table->data[0][1] = print_input_text ('name', $name, '', 35, 100, true); + $table->data[1][0] = __('Icon'); $files = list_files ('images/groups_small/', "png", 1, 0); $table->data[1][1] = print_select ($files, 'icon', $icon, '', 'None', '', true); @@ -72,16 +73,18 @@ if ($icon) { $table->data[1][1] .= ''; } $table->data[1][1] .= ''; + $table->data[2][0] = __('Parent'); -$sql = 'SELECT * FROM tgrupo '; +$sql = 'SELECT id_grupo, nombre FROM tgrupo '; if ($id_group) $sql .= sprintf ('WHERE id_grupo != %d', $id_group); -$table->data[2][1] = print_select_from_sql ($sql, 'parent', $id_parent, '', 'None', 0, true); +$table->data[2][1] = print_select_from_sql ($sql, 'id_parent', $id_parent, '', 'None', 0, true); $table->data[2][1] .= ' '; if ($id_parent) { echo ''; } echo''; + $table->data[3][0] = __('Alerts'); $table->data[3][1] = print_checkbox ('alerts_enabled', 1, ! $alerts_disabled, true); diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index b6e91e13bf..7d288a87a5 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -72,13 +72,12 @@ if ($update_group) { $icon = (string) get_parameter ('icon'); $id_parent = (int) get_parameter ('id_parent'); $alerts_enabled = (bool) get_parameter ('alerts_enabled'); - $sql = sprintf ('UPDATE tgrupo SET nombre = "%s", icon = "%s", disabled = %d, parent = %d WHERE id_grupo = %d', $name, substr ($icon, 0, -4), !$alerts_enabled, $id_parent, $id_group); - $result = mysql_query ($sql); - if ($result) { + $result = process_sql ($sql); + if ($result !== false) { echo "

".__('Group successfully updated')."

"; } else { echo "

".__('There was a problem modifying group')."

";