[icinga-checkins] icinga.org: icinga-web/mhein/testing: * Excluded disabled hostgroups in view

git at icinga.org git at icinga.org
Fri Aug 12 12:28:37 CEST 2011


Module: icinga-web
Branch: mhein/testing
Commit: 3a246a65b5101c90da767429e856f5da41e96b94
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=3a246a65b5101c90da767429e856f5da41e96b94

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Fri Aug 12 11:41:42 2011 +0200

* Excluded disabled hostgroups in view

---

 .../LegacyLayer/TargetModifierModel.class.php      |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/app/modules/Api/models/Store/LegacyLayer/TargetModifierModel.class.php b/app/modules/Api/models/Store/LegacyLayer/TargetModifierModel.class.php
index 1be1ba7..b4868e1 100644
--- a/app/modules/Api/models/Store/LegacyLayer/TargetModifierModel.class.php
+++ b/app/modules/Api/models/Store/LegacyLayer/TargetModifierModel.class.php
@@ -598,7 +598,12 @@ class Api_Store_LegacyLayer_TargetModifierModel extends IcingaStoreTargetModifie
                 $this->mainAlias = "n";
                 $this->setTarget("IcingaNotifications");
                 $this->aliasDefs = array(
-                                       "obn" => array("src" => "n", "relation" => "object"),
+                                       "on" => array(
+                                           "src" => "n", 
+                                           "relation" => "object", 
+                                           "with"=>"on.is_active=1",
+                                           "alwaysJoin" => true
+                                       ),
                                        "s" => array(
                                            "src" => "n",
                                            "relation" => "services",
@@ -644,10 +649,17 @@ class Api_Store_LegacyLayer_TargetModifierModel extends IcingaStoreTargetModifie
 
             case IcingaApiConstants::TARGET_HOSTGROUP_SUMMARY:
                 $this->mainAlias = "hg";
+                $this->setDistinct(false); 
                 $this->setTarget("IcingaHostgroups");
+                $this->ignoreIds = true; 
                 $this->aliasDefs = array(
                                        "i"   => array("src" => "hg", "relation" => "instance"),
-                                       "ohg"   => array("src" => "hg", "relation" => "object"),
+                                       "ohg"   => array(
+                                            "src" => "hg",
+                                            "alwaysJoin" => true, 
+                                            "relation" => "object", 
+                                            "with" => "ohg.is_active = 1" 
+                                        ),
                                        "hgm"   => array("src" => "hg", "relation" => "members"),
                                        "hs"    => array("src" => "hgm", "relation" => "status"),
                                        "oh"    => array("src" => "hgm", "relation" => "object")
@@ -657,6 +669,7 @@ class Api_Store_LegacyLayer_TargetModifierModel extends IcingaStoreTargetModifie
 
             case IcingaApiConstants::TARGET_SERVICEGROUP_SUMMARY:
                 $this->mainAlias = "sg";
+                $this->ignoreIds = true;
                 $this->setTarget("IcingaServicegroups");
                 $this->aliasDefs = array(
                                        "i"   => array("src" => "sg", "relation" => "instance"),





More information about the icinga-checkins mailing list