diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index cdf81f4228..2345bb1bca 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2011-06-14 Sergio Martin + + * include/functions_graph.php + include/graphs/fgraph.php: Added ttl parameter to all + pdf report graphs + 2011-06-14 Javier Lanz * godmode/agentes/module_manager_editor_prediction.php: Added enterprise diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 0bf46c0206..9ae151a1d8 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -647,7 +647,7 @@ function graphic_combined_module2 ($module_list, $weight_list, $period, $width, return area_graph($flash_charts, $graph_values, $width, $height, $color, $module_name_list, $long_index, "images/image_problem.opaque.png", "", "", $homeurl, $config['homedir'] . "/images/logo_vertical_water.png", - $config['fontpath'], $config['font_size'], ""); + $config['fontpath'], $config['font_size'], "", $ttl); break; default: case GRAPH_STACKED_AREA: @@ -655,21 +655,21 @@ function graphic_combined_module2 ($module_list, $weight_list, $period, $width, return stacked_area_graph($flash_charts, $graph_values, $width, $height, $color, $module_name_list, $long_index, "images/image_problem.opaque.png", "", "", $config['homedir'] . "/images/logo_vertical_water.png", - $config['fontpath'], $config['font_size']); + $config['fontpath'], $config['font_size'], "", $ttl); break; case GRAPH_LINE: $color = null; return line_graph($flash_charts, $graph_values, $width, $height, $color, $module_name_list, $long_index, "images/image_problem.opaque.png", "", "", $config['homedir'] . "/images/logo_vertical_water.png", - $config['fontpath'], $config['font_size']); + $config['fontpath'], $config['font_size'], "", $ttl); break; case GRAPH_STACKED_LINE: $color = null; return stacked_line_graph($flash_charts, $graph_values, $width, $height, $color, $module_name_list, $long_index, "images/image_problem.opaque.png", "", "", $config['homedir'] . "/images/logo_vertical_water.png", - $config['fontpath'], $config['font_size']); + $config['fontpath'], $config['font_size'], "", $ttl); break; } } @@ -1334,7 +1334,7 @@ function grafico_eventos_usuario2 ($width, $height) { * @param integer width graph width * @param integer Graph type 1 vbar, 2 hbar, 3 pie */ -function graph_custom_sql_graph2 ($id, $width, $height, $type = 'sql_graph_vbar', $only_image = false, $homeurl = '') { +function graph_custom_sql_graph2 ($id, $width, $height, $type = 'sql_graph_vbar', $only_image = false, $homeurl = '', $ttl = 1) { global $config; $report_content = db_get_row ('treport_content', 'id_rc', $id); @@ -1355,6 +1355,7 @@ function graph_custom_sql_graph2 ($id, $width, $height, $type = 'sql_graph_vbar' $count = 0; foreach ($data_result as $data_item) { + html_debug_print($data_item); $count++; switch ($type) { case 'sql_graph_vbar': // vertical bar diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index 5b8061a39a..24d5eec057 100755 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -104,7 +104,7 @@ switch($graph_type) { break; } -function histogram($chart_data, $width, $height, $font, $max, $title, $mode) { +function histogram($chart_data, $width, $height, $font, $max, $title, $mode, $ttl = 1) { $graph = array(); $graph['data'] = $chart_data; $graph['width'] = $width; @@ -114,12 +114,13 @@ function histogram($chart_data, $width, $height, $font, $max, $title, $mode) { $graph['title'] = $title; $graph['mode'] = $mode; - $id_graph = serialize_in_temp($graph); + $id_graph = serialize_in_temp($graph, null, $ttl); - return ""; + return ""; } -function progressbar($progress, $width, $height, $title, $font, $mode = 1, $out_of_lim_str = false, $out_of_lim_image = false) { +function progressbar($progress, $width, $height, $title, $font, $mode = 1, + $out_of_lim_str = false, $out_of_lim_image = false, $ttl = 1) { $graph = array(); $graph['progress'] = $progress; @@ -131,13 +132,14 @@ function progressbar($progress, $width, $height, $title, $font, $mode = 1, $out_ $graph['font'] = $font; $graph['mode'] = $mode; - $id_graph = serialize_in_temp($graph); + $id_graph = serialize_in_temp($graph, null, $ttl); - return ""; + return ""; } -function slicesbar_graph($chart_data, $period, $width, $height, $colors, $font, $round_corner, $home_url = '') { +function slicesbar_graph($chart_data, $period, $width, $height, $colors, $font, + $round_corner, $home_url = '', $ttl = 1) { $graph = array(); $graph['data'] = $chart_data; $graph['period'] = $period; @@ -147,14 +149,15 @@ function slicesbar_graph($chart_data, $period, $width, $height, $colors, $font, $graph['round_corner'] = $round_corner; $graph['color'] = $colors; - $id_graph = serialize_in_temp($graph); + $id_graph = serialize_in_temp($graph, null, $ttl); - return ""; + return ""; } function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array(), $legend = array(), $xaxisname = "", $yaxisname = "", $homedir="", - $water_mark = '', $font = '', $font_size = '', $force_steps = true) { + $water_mark = '', $font = '', $font_size = '', $force_steps = true, $ttl = 1) { + if($flash_chart) { echo fs_2d_column_chart ($chart_data, $width, $height); } @@ -172,18 +175,18 @@ function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array() $graph['font_size'] = $font_size; $graph['force_steps'] = $force_steps; - $id_graph = serialize_in_temp($graph); + $id_graph = serialize_in_temp($graph, null, $ttl); - return ""; + return ""; } } -function threshold_graph($flash_chart, $chart_data, $width, $height) { +function threshold_graph($flash_chart, $chart_data, $width, $height, $ttl = 1) { if($flash_chart) { echo fs_area_chart ($chart_data, $width, $height); } else { - echo ""; + echo ""; } } @@ -213,13 +216,13 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $id_graph = serialize_in_temp($graph, null, $ttl); - return ""; + return ""; } } function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", - $water_mark = "", $font = '', $font_size = '') { + $water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1) { if (empty($chart_data)) { return ''; @@ -244,15 +247,16 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color, $graph['font'] = $font; $graph['font_size'] = $font_size; - $id_graph = serialize_in_temp($graph); + $id_graph = serialize_in_temp($graph, null, $ttl); - return ""; + return ""; } } function stacked_line_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", - $water_mark = "", $font = '', $font_size = '') { + $water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1) { + if (empty($chart_data)) { return ''; } @@ -276,15 +280,16 @@ function stacked_line_graph($flash_chart, $chart_data, $width, $height, $color, $graph['font'] = $font; $graph['font_size'] = $font_size; - $id_graph = serialize_in_temp($graph); + $id_graph = serialize_in_temp($graph, null, $ttl); - return ""; + return ""; } } function line_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "", - $water_mark = "", $font = '', $font_size = '') { + $water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1) { + if (empty($chart_data)) { return ''; } @@ -305,13 +310,13 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color, $legend, $graph['font'] = $font; $graph['font_size'] = $font_size; - $id_graph = serialize_in_temp($graph); + $id_graph = serialize_in_temp($graph, null, $ttl); - return ""; + return ""; } } -function kiviat_graph($graph_type, $flash_chart, $chart_data, $width, $height, $no_data_image) { +function kiviat_graph($graph_type, $flash_chart, $chart_data, $width, $height, $no_data_image, $ttl = 1) { if (empty($chart_data)) { return ''; } @@ -321,22 +326,22 @@ function kiviat_graph($graph_type, $flash_chart, $chart_data, $width, $height, $ $graph['width'] = $width; $graph['height'] = $height; - $id_graph = serialize_in_temp($graph); + $id_graph = serialize_in_temp($graph, null, $ttl); - return ""; + return ""; } -function radar_graph($flash_chart, $chart_data, $width, $height, $no_data_image) { - return kiviat_graph('radar', $flash_chart, $chart_data, $width, $height, $no_data_image); +function radar_graph($flash_chart, $chart_data, $width, $height, $no_data_image, $ttl = 1) { + return kiviat_graph('radar', $flash_chart, $chart_data, $width, $height, $no_data_image, $ttl); } -function polar_graph($flash_chart, $chart_data, $width, $height, $no_data_image) { - return kiviat_graph('polar', $flash_chart, $chart_data, $width, $height, $no_data_image); +function polar_graph($flash_chart, $chart_data, $width, $height, $no_data_image, $ttl = 1) { + return kiviat_graph('polar', $flash_chart, $chart_data, $width, $height, $no_data_image, $ttl); } function hbar_graph($flash_chart, $chart_data, $width, $height, $color = array(), $legend = array(), $xaxisname = "", $yaxisname = "", $force_height = true, - $homedir="", $water_mark = '', $font = '', $font_size = '', $force_steps = true) { + $homedir="", $water_mark = '', $font = '', $font_size = '', $force_steps = true, $ttl = 1) { if($flash_chart) { echo fs_2d_hcolumn_chart ($chart_data, $width, $height); } @@ -355,26 +360,26 @@ function hbar_graph($flash_chart, $chart_data, $width, $height, $color = array() $graph['font_size'] = $font_size; $graph['force_steps'] = $force_steps; - $id_graph = serialize_in_temp($graph); + $id_graph = serialize_in_temp($graph, null, $ttl); - return ""; + return ""; } } function pie3d_graph($flash_chart, $chart_data, $width, $height, - $others_str = "other", $homedir="", $water_mark = "", $font = '', $font_size = '') { + $others_str = "other", $homedir="", $water_mark = "", $font = '', $font_size = '', $ttl = 1) { return pie_graph('3d', $flash_chart, $chart_data, $width, $height, - $others_str, $homedir, $water_mark, $font, $font_size); + $others_str, $homedir, $water_mark, $font, $font_size, $ttl); } function pie2d_graph($flash_chart, $chart_data, $width, $height, - $others_str = "other", $homedir="", $water_mark = "", $font = '', $font_size = '') { + $others_str = "other", $homedir="", $water_mark = "", $font = '', $font_size = '', $ttl = 1) { return pie_graph('2d', $flash_chart, $chart_data, $width, $height, - $others_str, $homedir, $water_mark, $font, $font_size); + $others_str, $homedir, $water_mark, $font, $font_size, $ttl); } function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height, - $others_str = "other", $homedir="", $water_mark = "", $font = '', $font_size = '') { + $others_str = "other", $homedir="", $water_mark = "", $font = '', $font_size = '', $ttl = 1) { // This library allows only 8 colors $max_values = 8; @@ -415,21 +420,21 @@ function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height, $graph['font'] = $font; $graph['font_size'] = $font_size; - $id_graph = serialize_in_temp($graph); + $id_graph = serialize_in_temp($graph, null, $ttl); switch($graph_type) { case "2d": - return ""; + return ""; break; case "3d": - return ""; + return ""; break; } } } -function gantt_graph($project_name, $from, $to, $tasks, $milestones, $width, $height) { - return fs_gantt_chart ($project_name, $from, $to, $tasks, $milestones, $width, $height); +function gantt_graph($project_name, $from, $to, $tasks, $milestones, $width, $height, $ttl = 1) { + return fs_gantt_chart ($project_name, $from, $to, $tasks, $milestones, $width, $height, $ttl); } function include_flash_chart_script($homeurl = '') {