From f6e725f19bc2a1cc6f850d7b1ebf39865359b0ef Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Mon, 11 Jun 2012 10:24:02 +0000 Subject: [PATCH] 2012-06-11 Miguel de Dios * 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 --- pandora_console/ChangeLog | 13 +++++ .../visual_console_builder.editor.js | 36 ++++++++----- .../visual_console_builder.editor.php | 3 +- .../ajax/visual_console_builder.ajax.php | 13 ++++- .../include/functions_visual_map.php | 8 ++- pandora_console/include/graphs/fgraph.php | 52 +++++++++---------- .../include/graphs/functions_gd.php | 8 +-- 7 files changed, 81 insertions(+), 52 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 72e0bf7e37..f142931798 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ +2012-06-11 Miguel de Dios + + * 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 * operation/tree.php: Include functions_gis.php file that diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index f37af2b6c2..e140bd75cf 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -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 { diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.php b/pandora_console/godmode/reporting/visual_console_builder.editor.php index 92022a3f40..fb0f253c40 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.php +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.php @@ -265,7 +265,7 @@ echo '