Changeset 1140

Show
Ignore:
Timestamp:
11/24/06 11:07:33 (7 years ago)
Author:
benoitg
Message:
  • Make the google-map locator for nodes use the network center coordinates. This change makes it usable when you didn't use the geocoder first.
Location:
trunk/wifidog-auth
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/CHANGELOG

    r1139 r1140  
    112006-11-23 Benoit Grégoire  <bock@step.polymtl.ca> 
    2         * Fix bug un node creation 
     2        * Fix bug in node creation 
     3        * Add error message for geooder wwhen you didn't set the country 
     4        * Clarify error messages and description for the geocoder. 
     5        * Make the google-map locator for nodes use the network center coordinates. 
     6          This change makes it usable when you didn't use the geocoder first.  
    37         
    482006-11-22 Benoit Grégoire  <bock@step.polymtl.ca> 
  • trunk/wifidog-auth/wifidog/admin/hotspot_location_map.php

    r1131 r1140  
    7373    $ui->addContent('main_area_middle', $html); 
    7474 
    75     if($node->getGisLocation() !== null) 
    76     { 
    77         $lat = $node->getGisLocation()->getLatitude(); 
    78         $long = $node->getGisLocation()->getLongitude(); 
     75    if(($gisLocation = $node->getGisLocation()) !== null && $gisLocation->getLatitude() != null) { 
     76    } 
     77    elseif(($gisLocation = $node->getNetwork()->getGisLocation()) !== null && $gisLocation->getLatitude() != null) { 
     78    } 
     79    else { 
     80         $html .= "<div class='error'>"._("Error:  You need to set the GIS coordinates of the center of your network")."</div\n"; 
     81        $gisLocation = null; 
     82    } 
     83    if($gisLocation !== null) 
     84    {//pretty_print_r($gisLocation); 
     85        $lat = $gisLocation->getLatitude(); 
     86        $long = $gisLocation->getLongitude(); 
    7987    } 
    8088    else 
     
    94102    $script .= "var current_marker = new GMarker(current_marker_point);\n"; 
    95103    $script .= "map.addOverlay(current_marker);\n"; 
    96     $gis_lat_name = "node_" . md5($node->getId()) ."_gis_latitude"; 
    97     $gis_long_name = "node_" . md5($node->getId()) . "_gis_longitude"; 
     104    $gis_lat_name = "node_" . $node->getId() ."_gis_latitude"; 
     105    $gis_long_name = "node_" . $node->getId() . "_gis_longitude"; 
    98106    $script .= "function setLocationInOriginalWindow() {\n"; 
    99107    $script .= "  window.opener.document.getElementById(\"$gis_lat_name\").value = current_marker_point.y;\n"; 
  • trunk/wifidog-auth/wifidog/classes/Node.php

    r1139 r1140  
    988988                // Call the geocoding service, if Google Maps is enabled then use Google Maps to let the user choose a more precise location 
    989989                if (defined('GMAPS_HOTSPOTS_MAP_ENABLED') && GMAPS_HOTSPOTS_MAP_ENABLED === true) { 
    990                     $_data  = InterfaceElements::generateInputSubmit("geocode_only", _("Geocode only"), "geocode_only_submit"); 
     990                    $_data  = InterfaceElements::generateInputSubmit("geocode_only", _("Geocode the address or postal code above"), "geocode_only_submit"); 
    991991                    $_data .= InterfaceElements::generateInputButton("google_maps_geocode", _("Check using Google Maps"), "google_maps_geocode_button", "submit", array("onclick" => "window.open('hotspot_location_map.php?node_id={$this->getId()}', 'hotspot_location', 'toolbar = 0, scrollbars = 1, resizable = 1, location = 0, statusbar = 0, menubar = 0, width = 600, height = 600');")); 
    992992                    $_data .= InterfaceElements::generateDiv("(" . _("Use a geocoding service, then use Google Maps to pinpoint the exact location.") . ")", "admin_section_hint", "node_gis_geocode_hint"); 
    993993                } else { 
    994                     $_data  = InterfaceElements::generateInputSubmit("geocode_only", _("Geocode location"), "geocode_only_submit"); 
     994                    $_data  = InterfaceElements::generateInputSubmit("geocode_only", _("Geocode the address or postal code above"), "geocode_only_submit"); 
    995995                    $_data .= InterfaceElements::generateDiv("(" . _("Use a geocoding service") . ")", "admin_section_hint", "node_gis_geocode_hint"); 
    996996                } 
     
    10881088        { 
    10891089                $user = User::getCurrentUser(); 
    1090  
     1090//pretty_print_r($_REQUEST); 
    10911091                if (!$this->isOwner($user) && !$user->isSuperAdmin()) { 
    10921092                        throw new Exception(_('Access denied!')); 
     
    11941194                                        $this->_warningMessage = _("You must enter a valid address."); 
    11951195                        } 
     1196            else 
     1197            { 
     1198                $this->_warningMessage = _("Unable to create geocoder.  Are you sure you set the country?"); 
     1199            } 
    11961200                } 
    11971201                else