r2956 - maintenance->trunk sync of changeset:2934
authorDenis Ovsienko <infrastation@yandex.ru>
Mon, 20 Jul 2009 13:47:38 +0000 (13:47 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 20 Jul 2009 13:47:38 +0000 (13:47 +0000)
ChangeLog
inc/database.php
inc/functions.php

index 0e6f0f31a2155502bbc5ada24062c4ddb07569bc..1ba7a1b79310a3bc50fd7df356ad48415ad48541 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
 0.17.2
        new feature: configure default SNMP community (by jthurman)
-       new feature: "$untagged" and "$masklen_OP_NN" autotags
+       new feature: "$untagged", "$portless" and "$masklen_OP_NN" autotags
        new feature: knight button in IPv4 tree
        new feature: searching by attribute value or port reservation comment
        update: show appropriate message, if a record cannot be found
index 40c8184ce6849b627cd8990ce5c2e1df3f84a1a1..b113112661821e5e36fa3c0972d8ee34fae1587b 100644 (file)
@@ -25,6 +25,7 @@ $SQLSchema = array
                        'objtype_name' => '(select dict_value from Dictionary where dict_key = objtype_id)',
                        'has_problems' => 'has_problems',
                        'comment' => 'comment',
+                       'nports' => '(SELECT COUNT(*) FROM Port WHERE object_id = RackObject.id)',
                ),
                'keycolumn' => 'id',
                'ordcolumns' => array ('name'),
index 895e5dc50223d5bbd9a892479f517adad1393198..75838d13b74a8f90b25fa4e8d2d8cc75805fea0a 100644 (file)
@@ -1000,6 +1000,8 @@ function generateEntityAutoTags ($cell)
                                $ret[] = array ('tag' => '$cn_' . $cell['name']);
                        if (!strlen ($cell['rack_id']))
                                $ret[] = array ('tag' => '$unmounted');
+                       if (!$cell['nports'])
+                               $ret[] = array ('tag' => '$portless');
                        break;
                case 'ipv4net':
                        $ret[] = array ('tag' => '$ip4netid_' . $cell['id']);