[icinga-checkins] icinga.org: icinga-web/master: * Added contact definitions to instances ( fixes #2179)

git at icinga.org git at icinga.org
Mon Feb 20 18:24:26 CET 2012


Module: icinga-web
Branch: master
Commit: 53c5ff670b7be2b7f91216aee299b4b731f75ec1
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=53c5ff670b7be2b7f91216aee299b4b731f75ec1

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Mon Feb 20 13:38:16 2012 +0100

* Added contact definitions to instances (fixes #2179)

---

 .../models/generated/BaseIcingaInstances.php       |    9 ++++++++-
 .../LegacyLayer/TargetModifierModel.class.php      |    7 ++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/app/modules/Api/lib/database/models/generated/BaseIcingaInstances.php b/app/modules/Api/lib/database/models/generated/BaseIcingaInstances.php
index 1a3c757..bbd918b 100644
--- a/app/modules/Api/lib/database/models/generated/BaseIcingaInstances.php
+++ b/app/modules/Api/lib/database/models/generated/BaseIcingaInstances.php
@@ -65,7 +65,14 @@ abstract class BaseIcingaInstances extends Doctrine_Record {
                            'local' => 'instance_id',
                            'foreign' => 'instance_id'
                        ));
-        
+        $this->hasMany('IcingaContactgroups as contactgroups', array(
+                           'local' => 'instance_id',
+                           'foreign' => 'instance_id'
+                       ));
+        $this->hasMany('IcingaContacts as contacts', array(
+                           'local' => 'instance_id',
+                           'foreign' => 'instance_id'
+                       ));
         $this->hasOne('IcingaProgramstatus as programstatus', array(
                            'local' => 'instance_id',
                            'foreign' => 'instance_id'
diff --git a/app/modules/Api/models/Store/LegacyLayer/TargetModifierModel.class.php b/app/modules/Api/models/Store/LegacyLayer/TargetModifierModel.class.php
index 9999d7e..eb688e2 100644
--- a/app/modules/Api/models/Store/LegacyLayer/TargetModifierModel.class.php
+++ b/app/modules/Api/models/Store/LegacyLayer/TargetModifierModel.class.php
@@ -407,6 +407,10 @@ class Api_Store_LegacyLayer_TargetModifierModel extends IcingaStoreTargetModifie
                 $this->mainAlias = "i";
                 $this->setTarget("IcingaInstances");
                 $this->aliasDefs = array(
+                        "cg" => array("src" => "i", "relation"=>"contactgroups"),
+                        "cgm" => array("src" => "i", "relation"=>"contacts"),
+                        "oc"  => array("src" => "cgm","relation" => "object"),
+                        "ocg"  => array("src" => "cg","relation" => "object"),
                         "ps" => array("src" => "i", "relation" => "programstatus", "alwaysJoin" => true)
                 );
                 break;
@@ -1191,7 +1195,7 @@ class Api_Store_LegacyLayer_TargetModifierModel extends IcingaStoreTargetModifie
      * @author Jannis Moßhammer <jannis.mosshammer at netways.de>
      */
     public function getAffectedColumns() {
-
+        
         $map = array_keys($this->aliasDefs);
         $map[] = $this->mainAlias;
         $affected = array();
@@ -1204,6 +1208,7 @@ class Api_Store_LegacyLayer_TargetModifierModel extends IcingaStoreTargetModifie
                 }
             }
         }
+        
         return $affected;
     }
 





More information about the icinga-checkins mailing list