diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js
index 6637654f00..caa88bbca1 100755
--- a/pandora_console/godmode/reporting/visual_console_builder.editor.js
+++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js
@@ -615,6 +615,11 @@ function update_button_palette_callback() {
alert('Undefined width');
return false;
}
+
+ if($('input[name=bars_graph_height]').val() == ''){
+ alert('Undefined height');
+ return false;
+ }
$("#text_" + idItem).html(values['label']);
$("#image_" + idItem).attr("src", "images/spinner.gif");
@@ -818,6 +823,7 @@ function readFields() {
values['parent'] = $("select[name=parent]").val();
values['map_linked'] = $("select[name=map_linked]").val();
values['width_percentile'] = $("input[name=width_percentile]").val();
+ values['bars_graph_height'] = $("input[name=bars_graph_height]").val();
values['max_percentile'] = parseInt($("input[name=max_percentile]").val());
values['width_module_graph'] = $("input[name=width_module_graph]").val();
values['height_module_graph'] = $("input[name=height_module_graph]").val();
@@ -993,6 +999,14 @@ function create_button_palette_callback() {
alert($("#message_alert_no_module").html());
validate = false;
}
+ if ((values['width_percentile'] == '')) {
+ alert($("#message_alert_no_width_percentile").html());
+ validate = false;
+ }
+ if ((values['bars_graph_height'] == '')) {
+ alert($("#message_alert_no_bars_graph_height").html());
+ validate = false;
+ }
break;
case 'simple_value':
if ((values['agent'] == '')) {
@@ -1498,6 +1512,8 @@ function loadFieldsFromDB(item) {
$("select[name=map_linked]").val(val);
if (key == 'width_percentile')
$("input[name=width_percentile]").val(val);
+ if (key == 'bars_graph_height')
+ $("input[name=bars_graph_height]").val(val);
if (key == 'max_percentile')
$("input[name=max_percentile]").val(val);
if (key == 'width_module_graph')
@@ -1751,6 +1767,9 @@ function hiddenFields(item) {
$("#percentile_bar_row_1").css('display', 'none');
$("#percentile_bar_row_1." + item).css('display', '');
+ $("#height_bars_graph_row").css('display', 'none');
+ $("#height_bars_graph_row." + item).css('display', '');
+
$("#percentile_bar_row_2").css('display', 'none');
$("#percentile_bar_row_2." + item).css('display', '');
@@ -1853,6 +1872,7 @@ function cleanFields(item) {
$("select[name=process_value]").val(0);
$("select[name=background_image]").val('');
$("input[name=width_percentile]").val('');
+ $("input[name=bars_graph_height]").val('');
$("input[name=max_percentile]").val('');
$("select[name=period]").val('');
$("input[name=width]").val(0);
@@ -2024,6 +2044,7 @@ function setBarsGraph(id_data, values) {
}
width_percentile = values['width_percentile'];
+ bars_graph_height = values['bars_graph_height'];
parameter = Array();
@@ -2041,12 +2062,12 @@ function setBarsGraph(id_data, values) {
success: function (data) {
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras.png');
- if (values['width_percentile'] == "0") {
+ if (values['width_percentile'] == "0" && values["bars_graph_height"] == "0") {
// Image size
}
else{
- $("#" + id_data + " img").css('width', width_percentile+'px');
- $("#" + id_data + " img").css('height', width_percentile+'px');
+ $("#" + id_data + " img").css('width', width_percentile + 'px');
+ $("#" + id_data + " img").css('height', bars_graph_height + 'px');
}
if($('#'+id_data+' table').css('float') == 'right' || $('#'+id_data+ ' table').css('float') == 'left'){
diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php
index 9b3fd183e2..5e1d9cafd5 100755
--- a/pandora_console/include/ajax/visual_console_builder.ajax.php
+++ b/pandora_console/include/ajax/visual_console_builder.ajax.php
@@ -101,6 +101,7 @@ $height = get_parameter('height', null);
$parent = get_parameter('parent', null);
$map_linked = get_parameter('map_linked', null);
$width_percentile = get_parameter('width_percentile', null);
+$bars_graph_height = get_parameter('bars_graph_height', 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);
@@ -655,6 +656,9 @@ switch ($action) {
if ($width_percentile !== null) {
$values['width'] = $width_percentile;
}
+ if ($bars_graph_height !== null) {
+ $values['height'] = $bars_graph_height;
+ }
if ($bars_graph_type !== null) {
$values['type_graph'] = $bars_graph_type;
}
@@ -749,6 +753,7 @@ switch ($action) {
unset($values['border_color']);
unset($values['width']);
unset($values['id_agent']);
+ unset($values['height']);
break;
case 'donut_graph':
unset($values['border_color']);
@@ -920,6 +925,7 @@ switch ($action) {
break;
case 'bars_graph':
$elementFields['width_percentile'] = $elementFields['width'];
+ $elementFields['bars_graph_height'] = $elementFields['height'];
$elementFields['bars_graph_type'] = $elementFields['type_graph'];
$elementFields['grid_color'] = $elementFields['border_color'];
$elementFields['id_agent_string'] = $elementFields['id_agent'];
@@ -1082,12 +1088,8 @@ switch ($action) {
break;
case 'bars_graph':
$values['type'] = BARS_GRAPH;
- if ($width_percentile == null) {
- $values['width'] = 0;
- }
- else {
- $values['width'] = $width_percentile;
- }
+ $values['width'] = $width_percentile;
+ $values['height'] = $bars_graph_height;
$values['type_graph'] = $bars_graph_type;
$values['image'] = $background_color;
$values['border_color'] = $grid_color;
diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php
index 72ead5dff7..4fc59cd684 100755
--- a/pandora_console/include/functions_visual_map.php
+++ b/pandora_console/include/functions_visual_map.php
@@ -1149,10 +1149,10 @@ function visual_map_print_item($mode = "read", $layoutData,
}
else{
if ($layoutData['id_metaconsole'] != 0) {
- $img = '';
+ $img = '
';
}
else{
- $img = '
';
+ $img = '
';
}
}
}
@@ -1209,7 +1209,7 @@ function visual_map_print_item($mode = "read", $layoutData,
$water_mark = array('file' => '/var/www/html/pandora_console/images/logo_vertical_water.png',
'url' => 'http://localhost/pandora_console/images/logo_vertical_water.png');
- if ($width == 0) {
+ if ($width == 0 && $height == 0) {
if ($layoutData['label_position']=='left') {
if ($layoutData['type_graph'] == 'horizontal') {
$img = '