From 23a26fe8f5409070c9a4e4502e9973e47389433a Mon Sep 17 00:00:00 2001 From: osmiy Date: Tue, 31 Jan 2006 11:43:21 +0000 Subject: - Bug fixing (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@2589 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/sysmap.php | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'frontends/php/sysmap.php') diff --git a/frontends/php/sysmap.php b/frontends/php/sysmap.php index 4d426872..c7794515 100644 --- a/frontends/php/sysmap.php +++ b/frontends/php/sysmap.php @@ -127,7 +127,8 @@ if(function_exists("imagecreatetruecolor")&&@imagecreatetruecolor(1,1)) { $map .= "\n\"$host_\""; } else @@ -198,22 +199,45 @@ " where sysmapid=".$_REQUEST["sysmapid"]." order by linkid"); while($row=DBfetch($result)) { + /* prepare label 1 */ + $db_hosts = DBselect("select h.*". + " from sysmaps_hosts sh,hosts h". + " where sh.sysmapid=".$_REQUEST["sysmapid"]. + " and h.hostid=sh.hostid". + " and h.status not in (".HOST_STATUS_DELETED.")". + " and sh.shostid=".$row["shostid1"]); + if(DBnum_rows($db_hosts)==0) continue; $result1=DBselect("select label from sysmaps_hosts where shostid=".$row["shostid1"]); $row1=DBfetch($result1); $label1=$row1["label"]; + if($label1==""){ + $db_host = DBfetch($db_hosts); + $label1 = $db_host['host']; + } + + /* prepare label 2 */ + $db_hosts = DBselect("select h.*". + " from sysmaps_hosts sh,hosts h". + " where sh.sysmapid=".$_REQUEST["sysmapid"]. + " and h.hostid=sh.hostid". + " and h.status not in (".HOST_STATUS_DELETED.")". + " and sh.shostid=".$row["shostid2"]); + if(DBnum_rows($db_hosts)==0) continue; $result1=DBselect("select label from sysmaps_hosts where shostid=".$row["shostid2"]); $row1=DBfetch($result1); $label2=$row1["label"]; + if($label2==""){ + $db_host = DBfetch($db_hosts); + $label2 = $db_host['host']; + } + /* prepare description */ if(isset($row["triggerid"])) - { $description=expand_trigger_description($row["triggerid"]); - } else - { $description="-"; - } + /* draw row */ $table->addRow(array( $label1, $label2, -- cgit