From 0d197e449ebf4ab018423cb58f173d5b9858cad3 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Wed, 27 Sep 2023 11:53:05 +0200 Subject: [PATCH] #12083 Fix inventory widget --- pandora_console/include/functions_reporting.php | 1 + pandora_console/include/functions_ui.php | 3 +-- pandora_console/include/lib/Dashboard/Widgets/inventory.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index eab4e761d3..816b04b584 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -42,6 +42,7 @@ require_once $config['homedir'].'/include/functions_users.php'; enterprise_include_once('include/functions_reporting.php'); enterprise_include_once('include/functions_metaconsole.php'); enterprise_include_once('include/functions_inventory.php'); +require_once $config['homedir'].'/include/functions_inventory.php'; enterprise_include_once('include/functions_cron.php'); require_once $config['homedir'].'/include/functions_forecast.php'; require_once $config['homedir'].'/include/functions_ui.php'; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 006cdcb7cd..9034202233 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -409,8 +409,7 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t $messageTable->colspan[1][0] = 2; $messageTable->data = []; - $messageTable->data[0][0] = ''.$text_title.''; - $messageTable->data[0][1] = $closeButton; + $messageTable->data[0][0] = ''.$text_title.''.$closeButton; $messageTable->data[1][0] = ''.$text_message.''; // JavaScript help vars. diff --git a/pandora_console/include/lib/Dashboard/Widgets/inventory.php b/pandora_console/include/lib/Dashboard/Widgets/inventory.php index fe0d5fe308..8790ff2d16 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/inventory.php +++ b/pandora_console/include/lib/Dashboard/Widgets/inventory.php @@ -391,7 +391,7 @@ class InventoryWidget extends Widget public function load() { global $config; - + include_once $config['homedir'].'/include/functions_inventory.php'; $inventory_id_agent = $this->values['agentId']; $inventory_agent = $this->values['agentAlias']; @@ -824,7 +824,7 @@ class InventoryWidget extends Widget ); } - if (count($agents_ids) === 0 || (int) $rows === ERR_NODATA) { + if (count($agents_ids) === 0 || (int) $rows === ERR_NODATA || empty($rows) === true) { ui_print_info_message( [ 'no_close' => true,