diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js
index 055762abc8..d7cf3687e9 100755
--- a/pandora_console/godmode/reporting/visual_console_builder.editor.js
+++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js
@@ -220,12 +220,11 @@ function update_button_palette_callback() {
// TODO VALIDATE DATA
switch (selectedItem) {
case 'background':
-
if(values['width'] < 1024 || values['height'] < 768){
- alert('Min allowed size is 1024x768');
- return false;
+ alert('Min allowed size is 1024x768');
+ return false;
}
-
+
if(values['width'] == 0 && values['height'] == 0) {
values['width'] =
$("#hidden-background_original_width").val();
@@ -235,7 +234,6 @@ function update_button_palette_callback() {
$("#background").css('width', values['width']);
$("#background").css('height', values['height']);
- //$("#background").css('background', 'url(images/console/background/' + values['background'] + ')');
var image = values['background'];
$("#background_img").attr('src', "images/spinner.gif");
set_image("background", null, image);
@@ -243,7 +241,6 @@ function update_button_palette_callback() {
idElement = 0;
break;
case 'box_item':
-
if($('input[name=width_box]').val() == ''){
alert('Undefined width');
return false;
@@ -252,11 +249,11 @@ function update_button_palette_callback() {
alert('Undefined height');
return false;
}
-
+
$("#" + idItem + " div").css('background-color', values['fill_color']);
$("#" + idItem + " div").css('border-color', values['border_color']);
$("#" + idItem + " div").css('border-width', values['border_width'] + "px");
-
+
if(values['height_box']==0 || values['width_box']==0){
$("#" + idItem + " div").css('width', "300px");
$("#" + idItem + " div").css('height', "180px");
@@ -271,54 +268,43 @@ function update_button_palette_callback() {
alert('Undefined image');
return false;
}
-
+
$("#text_" + idItem).html(values['label']);
-
+
if(values['show_statistics'] == 1){
-
if (!$('#image_'+idItem).length) {
-
if(values['label_position'] == 'left'){
-
var $image = $('')
.attr('id', 'image_' + idItem)
.attr('class', 'image')
.attr('src', 'images/console/icons/'+values["image"]+".png")
.attr('style','float:right;');
-
}
else if(values['label_position'] == 'right'){
-
var $image = $('
')
.attr('id', 'image_' + idItem)
.attr('class', 'image')
.attr('src', 'images/console/icons/'+values["image"]+".png")
.attr('style','float:left;');
-
}
else{
-
var $image = $('
')
.attr('id', 'image_' + idItem)
.attr('class', 'image')
.attr('src', 'images/console/icons/'+values["image"]+".png");
-
}
-
-
+
$('#'+idItem).append($image);
-
}
-
+
if ((values['width'] == 0) || (values['height'] == 0)) {
- $("#image_" + idItem).removeAttr('width');
- $("#image_" + idItem).removeAttr('height');
- $("#image_" + idItem).attr('width', 520);
- $("#image_" + idItem).attr('height', 80);
- $("#image_" + idItem).css('width', '520px');
- $("#image_" + idItem).css('height', '80px');
- $("#image_" + idItem).attr('src', 'images/console/signes/group_status.png');
-
+ $("#image_" + idItem).removeAttr('width');
+ $("#image_" + idItem).removeAttr('height');
+ $("#image_" + idItem).attr('width', 520);
+ $("#image_" + idItem).attr('height', 80);
+ $("#image_" + idItem).css('width', '520px');
+ $("#image_" + idItem).css('height', '80px');
+ $("#image_" + idItem).attr('src', 'images/console/signes/group_status.png');
}
else {
$("#image_" + idItem).removeAttr('width');
@@ -328,49 +314,36 @@ function update_button_palette_callback() {
$("#image_" + idItem).css('width', values['width'] + 'px');
$("#image_" + idItem).css('height', values['height'] + 'px');
$("#image_" + idItem).attr('src', 'images/console/signes/group_status.png');
- }
-
+ }
}
else{
-
if ((values['width'] == 0) || (values['height'] == 0)) {
-
if(values['image'] != '' && values['image'] != 'none'){
-
if (!$('#image_'+idItem).length) {
-
if(values['label_position'] == 'left'){
-
var $image = $('
')
.attr('id', 'image_' + idItem)
.attr('class', 'image')
.attr('src', 'images/console/icons/'+values["image"]+".png")
.attr('style','float:right;');
-
}
else if(values['label_position'] == 'right'){
-
var $image = $('
')
.attr('id', 'image_' + idItem)
.attr('class', 'image')
.attr('src', 'images/console/icons/'+values["image"]+".png")
.attr('style','float:left;');
-
}
else{
-
var $image = $('
')
.attr('id', 'image_' + idItem)
.attr('class', 'image')
.attr('src', 'images/console/icons/'+values["image"]+".png");
-
}
-
-
+
$('#'+idItem).append($image);
-
}
-
+
if($('#preview > img').prop('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$("#image_" + idItem).removeAttr('width');
$("#image_" + idItem).removeAttr('height');
@@ -382,15 +355,11 @@ function update_button_palette_callback() {
else{
$("#image_" + idItem).removeAttr('width');
$("#image_" + idItem).removeAttr('height');
-
$("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight);
$("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight);
$("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px');
- $("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
-
-
+ $("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
}
-
}
else{
$("#image_" + idItem).removeAttr('width');
@@ -401,7 +370,6 @@ function update_button_palette_callback() {
$("#image_" + idItem).css('height', '70px');
$("#image_" + idItem).remove();
}
-
}
else {
$("#image_" + idItem).removeAttr('width');
@@ -411,14 +379,9 @@ function update_button_palette_callback() {
$("#image_" + idItem).css('width', values['width'] + 'px');
$("#image_" + idItem).css('height', values['height'] + 'px');
}
-
}
-
-
-
break;
case 'static_graph':
-
if($('input[name=width]').val() == ''){
alert('Undefined width');
return false;
@@ -433,10 +396,8 @@ function update_button_palette_callback() {
}
$("#text_" + idItem).html(values['label']);
-
+
if(values['show_statistics'] == 1){
-
-
if ((values['width'] == 0) || (values['height'] == 0)) {
$("#image_" + idItem).removeAttr('width');
$("#image_" + idItem).removeAttr('height');
@@ -445,7 +406,6 @@ function update_button_palette_callback() {
$("#image_" + idItem).css('width', '520px');
$("#image_" + idItem).css('height', '80px');
$("#image_" + idItem).attr('src', 'images/console/signes/group_status.png');
-
}
else {
$("#image_" + idItem).removeAttr('width');
@@ -455,50 +415,35 @@ function update_button_palette_callback() {
$("#image_" + idItem).css('width', values['width'] + 'px');
$("#image_" + idItem).css('height', values['height'] + 'px');
$("#image_" + idItem).attr('src', 'images/console/signes/group_status.png');
- }
-
+ }
}
else{
-
if ((values['width'] == 0) || (values['height'] == 0)) {
-
if(values['image'] != '' && values['image'] != 'none'){
-
if (!$('#image_'+idItem).length) {
-
if(values['label_position'] == 'left'){
-
var $image = $('
')
.attr('id', 'image_' + idItem)
.attr('class', 'image')
.attr('src', 'images/console/icons/'+values["image"]+".png")
.attr('style','float:right;');
-
}
else if(values['label_position'] == 'right'){
-
var $image = $('
')
.attr('id', 'image_' + idItem)
.attr('class', 'image')
.attr('src', 'images/console/icons/'+values["image"]+".png")
.attr('style','float:left;');
-
}
else{
-
var $image = $('
')
.attr('id', 'image_' + idItem)
.attr('class', 'image')
.attr('src', 'images/console/icons/'+values["image"]+".png");
-
}
-
-
$('#'+idItem).append($image);
-
}
-
-
+
if($('#preview > img').prop('naturalWidth') == null || $('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){
$("#image_" + idItem).removeAttr('width');
$("#image_" + idItem).removeAttr('height');
@@ -510,15 +455,11 @@ function update_button_palette_callback() {
else{
$("#image_" + idItem).removeAttr('width');
$("#image_" + idItem).removeAttr('height');
-
$("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight);
$("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight);
$("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px');
- $("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
-
-
+ $("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px');
}
-
}
else{
$("#image_" + idItem).removeAttr('width');
@@ -529,7 +470,6 @@ function update_button_palette_callback() {
$("#image_" + idItem).css('height', '70px');
$("#image_" + idItem).remove();
}
-
}
else {
$("#image_" + idItem).removeAttr('width');
@@ -539,9 +479,7 @@ function update_button_palette_callback() {
$("#image_" + idItem).css('width', values['width'] + 'px');
$("#image_" + idItem).css('height', values['height'] + 'px');
}
-
}
-
break;
case 'percentile_bar':
case 'percentile_item':
@@ -549,13 +487,15 @@ function update_button_palette_callback() {
alert('Undefined width');
return false;
}
+
if($('input[name=height_percentile]').val() == ''){
alert('Undefined height');
return false;
}
-
+
$("#text_" + idItem).html(values['label']);
$("#image_" + idItem).attr("src", "images/spinner.gif");
+
if (values['type_percentile'] == 'bubble') {
setPercentileBubble(idItem, values);
}
@@ -568,7 +508,7 @@ function update_button_palette_callback() {
else {
setPercentileBar(idItem, values);
}
-
+
break;
case 'module_graph':
if($('#dir_items').html() == 'horizontal'){
@@ -2479,7 +2419,6 @@ function setPercentileCircular (id_data, values) {
width_percentile = values['width_percentile'];
var parameter = Array();
-
parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"});
parameter.push ({name: "action", value: "get_module_value"});
parameter.push ({name: "id_element", value: id_data});
@@ -2514,7 +2453,7 @@ function setPercentileCircular (id_data, values) {
else {
value_text = module_value + " " + unit_text;
}
-
+
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/circular-progress-bar.png');
if($('#text-width_percentile').val() == 0){
$("#" + id_data + " img").css('width', '130px');
@@ -2524,12 +2463,12 @@ function setPercentileCircular (id_data, values) {
$("#" + id_data + " img").css('width', $('#text-width_percentile').val()+'px');
$("#" + id_data + " img").css('height', $('#text-width_percentile').val()+'px');
}
-
+
if($('#'+id_data+' table').css('float') == 'right' || $('#'+id_data+ ' table').css('float') == 'left'){
- $('#'+id_data+ ' img').css('margin-top', parseInt($('#'+id_data).css('height'))/2 - parseInt($('#'+id_data+ ' img').css('height'))/2);
+ $('#'+id_data+ ' img').css('margin-top', parseInt($('#'+id_data).css('height'))/2 - parseInt($('#'+id_data+ ' img').css('height'))/2);
}
else{
- $('#'+id_data+ ' img').css('margin-left',parseInt($('#'+id_data).css('width'))/2 - parseInt($('#'+id_data+ ' img').css('width'))/2);
+ $('#'+id_data+ ' img').css('margin-left',parseInt($('#'+id_data).css('width'))/2 - parseInt($('#'+id_data+ ' img').css('width'))/2);
}
}
});
@@ -3835,14 +3774,12 @@ function updateDB_visual(type, idElement , values, event, top, left) {
case 'clock':
case 'auto_sla_graph':
case 'donut_graph':
-
- if ((typeof(values['mov_left']) != 'undefined') &&
- (typeof(values['mov_top']) != 'undefined')) {
+ if ((typeof(values['absolute_left']) != 'undefined') &&
+ (typeof(values['absolute_top']) != 'undefined')) {
$("#" + idElement).css('top', '0px').css('top', top + 'px');
$("#" + idElement).css('left', '0px').css('left', left + 'px');
}
- else if ((typeof(values['absolute_left']) != 'undefined') &&
- (typeof(values['absolute_top']) != 'undefined')) {
+ else{
$("#" + idElement).css('top', '0px').css('top', top + 'px');
$("#" + idElement).css('left', '0px').css('left', left + 'px');
}
@@ -3952,7 +3889,6 @@ function updateDB(type, idElement , values, event) {
parameter.push({name: key, value: val});
});
-
switch (type) {
// -- line_item --
case 'handler_start':
diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php
index f3c1d22490..b0a613ffd9 100644
--- a/pandora_console/include/functions_graph.php
+++ b/pandora_console/include/functions_graph.php
@@ -3284,13 +3284,10 @@ function graph_graphic_moduleevents ($id_agent, $id_module, $width, $height, $pe
$data = array ();
- //$resolution = $config['graph_res'] * ($period * 2 / $width); // Number of "slices" we want in graph
- $resolution = 5 * ($period * 2 / $width); // Number of "slices" we want in graph
- $interval = (int) ($period / $resolution);
- $date = get_system_time ();
+ $interval = 24;
+ $date = get_system_time();
$datelimit = $date - $period;
$periodtime = floor ($period / $interval);
- $time = array ();
$data = array ();
$legend = array();
$full_legend = array();
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index f691a1bf0e..1d2558f147 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -218,11 +218,11 @@ function reporting_make_reporting_data($report = null, $id_report,
}
}
- if(sizeof($content['id_agent']) != 1){
+ if(is_array($content['id_agent']) && sizeof($content['id_agent']) != 1){
$content['style']['name_label'] = str_replace("_agent_",sizeof($content['id_agent']).__(' agents'),$content['style']['name_label']);
}
- if(sizeof($content['id_agent_module']) != 1){
+ if(is_array($content['id_agent_module']) && sizeof($content['id_agent_module']) != 1){
$content['style']['name_label'] = str_replace("_module_",sizeof($content['id_agent_module']).__(' modules'),$content['style']['name_label']);
}
@@ -6063,6 +6063,7 @@ function reporting_general($report, $content) {
$i = 0;
$index = 0;
$is_string = array();
+
foreach ($generals as $row) {
//Metaconsole connection
$server_name = $row ['server_name'];
diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php
index 1451cb80d3..082415c63c 100755
--- a/pandora_console/include/functions_visual_map.php
+++ b/pandora_console/include/functions_visual_map.php
@@ -1205,7 +1205,7 @@ function visual_map_print_item($mode = "read", $layoutData,
$img = '