Show
Ignore:
Timestamp:
02/25/10 15:56:33 (2 years ago)
Author:
gbastien
Message:
  • Added possibility to have a deployed geolocated node not show on map (quick fix) (#706)
  • When producing anonymised data export, two files are produced, one for the geolocated nodes and one for the connections (#705)
  • Additions and bug fixes to web service: can now logout and auth returns both error code and message
  • Starting work on #707 as needed
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/classes/Node.php

    r1444 r1453  
    825825        $this->refresh(); 
    826826    } 
    827  
     827     
     828    /** 
     829     * Returns whether the node should be shown on a map or is invisible 
     830     * 
     831     */ 
     832 
     833    public function showOnMap() 
     834    { 
     835        return (($this->_row['show_node_on_map'] == 't') ? true : false); 
     836    } 
     837 
     838    /** Set if this node be shown on map 
     839     * @param $value The new value, true or false 
     840     * @return true on success, false on failure */ 
     841    function setShowOnMap($value) 
     842    { 
     843        $retval = true; 
     844        if ($value != $this->showOnMap()) 
     845        { 
     846            $db = AbstractDb::getObject(); 
     847            $value ? $value = 'TRUE' : $value = 'FALSE'; 
     848            $retval = $db->execSqlUpdate("UPDATE nodes SET show_node_on_map = {$value} WHERE node_id = '{$this->getId()}'", false); 
     849            $this->refresh(); 
     850        } 
     851        return $retval; 
     852    } 
     853     
    828854    public function getCivicNumber() 
    829855    { 
     
    13071333        $_data = InterfaceElements::generateInputText("node_" . $node_id . "_map_url", $this->getMapURL(), "node_map_url_input"); 
    13081334        $_html_node_gis_data[] = InterfaceElements::generateAdminSectionContainer("node_map_url", $_title, $_data); 
     1335         
     1336        $_title = _("Show node on map"); 
     1337        $help = _("Should this node be visible on the map when deployed?"); 
     1338        $_data = InterfaceElements::generateInputCheckbox("node_" . $node_id . "_show_on_map", "", _("Yes"), $this->showOnMap(), "node_show_on_map_input"); 
     1339        $_html_node_gis_data[] = InterfaceElements::generateAdminSectionContainer("node_show_on_map", $_title, $_data, $help); 
    13091340 
    13101341        // Build section 
     
    15091540            $this->setGisLocation(new GisPoint($_REQUEST[$gis_lat_name], $_REQUEST[$gis_long_name], .0)); 
    15101541        } 
     1542         
     1543        $name = "node_".$node_id."_show_on_map"; 
     1544        $this->setShowOnMap(empty ($_REQUEST[$name]) ? false : true); 
    15111545 
    15121546        // Statistics