2012-06-11 Miguel de Dios <miguel.dedios@artica.es>
* include/graphs/functions_gd.php, include/graphs/fgraph.php: cleaned source code style. * include/functions_visual_map.php, include/ajax/visual_console_builder.ajax.php, godmode/reporting/visual_console_builder.editor.js, godmode/reporting/visual_console_builder.editor.php: fixed the strange behavior of the bars and bubbles in the editor. MERGED FROM 4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6475 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
53c62fc21b
commit
60db76bc53
|
@ -1,3 +1,16 @@
|
|||
2012-06-11 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/graphs/functions_gd.php, include/graphs/fgraph.php:
|
||||
cleaned source code style.
|
||||
|
||||
* include/functions_visual_map.php,
|
||||
include/ajax/visual_console_builder.ajax.php,
|
||||
godmode/reporting/visual_console_builder.editor.js,
|
||||
godmode/reporting/visual_console_builder.editor.php: fixed the
|
||||
strange behavior of the bars and bubbles in the editor.
|
||||
|
||||
MERGED FROM 4.0.2
|
||||
|
||||
2012-06-11 Dario Rodriguez <dario.rodriguez@artica.es>
|
||||
|
||||
* operation/tree.php: Include functions_gis.php file that
|
||||
|
|
|
@ -153,7 +153,7 @@ function updateAction() {
|
|||
|
||||
values = readFields();
|
||||
|
||||
// TODO VALIDATE DATA
|
||||
// TODO VALIDATE DATA
|
||||
switch (selectedItem) {
|
||||
case 'background':
|
||||
if(values['width'] == 0 && values['height'] == 0) {
|
||||
|
@ -179,7 +179,7 @@ function updateAction() {
|
|||
success: function (data) {
|
||||
$("#background_img").attr('src', data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
idElement = 0;
|
||||
break;
|
||||
|
@ -326,6 +326,7 @@ function readFields() {
|
|||
values['type_percentile'] = $("input[name=type_percentile]:checked").val();
|
||||
values['value_show'] = $("input[name=value_show]:checked").val();
|
||||
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
|
@ -581,8 +582,8 @@ function setAspectRatioBackground(side) {
|
|||
url: "ajax.php",
|
||||
data: parameter,
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
old_width = parseInt($("#background").css('width').replace('px', ''));
|
||||
old_height = parseInt($("#background").css('height').replace('px', ''));
|
||||
|
||||
|
@ -790,6 +791,9 @@ function getModuleValue(id_data, process_simple_value) {
|
|||
}
|
||||
|
||||
function getPercentileBar(id_data, values) {
|
||||
max_percentile = values['max_percentile'];
|
||||
width_percentile = values['width_percentile'];
|
||||
|
||||
var parameter = Array();
|
||||
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
|
@ -805,11 +809,14 @@ function getPercentileBar(id_data, values) {
|
|||
success: function (data)
|
||||
{
|
||||
module_value = data['value'];
|
||||
max_percentile = data['max_percentile'];
|
||||
width_percentile = data['width_percentile'];
|
||||
unit_text = false
|
||||
if (data['unit_text'] != false)
|
||||
//max_percentile = data['max_percentile'];
|
||||
//width_percentile = data['width_percentile'];
|
||||
unit_text = false;
|
||||
|
||||
if ((data['unit_text'] != false) || typeof(data['unit_text']) != 'boolean') {
|
||||
unit_text = data['unit_text'];
|
||||
}
|
||||
|
||||
colorRGB = data['colorRGB'];
|
||||
}
|
||||
});
|
||||
|
@ -837,7 +844,7 @@ function getPercentileBar(id_data, values) {
|
|||
else
|
||||
var percentile = 100;
|
||||
|
||||
if (unit_text == false) {
|
||||
if (unit_text == false && typeof(unit_text) == 'boolean') {
|
||||
value_text = percentile + "%";
|
||||
}
|
||||
else {
|
||||
|
@ -852,6 +859,9 @@ function getPercentileBar(id_data, values) {
|
|||
}
|
||||
|
||||
function getPercentileBubble(id_data, values) {
|
||||
max_percentile = values['max_percentile'];
|
||||
width_percentile = values['width_percentile'];
|
||||
|
||||
var parameter = Array();
|
||||
|
||||
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
|
||||
|
@ -867,10 +877,10 @@ function getPercentileBubble(id_data, values) {
|
|||
success: function (data)
|
||||
{
|
||||
module_value = data['value'];
|
||||
max_percentile = data['max_percentile'];
|
||||
width_percentile = data['width_percentile'];
|
||||
//max_percentile = data['max_percentile'];
|
||||
//width_percentile = data['width_percentile'];
|
||||
unit_text = false
|
||||
if (data['unit_text'] != false)
|
||||
if ((data['unit_text'] != false) || typeof(data['unit_text']) != 'boolean')
|
||||
unit_text = data['unit_text'];
|
||||
colorRGB = data['colorRGB'];
|
||||
}
|
||||
|
@ -899,7 +909,7 @@ function getPercentileBubble(id_data, values) {
|
|||
else
|
||||
var percentile = 100;
|
||||
|
||||
if (unit_text == false) {
|
||||
if (unit_text == false && typeof(unit_text) == 'boolean') {
|
||||
value_text = percentile + "%";
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -265,7 +265,7 @@ echo '<div id="properties_panel" style="display: none; position: absolute; borde
|
|||
<tr id="label_color_row" class="static_graph percentile_bar percentile_item module_graph simple_value label datos">
|
||||
<td><?php echo __('Label color');?></td>
|
||||
<td><?php html_print_input_text_extended ('label_color', '#000000', 'text-'.'label_color', '', 7, 7, false, '', 'class="label_color"', false);?></td>
|
||||
</tr>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
|
@ -333,7 +333,6 @@ ui_require_javascript_file('wz_jsgraphics');
|
|||
ui_require_javascript_file('pandora_visual_console');
|
||||
//ui_require_jquery_file ('autocomplete');
|
||||
ui_require_javascript_file('visual_console_builder.editor', 'godmode/reporting/');
|
||||
|
||||
// Javascript file for base 64 encoding of label parameter
|
||||
ui_require_javascript_file ('encode_decode_base64');
|
||||
?>
|
||||
|
|
|
@ -78,7 +78,7 @@ switch ($action) {
|
|||
preg_match("/src='(.*)'/", $img, $matches);
|
||||
$url = $matches[1];
|
||||
|
||||
echo $url;
|
||||
echo $url;
|
||||
break;
|
||||
case 'get_layout_data':
|
||||
$layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element));
|
||||
|
@ -101,6 +101,9 @@ switch ($action) {
|
|||
default:
|
||||
$returnValue = db_get_sql ('SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
|
||||
|
||||
//html_debug_print($value_show);
|
||||
//html_debug_print($layoutData);
|
||||
|
||||
if (($layoutData['type'] == PERCENTILE_BAR) ||
|
||||
($layoutData['type'] == PERCENTILE_BUBBLE)) {
|
||||
if ($value_show == 'value') {
|
||||
|
@ -109,7 +112,13 @@ switch ($action) {
|
|||
$unit_text_db = db_get_sql ('SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ' . $layoutData['id_agente_modulo']);
|
||||
$unit_text_db = trim(io_safe_output($unit_text_db));
|
||||
|
||||
$unit_text = false;
|
||||
if ($value_show == 'value') {
|
||||
//Set empty string unit at the moment
|
||||
//and change for old false value
|
||||
|
||||
$unit_text = '';
|
||||
}
|
||||
|
||||
if (!empty($unit_text_db))
|
||||
$unit_text = $unit_text_db;
|
||||
}
|
||||
|
|
|
@ -149,10 +149,10 @@ function visual_map_print_item($layoutData) {
|
|||
$colorStatus = "#ffff00";
|
||||
break;
|
||||
case 3:
|
||||
//Unknown
|
||||
default:
|
||||
$colorStatus = "#5A5AFF";
|
||||
//Unknown
|
||||
// Default is Blue (Other)
|
||||
$colorStatus = "#5A5AFF";
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -198,12 +198,10 @@ function visual_map_print_item($layoutData) {
|
|||
}
|
||||
|
||||
if ( $max_percentile > 0)
|
||||
$percentile = $module_value / $max_percentile * 100;
|
||||
$percentile = format_numeric($module_value / $max_percentile * 100, 0);
|
||||
else
|
||||
$percentile = 100;
|
||||
|
||||
$percentile = round($percentile);
|
||||
|
||||
echo '<div id="' . $id . '" class="item percentile_item" style="color: ' . $color . '; text-align: center; position: absolute; display: inline-block; ' . $sizeStyle . ' top: ' . $top . 'px; left: ' . $left . 'px;">';
|
||||
echo $text . '<br />';
|
||||
|
||||
|
|
|
@ -48,17 +48,17 @@ include_once('functions_utils.php');
|
|||
*/
|
||||
|
||||
if (isset($_GET['homeurl'])) {
|
||||
$homeurl = $_GET['homeurl'];
|
||||
$homeurl = $_GET['homeurl'];
|
||||
}
|
||||
else $homeurl = '';
|
||||
|
||||
if (isset($_GET['ttl'])) {
|
||||
$ttl = $_GET['ttl'];
|
||||
$ttl = $_GET['ttl'];
|
||||
}
|
||||
else $ttl_param = 1;
|
||||
|
||||
if (isset($_GET['graph_type'])) {
|
||||
$graph_type = $_GET['graph_type'];
|
||||
$graph_type = $_GET['graph_type'];
|
||||
}
|
||||
else $graph_type = '';
|
||||
|
||||
|
@ -147,16 +147,16 @@ function histogram($chart_data, $width, $height, $font, $max, $title, $mode, $tt
|
|||
$graph['max'] = $max;
|
||||
$graph['title'] = $title;
|
||||
$graph['mode'] = $mode;
|
||||
|
||||
|
||||
$id_graph = serialize_in_temp($graph, null, $ttl);
|
||||
|
||||
|
||||
return "<img src='include/graphs/functions_gd.php?static_graph=1&graph_type=histogram&ttl=".$ttl."&id_graph=".$id_graph."'>";
|
||||
}
|
||||
|
||||
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;
|
||||
$graph['width'] = $width;
|
||||
$graph['height'] = $height;
|
||||
|
@ -165,9 +165,9 @@ function progressbar($progress, $width, $height, $title, $font, $mode = 1,
|
|||
$graph['title'] = $title;
|
||||
$graph['font'] = $font;
|
||||
$graph['mode'] = $mode;
|
||||
|
||||
|
||||
$id_graph = serialize_in_temp($graph, null, $ttl);
|
||||
|
||||
|
||||
return "<img src='include/graphs/functions_gd.php?static_graph=1&graph_type=progressbar&ttl=".$ttl."&id_graph=".$id_graph."'>";
|
||||
}
|
||||
|
||||
|
@ -182,9 +182,9 @@ function slicesbar_graph($chart_data, $period, $width, $height, $colors, $font,
|
|||
$graph['font'] = $font;
|
||||
$graph['round_corner'] = $round_corner;
|
||||
$graph['color'] = $colors;
|
||||
|
||||
|
||||
$id_graph = serialize_in_temp($graph, null, $ttl);
|
||||
|
||||
|
||||
return "<img src='".$home_url."include/graphs/functions_pchart.php?static_graph=1&graph_type=slicebar&ttl=".$ttl."&id_graph=".$id_graph."'>";
|
||||
}
|
||||
|
||||
|
@ -211,9 +211,9 @@ function vbar_graph($flash_chart, $chart_data, $width, $height, $color = array()
|
|||
$graph['font'] = $font;
|
||||
$graph['font_size'] = $font_size;
|
||||
$graph['force_steps'] = $force_steps;
|
||||
|
||||
|
||||
$id_graph = serialize_in_temp($graph, null, $ttl);
|
||||
|
||||
|
||||
return "<img src='" . $homedir . "include/graphs/functions_pchart.php?static_graph=1&graph_type=vbar&ttl=".$ttl."&id_graph=".$id_graph."'>";
|
||||
}
|
||||
}
|
||||
|
@ -263,17 +263,17 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
|
|||
$graph['water_mark'] = $water_mark_file;
|
||||
$graph['font'] = $font;
|
||||
$graph['font_size'] = $font_size;
|
||||
|
||||
|
||||
$id_graph = serialize_in_temp($graph, null, $ttl);
|
||||
|
||||
|
||||
return "<img src='".$homeurl."include/graphs/functions_pchart.php?static_graph=1&graph_type=area&ttl=".$ttl."&id_graph=" . $id_graph . "'>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color,
|
||||
$legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "",
|
||||
$water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $homeurl = '') {
|
||||
|
||||
|
||||
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
||||
|
||||
if (empty($chart_data)) {
|
||||
|
@ -302,23 +302,23 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color,
|
|||
$id_graph = serialize_in_temp($graph, null, $ttl);
|
||||
|
||||
return "<img src='" . $homeurl . "include/graphs/functions_pchart.php?static_graph=1&graph_type=stacked_area&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function stacked_line_graph($flash_chart, $chart_data, $width, $height, $color,
|
||||
$legend, $long_index, $no_data_image, $xaxisname = "", $yaxisname = "",
|
||||
$water_mark = "", $font = '', $font_size = '', $unit = '', $ttl = 1, $homeurl = '') {
|
||||
|
||||
|
||||
setup_watermark($water_mark, $water_mark_file, $water_mark_url);
|
||||
|
||||
if (empty($chart_data)) {
|
||||
return '<img src="' . $no_data_image . '" />';
|
||||
}
|
||||
|
||||
|
||||
if($flash_chart) {
|
||||
return flot_line_stacked_graph($chart_data, $width, $height, $color, $legend, $long_index, $homeurl, $unit, $water_mark_url);
|
||||
}
|
||||
else {
|
||||
else {
|
||||
//Stack the data
|
||||
stack_data($chart_data, $legend, $color);
|
||||
|
||||
|
@ -369,7 +369,7 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
|
|||
$id_graph = serialize_in_temp($graph, null, $ttl);
|
||||
|
||||
return "<img src='" . $homeurl . "include/graphs/functions_pchart.php?static_graph=1&graph_type=line&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function kiviat_graph($graph_type, $flash_chart, $chart_data, $width, $height, $no_data_image, $ttl = 1, $homedir="") {
|
||||
|
@ -381,9 +381,9 @@ function kiviat_graph($graph_type, $flash_chart, $chart_data, $width, $height, $
|
|||
$graph['data'] = $chart_data;
|
||||
$graph['width'] = $width;
|
||||
$graph['height'] = $height;
|
||||
|
||||
|
||||
$id_graph = serialize_in_temp($graph, null, $ttl);
|
||||
|
||||
|
||||
return "<img src='".$homedir."include/graphs/functions_pchart.php?static_graph=1&graph_type=".$graph_type."&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
|
||||
}
|
||||
|
||||
|
@ -423,9 +423,9 @@ function hbar_graph($flash_chart, $chart_data, $width, $height, $color = array()
|
|||
$graph['font'] = $font;
|
||||
$graph['font_size'] = $font_size;
|
||||
$graph['force_steps'] = $force_steps;
|
||||
|
||||
|
||||
$id_graph = serialize_in_temp($graph, null, $ttl);
|
||||
|
||||
|
||||
return "<img src='".$homedir."include/graphs/functions_pchart.php?static_graph=1&graph_type=hbar&ttl=".$ttl."&id_graph=".$id_graph."'>";
|
||||
}
|
||||
}
|
||||
|
@ -449,7 +449,7 @@ function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height,
|
|||
|
||||
// This library allows only 8 colors
|
||||
$max_values = 8;
|
||||
|
||||
|
||||
if(count($chart_data) > $max_values) {
|
||||
$chart_data_trunc = array();
|
||||
$n = 1;
|
||||
|
|
|
@ -25,18 +25,18 @@ else if(file_exists('../functions.php')) {
|
|||
}
|
||||
|
||||
$types = array('histogram', 'progressbar');
|
||||
|
||||
|
||||
$id_graph = get_parameter('id_graph', false);
|
||||
$graph_type = get_parameter('graph_type', '');
|
||||
|
||||
if($id_graph && in_array($graph_type, $types)) {
|
||||
|
||||
|
||||
if (!$id_graph) {
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$graph = unserialize_in_temp($id_graph);
|
||||
|
||||
|
||||
if (!isset($graph)) {
|
||||
exit;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue