r1279 + getObjectAddresses() made use of displayedName() as well
authorDenis Ovsienko <infrastation@yandex.ru>
Wed, 14 Nov 2007 17:08:18 +0000 (17:08 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Wed, 14 Nov 2007 17:08:18 +0000 (17:08 +0000)
+ printRefsOfType() now displays interface name, if appropriate

inc/database.php
inc/interface.php

index 81a2cb098662c2dbfa4dd760ea93606a6c7035aa..5ade8c530c181df83a203f30a5a0cb79f8f1a30b 100644 (file)
@@ -885,6 +885,8 @@ function unlinkPort ($port)
        
 }
 
+// FIXME: after falling back to using existing getObjectInfo we don't
+// need that large query. Shrink it some later.
 function getObjectAddresses ($object_id = 0)
 {
        if ($object_id == 0)
@@ -943,7 +945,8 @@ function getObjectAddresses ($object_id = 0)
                                $ret[$count]['references'][$refcount]['type'] = $row['RemoteBonds_type'];
                                $ret[$count]['references'][$refcount]['name'] = $row['RemoteBonds_name'];
                                $ret[$count]['references'][$refcount]['object_id'] = $row['RemoteBonds_object_id'];
-                               $ret[$count]['references'][$refcount]['object_name'] = $row['RemoteObject_name'];
+                               $oi = getObjectInfo ($row['RemoteBonds_object_id']);
+                               $ret[$count]['references'][$refcount]['object_name'] = displayedName ($oi);
                                $refcount++;
                        }
                }
index e54d752006502d4250aee23345ac6ee4dbe15cdb..f7b252843d71c554e0e65041f9a98bb93645f4f5 100644 (file)
@@ -590,7 +590,10 @@ function printRefsOfType ($refs, $type, $eq)
                if ($eq($ref['type'], $type))
                {
                        if ($gotone) echo ', ';
-                       echo "<a href='${root}?page=object&object_id=${ref['object_id']}'>${ref['object_name']}</a>";
+                       echo "<a href='${root}?page=object&object_id=${ref['object_id']}'>";
+                       if (!empty ($ref['name']))
+                               echo $ref['name'] . '@';
+                       echo "${ref['object_name']}</a>";
                        $gotone=1;
                }
        }