diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index eecad0de59..b027243f32 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ +2011-04-13 Miguel de Dios + + * include/functions_graph.php, + include/graphs/functions_pchart.php, + include/graphs/fgraph.php, + include/functions_reporting.php, + include/functions_visual_map.php, + include/ajax/visual_console_builder.ajax.php, include/functions_api.php, + operation/reporting/reporting_xml.php, + mobile/operation/agents/view_agents.php, + godmode/reporting/visual_console_builder.editor.js: changed the old sparse + for the new engine graph sparse paint method. + 2011-04-13 Sergio Martin * include/graphs/functions_pchart.php: Forgotted diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index f3f6598bfc..5c7aeca71d 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -607,8 +607,27 @@ function getModuleGraph(id_data) { period = data['period']; } }); - // Base64.encode function is in /include/javascript/encode_decode_base64.js - var img = 'include/fgraph.php?tipo=sparse&id=' + id_agente_modulo + '&label=' + Base64.encode(label) + '&height=' + height + '&pure=1&width=' + width + '&period=' + period; + + parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); + parameter.push ({name: "action", value: "get_image_sparse"}); + parameter.push ({name: "id_agent_module", value: id_agente_modulo}); + parameter.push ({name: "height", value: height}); + parameter.push ({name: "width", value: width}); + parameter.push ({name: "period", value: period}); + jQuery.ajax({ + async: false, + url: "ajax.php", + data: parameter, + type: "POST", + dataType: 'json', + success: function (data) + { + img = data; + } + }); + +// var img = 'include/fgraph.php?tipo=sparse&id=' + id_agente_modulo + +// '&label=' + Base64.encode(label) + '&height=' + height + '&pure=1&width=' + width + '&period=' + period; return img; } diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index 3d46a6216d..70ae6e22eb 100644 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -51,11 +51,22 @@ $width_percentile = get_parameter('width_percentile', null); $max_percentile = get_parameter('max_percentile', null); $height_module_graph = get_parameter('height_module_graph', null); $width_module_graph = get_parameter('width_module_graph', null); +$id_agent_module = get_parameter('id_agent_module', 0); $get_element_status = get_parameter('get_element_status', 0); $get_image_path_status = get_parameter('get_image_path_status', 0); switch ($action) { + case 'get_image_sparse': + $img = grafico_modulo_sparse2($id_agent_module, + $period, false, $width, $height, '', null, false, 0, false, 0, 0, 0, + true, true); + + preg_match("/src='(.*)'/", $img, $matches); + $url = $matches[1]; + + echo $url; + break; case 'get_layout_data': $layoutData = get_db_row_filter('tlayout_data', array('id' => $id_element)); diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 88ed440f69..57ec73ccf5 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -784,42 +784,6 @@ function get_module_data($id, $thrash1, $other, $returnType) { returnData('csv', $data, $separator); } -/** - * Return a image file of sparse graph of module data in a period time. - * - * @param integer $id id of a module data. - * @param $thrash1 Don't use. - * @param array $other it's array, $other as param is ;;;