mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2011-08-10 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_networkmap.php: fixed execution the generation when it is empty. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4713 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
3a8eb06eb9
commit
7ba1eabcae
@ -1,3 +1,8 @@
|
|||||||
|
2011-08-10 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_networkmap.php: fixed execution the generation when
|
||||||
|
it is empty.
|
||||||
|
|
||||||
2011-08-10 Ramon Novoa <rnovoa@artica.es>
|
2011-08-10 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql: Added
|
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql: Added
|
||||||
@ -40,6 +45,11 @@
|
|||||||
|
|
||||||
Fixes: #3371197
|
Fixes: #3371197
|
||||||
|
|
||||||
|
2011-08-10 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_networkmap.php: fixed execution the generation when
|
||||||
|
it is empty.
|
||||||
|
|
||||||
2011-08-10 Miguel de Dios <miguel.dedios@artica.es>
|
2011-08-10 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* include/functions_menu.php, operation/menu.php, godmode/menu.php: fixed
|
* include/functions_menu.php, operation/menu.php, godmode/menu.php: fixed
|
||||||
|
@ -48,14 +48,23 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
|
|||||||
|
|
||||||
$filter = array ();
|
$filter = array ();
|
||||||
$filter['disabled'] = 0;
|
$filter['disabled'] = 0;
|
||||||
if ($group >= 1)
|
if ($group >= 1) {
|
||||||
$filter['id_grupo'] = $group;
|
$filter['id_grupo'] = $group;
|
||||||
|
|
||||||
// Get agent data
|
$agents = agents_get_agents ($filter,
|
||||||
$agents = agents_get_agents ($filter,
|
array ('id_grupo, nombre, id_os, id_parent, id_agente'));
|
||||||
array ('id_grupo, nombre, id_os, id_parent, id_agente'));
|
}
|
||||||
|
else if ($group == -666) {
|
||||||
|
$agents = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$agents = agents_get_agents ($filter,
|
||||||
|
array ('id_grupo, nombre, id_os, id_parent, id_agente'));
|
||||||
|
}
|
||||||
|
|
||||||
if ($agents === false)
|
if ($agents === false)
|
||||||
return false;
|
//return false;
|
||||||
|
$agents = array();
|
||||||
|
|
||||||
// Open Graph
|
// Open Graph
|
||||||
$graph = networkmap_open_graph ($layout, $nooverlap, $pure, $zoom, $ranksep, $font_size);
|
$graph = networkmap_open_graph ($layout, $nooverlap, $pure, $zoom, $ranksep, $font_size);
|
||||||
@ -103,9 +112,6 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
|
|||||||
$node_count++;
|
$node_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty ($nodes)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Create nodes
|
// Create nodes
|
||||||
foreach ($nodes as $node_id => $node) {
|
foreach ($nodes as $node_id => $node) {
|
||||||
if ($center > 0 && ! networkmap_is_descendant ($node_id, $center, $parents)) {
|
if ($center > 0 && ! networkmap_is_descendant ($node_id, $center, $parents)) {
|
||||||
@ -136,7 +142,7 @@ function networkmap_generate_dot ($pandora_name, $group = 0, $simple = 0, $font_
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create a central node if orphan nodes exist
|
// Create a central node if orphan nodes exist
|
||||||
if (count ($orphans)) {
|
if (count ($orphans) || empty ($nodes)) {
|
||||||
$graph .= networkmap_create_pandora_node ($pandora_name, $font_size, $simple);
|
$graph .= networkmap_create_pandora_node ($pandora_name, $font_size, $simple);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user