From 4e152c38c7bbf8c0d9020de089343a8c105caacd Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 23 Dec 2009 13:19:08 +0000 Subject: [PATCH] 2009-12-23 Miguel de Dios * godmode/agentes/planned_downtime.php: fixes bug in several fields of edit form downtime. Fixes: 2919938 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2236 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ .../godmode/agentes/planned_downtime.php | 14 ++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 647f353b5f..dacb139395 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2009-12-23 Miguel de Dios + + * godmode/agentes/planned_downtime.php: fixes bug in several fields of + edit form downtime. + Fixes: 2919938 + 2009-12-23 Sancho Lerena * include/config_process.php: Updated build. diff --git a/pandora_console/godmode/agentes/planned_downtime.php b/pandora_console/godmode/agentes/planned_downtime.php index a549547195..196adddfac 100644 --- a/pandora_console/godmode/agentes/planned_downtime.php +++ b/pandora_console/godmode/agentes/planned_downtime.php @@ -124,7 +124,7 @@ echo __('Planned Downtime').''; if (($first_create != 0) OR ($first_update != 0)){ // Have any data to show ? if ($id_downtime > 0) { - $sql = sprintf ("SELECT `id`, `name`, `description`, `date_from`, `date_to` + $sql = sprintf ("SELECT `id`, `name`, `description`, `date_from`, `date_to`, `id_group` FROM `tplanned_downtime` WHERE `id` = %d", $id_downtime); @@ -133,8 +133,10 @@ echo __('Planned Downtime').''; $description = $result["description"]; $date_from = strftime ('%Y-%m-%d', $result["date_from"]); $date_to = strftime ('%Y-%m-%d', $result["date_to"]); + + if ($id_group == 1) + $id_group = $result['id_group']; } - $table->class = 'databox_color'; $table->width = '90%'; @@ -183,12 +185,8 @@ echo __('Planned Downtime').''; // Show available agents to include into downtime echo '

'.__('Available agents').':

'; - - $filter_group = get_parameter("filter_group", 1); - if ($filter_group != 1) - $filter_cond = " AND id_grupo = $filter_group "; - else - $filter_cond = ""; + $filter_group = get_parameter("filter_group", $result['id_group']); + $filter_cond = " AND id_grupo = $filter_group "; $sql = sprintf ("SELECT tagente.id_agente, tagente.nombre, tagente.id_grupo FROM tagente WHERE tagente.id_agente NOT IN (SELECT tagente.id_agente FROM tagente, tplanned_downtime_agents WHERE tplanned_downtime_agents.id_agent = tagente.id_agente AND tplanned_downtime_agents.id_downtime = %d) AND disabled = 0 $filter_cond ORDER by tagente.nombre", $id_downtime); $downtimes = get_db_all_rows_sql ($sql); $data = array ();