2008-09-11 Evi Vanoost <vanooste@rcbi.rochester.edu>

* godmode/groups/group_list.php, godmode/groups/configure_group.php:
        Fixed a bug where the group parent wouldn't be added to a group.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1093 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
guruevi 2008-09-11 15:35:35 +00:00
parent baeb351e4a
commit 3b759b4d53
3 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2008-09-11 Evi Vanoost <vanooste@rcbi.rochester.edu>
* 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 <vanooste@rcbi.rochester.edu>
* include/languages/pt_br.po: Removed the file from repository. The

View File

@ -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 "<h3 class='error'>".__('There was a problem loading group')."</h3>";
@ -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] .= '<img src="images/groups_small/'.$icon.'" />';
}
$table->data[1][1] .= '</span>';
$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] .= ' <span id="parent_preview">';
if ($id_parent) {
echo '<img src="images/groups_small/'.dame_grupo_icono ($id_parent).'.png" />';
}
echo'</span>';
$table->data[3][0] = __('Alerts');
$table->data[3][1] = print_checkbox ('alerts_enabled', 1, ! $alerts_disabled, true);

View File

@ -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 "<h3 class='suc'>".__('Group successfully updated')."</h3>";
} else {
echo "<h3 class='error'>".__('There was a problem modifying group')."</h3>";