Module: nagvis
Branch: master
Commit: 9e1ec758af840e51f5674972ea650618587257ab
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=9e1ec758af840e51f5674972ea650618587257ab

Author: LaMi <[email protected]>
Date:   Wed Nov 18 20:24:37 2009 +0100

Fixed host summary state fetching on chid map objects

---

 share/server/core/classes/NagVisMap.php            |    4 ++--
 share/server/core/classes/objects/NagVisMapObj.php |    4 +++-
 .../core/classes/objects/NagVisStatefulObject.php  |    8 ++++----
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/share/server/core/classes/NagVisMap.php 
b/share/server/core/classes/NagVisMap.php
index 8c801f2..1d8ee5b 100644
--- a/share/server/core/classes/NagVisMap.php
+++ b/share/server/core/classes/NagVisMap.php
@@ -37,12 +37,12 @@ class NagVisMap extends GlobalMap {
         * @param       GlobalBackend   $BACKEND
         * @author      Lars Michelsen <[email protected]>
         */
-       public function __construct($CORE, $MAPCFG, $BACKEND = null, $getState 
= 1, $bIsView = IS_VIEW) {
+       public function __construct($CORE, $MAPCFG, $BACKEND = null, $getState 
= GET_STATE, $bIsView = IS_VIEW) {
                parent::__construct($CORE, $MAPCFG);
                
                $this->BACKEND = $BACKEND;
                
-               if($getState) {
+               if($getState === true) {
                        $this->MAPOBJ = new NagVisMapObj($CORE, $BACKEND, 
$MAPCFG, $bIsView);
                        $this->MAPOBJ->fetchMembers();
                        $this->MAPOBJ->fetchState();
diff --git a/share/server/core/classes/objects/NagVisMapObj.php 
b/share/server/core/classes/objects/NagVisMapObj.php
index c401cc3..10ddfe2 100644
--- a/share/server/core/classes/objects/NagVisMapObj.php
+++ b/share/server/core/classes/objects/NagVisMapObj.php
@@ -255,7 +255,9 @@ class NagVisMapObj extends NagVisStatefulObject {
                        // The states of the map objects members only need to 
be fetched when this
                        // is MapObj is used as a view.
                        if($this->isView == false) {
-                               $OBJ->fetchState(DONT_GET_SINGLE_MEMBER_STATES);
+                               // Get the summary state of the host but not 
the single member states
+                               // Not needed cause no hover menu is displayed 
for this
+                               $OBJ->fetchState(GET_STATE, 
DONT_GET_SINGLE_MEMBER_STATES);
                        } else {
                                $OBJ->fetchState();
                        }
diff --git a/share/server/core/classes/objects/NagVisStatefulObject.php 
b/share/server/core/classes/objects/NagVisStatefulObject.php
index faba25d..f7383af 100644
--- a/share/server/core/classes/objects/NagVisStatefulObject.php
+++ b/share/server/core/classes/objects/NagVisStatefulObject.php
@@ -607,16 +607,16 @@ class NagVisStatefulObject extends NagVisObject {
                        if(isset($stateWeight[$this->summary_state])) {
                                $sCurrSubState = 'normal';
                                
-                               if($this->getSummaryAcknowledgement() == 1 && 
isset($stateWeight[$sSummaryState]['ack'])) {
+                               if($this->getSummaryAcknowledgement() == 1 && 
isset($stateWeight[$this->summary_state]['ack'])) {
                                        $sCurrSubState = 'ack';
-                               } elseif($this->getSummaryInDowntime() == 1 && 
isset($stateWeight[$sSummaryState]['downtime'])) {
+                               } elseif($this->getSummaryInDowntime() == 1 && 
isset($stateWeight[$this->summary_state]['downtime'])) {
                                        $sCurrSubState = 'downtime';
                                }
                                
                                $currWeight = 
$stateWeight[$this->summary_state][$sCurrSubState];
                        } else {
                                // Error handling: Invalid state
-                               new GlobalMessage('ERROR', 
GlobalCore::getInstance()->getLang()->getText('Invalid state+substate ([STATE], 
[SUBSTATE]) found on state comparision.', Array('STATE' => $sSummaryState, 
'SUBSTATE' => $sCurrSubState)));
+                               new GlobalMessage('ERROR', 
GlobalCore::getInstance()->getLang()->getText('Invalid state+substate ([STATE], 
[SUBSTATE]) found while loading the current summary state of an object of type 
[TYPE].', Array('STATE' => $this->summary_state, 'SUBSTATE' => $sCurrSubState, 
'TYPE' => $this->getType())));
                        }
                }
                
@@ -658,7 +658,7 @@ class NagVisStatefulObject extends NagVisObject {
                                                }
                                        } else {
                                                //Error handling: Invalid 
state+substate
-                                               new GlobalMessage('ERROR', 
GlobalCore::getInstance()->getLang()->getText('Invalid state+substate ([STATE], 
[SUBSTATE]) found on state comparision.', Array('STATE' => $sState, 'SUBSTATE' 
=> $sSubState)));
+                                               new GlobalMessage('ERROR', 
GlobalCore::getInstance()->getLang()->getText('Invalid state+substate ([STATE], 
[SUBSTATE]) found on state comparision in an object of type [TYPE] named 
[NAME].', Array('STATE' => $sState, 'SUBSTATE' => $sSubState, 'TYPE' => 
$this->getType(), 'NAME' => $this->getName())));
                                        }
                                }
                        }


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to