2011-06-13 Sergio Martin <sergio.martin@artica.es>

* include/functions_graph.php
	include/graphs/functions_pchart.php
	include/graphs/fgraph.php
	include/graphs/functions_utils.php: Added time to live to
	area graphs in pdf calls

	* operation/reporting/reporting_xml.php: Fixed bad characteres in
	xml 



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4440 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2011-06-13 16:55:19 +00:00
parent 3356be60c3
commit df3a5ede46
6 changed files with 23 additions and 10 deletions

View File

@ -1,3 +1,14 @@
2011-06-13 Sergio Martin <sergio.martin@artica.es>
* include/functions_graph.php
include/graphs/functions_pchart.php
include/graphs/fgraph.php
include/graphs/functions_utils.php: Added time to live to
area graphs in pdf calls
* operation/reporting/reporting_xml.php: Fixed bad characteres in
xml
2011-06-13 Javier Lanz <javier.lanz@artica.es>
* images/mult.png, images/subs.png, images/div.png: Added png images

View File

@ -29,7 +29,8 @@ function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events,
$width, $height , $title = '', $unit_name = null,
$show_alerts = false, $avg_only = 0, $pure = false,
$date = 0, $unit = '', $baseline = 0, $return_data = 0, $show_title = true,
$only_image = false, $homeurl = '') {
$only_image = false, $homeurl = '', $ttl = 1) {
global $config;
global $graphic_type;
@ -306,11 +307,11 @@ function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events,
if ($flash_chart) {
include_flash_chart_script($homeurl);
}
return area_graph($flash_chart, $chart, $width, $height, $color,$legend,
$long_index, "images/image_problem.opaque.png", "", "", $homeurl,
$config['homedir'] . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size'], $unit);
$config['fontpath'], $config['font_size'], $unit, $ttl);
}
/**

View File

@ -189,7 +189,7 @@ function threshold_graph($flash_chart, $chart_data, $width, $height) {
function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
$long_index, $no_data_image, $xaxisname = "", $yaxisname = "", $homedir="",
$water_mark = "", $font = '', $font_size = '', $unit) {
$water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1) {
if (empty($chart_data)) {
return '<img src="' . $no_data_image . '" />';
@ -211,9 +211,9 @@ function area_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 "<img src='".$homedir."include/graphs/functions_pchart.php?graph_type=area&id_graph=" . $id_graph . "'>";
return "<img src='".$homedir."include/graphs/functions_pchart.php?graph_type=area&id_graph=" . $id_graph . "&ttl=" . $ttl . "'>";
}
}

View File

@ -53,7 +53,9 @@ if (!$id_graph) {
exit;
}
$graph = unserialize_in_temp($id_graph);
$ttl = get_parameter('ttl', 1);
$graph = unserialize_in_temp($id_graph, true, $ttl);
if (!isset($graph)) {
exit;

View File

@ -55,7 +55,7 @@ function unserialize_in_temp($serial_id = null, $delete = true, $ttl = 1) {
unlink($file_path);
}
else {
$next_volume = $volume++;
$next_volume = $volume + 1;
rename($file_path, sys_get_temp_dir()."/pandora_serialize_".$serial_id."__".$next_volume."__".$ttl);
}
}

View File

@ -195,10 +195,9 @@ foreach ($contents as $content) {
$img = grafico_modulo_sparse2($content['id_agent_module'],
$content['period'], 0, 720,
230, '', null, false, true, false, $datetime, '', 0, 0, true, true);
preg_match("/src='(.*)'/", $img, $matches);
$url = $matches[1];
$url = "<![CDATA[".$url."]]>";
$data["objdata"]["img"] = $url;
break;