Module: nagvis Branch: master Commit: 2a9f5fe1ad6621e785d3f2fb76c974067ccd55ec URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=2a9f5fe1ad6621e785d3f2fb76c974067ccd55ec
Author: Roman Kyrylych <[email protected]> Date: Thu Jul 30 13:18:39 2009 +0300 gmap: Make adding a location from UI to actually work Signed-off-by: Roman Kyrylych <[email protected]> --- share/netmap/Location.php | 21 ++++++++++----------- uifx/src/modules/gmap/DialogLocation.mxml | 8 ++++---- uifx/src/modules/gmap/GMapModule.as | 3 ++- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/share/netmap/Location.php b/share/netmap/Location.php index ff024eb..f1c8729 100644 --- a/share/netmap/Location.php +++ b/share/netmap/Location.php @@ -120,33 +120,32 @@ class Location // Note: @ prevents warnings when attribute value is an empty string $object_node = $node->addChild($objectType); - switch ($object_type) + switch ($objectType) { case 'host': - $object_node->addAttribute('name', $object['name']); - @$object_node->addAttribute('address', $object['address']); - @$object_node->addAttribute('alias', $object['alias']); + $object_node->addAttribute('name', $object->name); + @$object_node->addAttribute('address', $object->address); + @$object_node->addAttribute('alias', $object->alias); break; case 'hostgroup': - $object_node->addAttribute('name', $object['name']); - @$object_node->addAttribute('alias', $object['alias']); + $object_node->addAttribute('name', $object->name); + @$object_node->addAttribute('alias', $object->alias); break; case 'service': - $object_node->addAttribute('host', $object['host']); - @$object_node->addAttribute('description', $object['description']); + $object_node->addAttribute('host', $object->host); + @$object_node->addAttribute('description', $object->description); break; case 'servicegroup': - $object_node->addAttribute('name', $object['name']); - @$object_node->addAttribute('alias', $object['alias']); + $object_node->addAttribute('name', $object->name); + @$object_node->addAttribute('alias', $object->alias); break; default: throw new Exception('Cannot save unknown object type'); } - } $location = new Location($id, $point, $label, $address, $description, $object, $objectType); diff --git a/uifx/src/modules/gmap/DialogLocation.mxml b/uifx/src/modules/gmap/DialogLocation.mxml index aff9f50..e23b29f 100644 --- a/uifx/src/modules/gmap/DialogLocation.mxml +++ b/uifx/src/modules/gmap/DialogLocation.mxml @@ -167,10 +167,10 @@ <mx:Spacer/> <mx:ComboBox id="locNObjectType" selectedIndex="2" width="100%" change="onObjectTypeChange()"> <mx:ArrayCollection> - <mx:String>Host</mx:String> - <mx:String>Service</mx:String> - <mx:String>Host Group</mx:String> - <mx:String>Service Group</mx:String> + <mx:Object label="Host" value="host"/> + <mx:Object label="Service" value="service"/> + <mx:Object label="Host Group" value="hostgroup"/> + <mx:Object label="Service Group" value="servicegroup"/> </mx:ArrayCollection> </mx:ComboBox> <mx:Spacer/> diff --git a/uifx/src/modules/gmap/GMapModule.as b/uifx/src/modules/gmap/GMapModule.as index 72fcfbe..5fdd92c 100644 --- a/uifx/src/modules/gmap/GMapModule.as +++ b/uifx/src/modules/gmap/GMapModule.as @@ -379,7 +379,8 @@ private function onSaveLocation() : void else { rLocations.add((new LatLng(parseFloat(locationBox.locLat.text), parseFloat(locationBox.locLng.text)).toUrlValue(16)), - locationBox.locName.text, locationBox.locAddress.text, locationBox.locDescription.text); + locationBox.locName.text, locationBox.locAddress.text, locationBox.locDescription.text, + locationBox.locNObject.selectedItem, locationBox.locNObjectType.selectedItem.value); } } ------------------------------------------------------------------------------ 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
