diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3da7b57df1..4f04a6ccc3 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,4 +1,9 @@ -2010-03-29 Miguel de Dios +2010-03-30 Miguel de Dios + + * include/ajax/visual_console_builder.ajax.php: some cleaned the source + code...need more. + +2010-03-30 Miguel de Dios * include/functions_visual_map.php, godmode/reporting/visual_console_builder.wizard.php, diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index e8165e8780..3a2f78fbc7 100644 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -165,68 +165,12 @@ switch ($action) { echo json_encode($backgroundFields); break; case 'percentile_bar': - $elementFields = get_db_row_filter('tlayout_data', array('id' => $id_element)); - $elementFields['agent_name'] = get_agent_name($elementFields['id_agent']); - - $elementFields['width_percentile'] = $elementFields['width']; - $elementFields['max_percentile'] = $elementFields['height']; - - if ($elementFields['id_agent'] != 0) { - $modules = get_agent_modules ($elementFields['id_agent'], false, array('disabled' => 0, 'id_agente' => $elementFields['id_agent'])); - - $elementFields['modules_html'] = ''; - foreach ($modules as $id => $name) { - $elementFields['modules_html'] .= ''; - } - } - else { - $elementFields['modules_html'] = ''; - } - - echo json_encode($elementFields); - break; case 'static_graph': - $elementFields = get_db_row_filter('tlayout_data', array('id' => $id_element)); - $elementFields['agent_name'] = get_agent_name($elementFields['id_agent']); - - if ($elementFields['id_agent'] != 0) { - $modules = get_agent_modules ($elementFields['id_agent'], false, array('disabled' => 0, 'id_agente' => $elementFields['id_agent'])); - - $elementFields['modules_html'] = ''; - foreach ($modules as $id => $name) { - $elementFields['modules_html'] .= ''; - } - } - else { - $elementFields['modules_html'] = ''; - } - - echo json_encode($elementFields); - break; case 'module_graph': - $elementFields = get_db_row_filter('tlayout_data', array('id' => $id_element)); - $elementFields['agent_name'] = get_agent_name($elementFields['id_agent']); - $elementFields['width_module_graph'] = $elementFields['width']; - $elementFields['height_module_graph'] = $elementFields['height']; - - if ($elementFields['id_agent'] != 0) { - $modules = get_agent_modules ($elementFields['id_agent'], false, array('disabled' => 0, 'id_agente' => $elementFields['id_agent'])); - - $elementFields['modules_html'] = ''; - foreach ($modules as $id => $name) { - $elementFields['modules_html'] .= ''; - } - } - else { - $elementFields['modules_html'] = ''; - } - - echo json_encode($elementFields); - break; case 'simple_value': $elementFields = get_db_row_filter('tlayout_data', array('id' => $id_element)); $elementFields['agent_name'] = get_agent_name($elementFields['id_agent']); - + //Make the html of select box of modules about id_agent. if ($elementFields['id_agent'] != 0) { $modules = get_agent_modules ($elementFields['id_agent'], false, array('disabled' => 0, 'id_agente' => $elementFields['id_agent'])); @@ -238,7 +182,16 @@ switch ($action) { else { $elementFields['modules_html'] = ''; } - + switch ($type) { + case 'percentile_bar': + $elementFields['width_percentile'] = $elementFields['width']; + $elementFields['max_percentile'] = $elementFields['height']; + break; + case 'module_graph': + $elementFields['width_module_graph'] = $elementFields['width']; + $elementFields['height_module_graph'] = $elementFields['height']; + break; + } echo json_encode($elementFields); break; }