Module: nagvis Branch: master Commit: dc6ec398ef4c2b34df71a5b3f076252c9fec6d38 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=dc6ec398ef4c2b34df71a5b3f076252c9fec6d38
Author: Lars Michelsen <[email protected]> Date: Wed Dec 29 12:08:10 2010 +0100 Automap parameter modification dialog is working again --- .../nagvis-js/classes/FrontendModAutoMap.php | 2 +- share/server/core/classes/CoreModMap.php | 2 +- share/server/core/classes/GlobalMapCfg.php | 8 ++++++-- share/server/core/classes/NagVisAutomapCfg.php | 9 +++++---- share/server/core/classes/objects/NagVisHost.php | 2 +- .../core/classes/objects/NagVisStatefulObject.php | 3 +++ 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/share/frontend/nagvis-js/classes/FrontendModAutoMap.php b/share/frontend/nagvis-js/classes/FrontendModAutoMap.php index 11c0418..fed935a 100644 --- a/share/frontend/nagvis-js/classes/FrontendModAutoMap.php +++ b/share/frontend/nagvis-js/classes/FrontendModAutoMap.php @@ -115,7 +115,7 @@ class FrontendModAutoMap extends FrontendModule { $s .= '&'.$key.'='.$val; $MAPCFG->setValue(0, 'default_params', $s); - $MAPCFG->writeElement(0); + $MAPCFG->storeUpdateElement(0); } private function showViewDialog() { diff --git a/share/server/core/classes/CoreModMap.php b/share/server/core/classes/CoreModMap.php index c301535..9d99ec0 100644 --- a/share/server/core/classes/CoreModMap.php +++ b/share/server/core/classes/CoreModMap.php @@ -662,7 +662,7 @@ class CoreModMap extends CoreModule { } // write element to file - $MAPCFG->updateElement($a['id']); + $MAPCFG->storeUpdateElement($a['id']); // delete map lock if(!$MAPCFG->deleteMapLock()) { diff --git a/share/server/core/classes/GlobalMapCfg.php b/share/server/core/classes/GlobalMapCfg.php index f900e96..c6a0dc1 100644 --- a/share/server/core/classes/GlobalMapCfg.php +++ b/share/server/core/classes/GlobalMapCfg.php @@ -2211,9 +2211,13 @@ class GlobalMapCfg { * * @author Lars Michelsen <[email protected]> */ - public function updateElement($id) { + public function storeUpdateElement($id) { $type = $this->mapConfig[$id]['type']; - list($inObj, $start, $end) = $this->getObjectLinesById($id); + + if($id === 0) + list($inObj, $start, $end) = $this->getObjectLinesByNum(0); + else + list($inObj, $start, $end) = $this->getObjectLinesById($id); if(!$inObj) return false; diff --git a/share/server/core/classes/NagVisAutomapCfg.php b/share/server/core/classes/NagVisAutomapCfg.php index 2f31a4b..613ce57 100644 --- a/share/server/core/classes/NagVisAutomapCfg.php +++ b/share/server/core/classes/NagVisAutomapCfg.php @@ -77,9 +77,9 @@ class NagVisAutomapCfg extends GlobalMapCfg { if(!$this->defaultConf) { $this->defaultConf = Array(); - $ids = $this->loadObjIds(); - if(isset($ids['__dummy__'])) - $objectId = $ids['__dummy__']; + $keys = array_keys($this->getMapObjects()); + if(isset($keys[1])) + $objectId = $keys[1]; else return $this->defaultConf; @@ -104,7 +104,8 @@ class NagVisAutomapCfg extends GlobalMapCfg { return $this->defaultConf; } - public function writeElement($id) { } + public function storeAddElement($unused) { } + public function storeDeleteElement($unused, $unused1 = null) { } public function genObjIdAutomap($s) { return $this->genObjId($s); diff --git a/share/server/core/classes/objects/NagVisHost.php b/share/server/core/classes/objects/NagVisHost.php index c94f5ff..9a4e445 100644 --- a/share/server/core/classes/objects/NagVisHost.php +++ b/share/server/core/classes/objects/NagVisHost.php @@ -115,7 +115,7 @@ class NagVisHost extends NagiosHost { $strReturn .= 'color=black, '; $strReturn .= 'decorate=1, '; $strReturn .= 'style=solid, '; - if($this->line_arrow != 'none') + if(isset($this->line_arrow) && $this->line_arrow != 'none') $strReturn .= 'dir='.$this->line_arrow.', '; $strReturn .= 'weight=2 '; $strReturn .= ' ];'."\n "; diff --git a/share/server/core/classes/objects/NagVisStatefulObject.php b/share/server/core/classes/objects/NagVisStatefulObject.php index f02bf04..1a20202 100644 --- a/share/server/core/classes/objects/NagVisStatefulObject.php +++ b/share/server/core/classes/objects/NagVisStatefulObject.php @@ -40,6 +40,9 @@ class NagVisStatefulObject extends NagVisObject { protected $label_show; protected $recognize_services; protected $only_hard_states; + + protected $line_type; + protected $line_arrow = 'none'; protected $state; protected $output; ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
