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

Author: Lars Michelsen <[email protected]>
Date:   Wed Oct 27 20:40:42 2010 +0200

#382 NagVis map object states were not refreshed correctly

---

 share/server/core/classes/CoreModAutoMap.php |    2 +-
 share/server/core/classes/GlobalMapCfg.php   |   14 +++++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/share/server/core/classes/CoreModAutoMap.php 
b/share/server/core/classes/CoreModAutoMap.php
index dc5b35b..bf91628 100644
--- a/share/server/core/classes/CoreModAutoMap.php
+++ b/share/server/core/classes/CoreModAutoMap.php
@@ -205,7 +205,7 @@ class CoreModAutoMap extends CoreModule {
                $MAPCFG->filterMapObjects($aVals['t'], $aVals['i']);
 
 
-               $MAP = new NagVisAutoMap($this->CORE, $MAPCFG, $BACKEND, 
$this->opts, !IS_VIEW);
+               $MAP = new NagVisAutoMap($this->CORE, $MAPCFG, $BACKEND, 
$this->opts, IS_VIEW);
                $MAPOBJ = $MAP->MAPOBJ;
                return $MAP->parseObjectsJson($aVals['ty']);
        }
diff --git a/share/server/core/classes/GlobalMapCfg.php 
b/share/server/core/classes/GlobalMapCfg.php
index ab609cd..6da3846 100644
--- a/share/server/core/classes/GlobalMapCfg.php
+++ b/share/server/core/classes/GlobalMapCfg.php
@@ -2027,11 +2027,19 @@ class GlobalMapCfg {
                $numObjects = count($types);
                for($i = 0; $i < $numObjects; $i++) {
                        $type = $types[$i];
-                       $id   = $objIds[$i] - 1;
+                       $id   = $objIds[$i];
                        if(!isset($newConfig[$type]))
                                $newConfig[$type] = Array();
-                       if(isset($this->mapConfig[$type][$id]))
-                               $newConfig[$type][$id] = 
$this->mapConfig[$type][$id];
+
+                       $matchedTypeId = null;
+                       foreach($this->mapConfig[$type] AS $typeId => $opts) {
+                               if($opts['object_id'] == $id) {
+                                       $matchedTypeId = $typeId;
+                                       break;
+                               }
+                       }
+                       if($matchedTypeId !== null)
+                               $newConfig[$type][$matchedTypeId] = 
$this->mapConfig[$type][$matchedTypeId];
                }
                $this->mapConfig = $newConfig;
        }


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to