Hide inventory view if agent dont have inventory modules

This commit is contained in:
José González 2022-05-26 08:13:30 +02:00
parent c9ca52e5b9
commit 353e8773f8
1 changed files with 4 additions and 4 deletions

View File

@ -1403,7 +1403,7 @@ if ($agent_interfaces_count > 0) {
]
).'</a>';
if ($tab == 'interface') {
if ($tab === 'interface') {
$interfacetab['active'] = true;
} else {
$interfacetab['active'] = false;
@ -1420,19 +1420,19 @@ $alerttab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_ag
]
).'</a>';
if ($tab == 'alert') {
if ($tab === 'alert') {
$alerttab['active'] = true;
} else {
$alerttab['active'] = false;
}
// Inventory.
$inventoryCount = db_get_num_rows('SELECT id_agent_module_inventory FROM tagent_module_inventory WHERE id_agente = '.$agent['id_agente']);
$inventorytab = enterprise_hook('inventory_tab');
if ($inventorytab == -1) {
if ($inventorytab == -1 || $inventoryCount === 0) {
$inventorytab = '';
}
// Collection.
$collectiontab = enterprise_hook('collection_tab');
if ($collectiontab == -1) {