diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js
index 2911edc311..799c6a72b2 100755
--- a/pandora_console/godmode/reporting/visual_console_builder.editor.js
+++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js
@@ -2005,9 +2005,7 @@ function setDonutsGraph (id_data, values) {
parameter.push ({name: "action", value: "get_module_type_string"});
parameter.push ({name: "id_agent", value: values['id_agent']});
parameter.push ({name: "id_agent_module", value: values['module']});
- if (is_metaconsole()) {
- parameter.push ({name: "id_metaconsole", value: id_metaconsole});
- }
+ parameter.push ({name: "id_element", value: id_data});
parameter.push ({name: "id_visual_console", value: id_visual_console});
jQuery.ajax({
url: get_url_ajax(),
@@ -2015,7 +2013,6 @@ function setDonutsGraph (id_data, values) {
type: "POST",
dataType: 'json',
success: function (data) {
- console.log(data);
if (data['no_data'] == true) {
if (values['width'] == "0") {
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/wrong_donut_graph.png');
diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php
index 4d32a885c3..a909206b53 100755
--- a/pandora_console/include/ajax/visual_console_builder.ajax.php
+++ b/pandora_console/include/ajax/visual_console_builder.ajax.php
@@ -144,8 +144,10 @@ switch ($action) {
case 'get_module_type_string':
$data = array ();
- if (!empty($id_metaconsole)) {
- $connection = db_get_row_filter ('tmetaconsole_setup', $id_metaconsole);
+ $layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element));
+
+ if ($layoutData['id_metaconsole'] != 0) {
+ $connection = db_get_row_filter ('tmetaconsole_setup', $layoutData['id_metaconsole']);
if (metaconsole_load_external_db($connection) != NOERR) {
continue;
}
@@ -155,7 +157,7 @@ switch ($action) {
array ('id_agente' => $id_agent,
'id_agente_modulo' => $id_agent_module));
- if (!empty($id_metaconsole)) {
+ if ($layoutData['id_metaconsole'] != 0) {
metaconsole_restore_db();
}
diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php
index 97ac64b8d4..e8a8d76bdb 100755
--- a/pandora_console/include/functions_visual_map.php
+++ b/pandora_console/include/functions_visual_map.php
@@ -1141,8 +1141,8 @@ function visual_map_print_item($mode = "read", $layoutData,
break;
case DONUT_GRAPH:
- if (!empty($id_metaconsole)) {
- $connection = db_get_row_filter ('tmetaconsole_setup', $id_metaconsole);
+ if ($layoutData['id_metaconsole'] != 0) {
+ $connection = db_get_row_filter ('tmetaconsole_setup', $layoutData['id_metaconsole']);
if (metaconsole_load_external_db($connection) != NOERR) {
continue;
}
@@ -1151,10 +1151,6 @@ function visual_map_print_item($mode = "read", $layoutData,
$is_string = db_get_value_filter ('id_tipo_modulo', 'tagente_modulo',
array ('id_agente' => $layoutData['id_agent'],
'id_agente_modulo' => $id_module));
-
- if (!empty($id_metaconsole)) {
- metaconsole_restore_db();
- }
if (($is_string == 17) || ($is_string == 23) || ($is_string == 3) ||
($is_string == 10) || ($is_string == 33)) {
@@ -1831,6 +1827,7 @@ function visual_map_print_item($mode = "read", $layoutData,
}
function get_donut_module_data ($id_module) {
+
$mod_values = db_get_value_filter('datos', 'tagente_estado', array('id_agente_modulo' => $id_module));
$values = explode(";", $mod_values);
diff --git a/pandora_console/include/graphs/functions_d3.php b/pandora_console/include/graphs/functions_d3.php
index 0e1a95f5f4..35b97240b1 100644
--- a/pandora_console/include/graphs/functions_d3.php
+++ b/pandora_console/include/graphs/functions_d3.php
@@ -24,9 +24,14 @@ function include_javascript_d3 ($return = false) {
if (!$is_include_javascript) {
$is_include_javascript = true;
- $output .= '';
- $output .= '';
-
+ if (is_metaconsole()) {
+ $output .= '';
+ $output .= '';
+ }
+ else {
+ $output .= '';
+ $output .= '';
+ }
}
if (!$return)
echo $output;
diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js
index b571732cd1..b7382d01f9 100644
--- a/pandora_console/include/graphs/pandora.d3.js
+++ b/pandora_console/include/graphs/pandora.d3.js
@@ -1590,7 +1590,6 @@ function print_donut_graph (recipient, width, height, module_data) {
slice.enter()
.insert("path")
.style("fill", function(d) {
- console.log(d);
return d.data.color;
})
.attr("class", "slice")