Fixes time saving and uses CRLF in address text because of RFC 1738.
authorStéphane Jacob <jacou@melix.net>
Mon, 13 Apr 2009 10:46:47 +0000 (12:46 +0200)
committerStéphane Jacob <jacou@melix.net>
Mon, 13 Apr 2009 10:46:47 +0000 (12:46 +0200)
include/geocoding.inc.php
modules/profile/addresses.inc.php
upgrade/newdirectory-0.0.1/15_addresses.sql

index cb27635..2e99434 100644 (file)
@@ -337,7 +337,12 @@ class GMapsGeocoder extends Geocoder {
             $address['text'] = $address['geoloc'];
             $address['postalText'] = $address['geocodedPostalText'];
             unset($address['geoloc'], $address['geocodedPostalText']);
+        } else {
+            $address['geoloc'] = str_replace("\n", "\r\n", $address['geoloc']);
+            $address['geocodedPostalText'] = str_replace("\n", "\r\n", $address['geocodedPostalText']);
         }
+        $address['text'] = str_replace("\n", "\r\n", $address['text']);
+        $address['postalText'] = str_replace("\n", "\r\n", $address['postalText']);
     }
  
     // Returns the address formated for postal use.
index c6cb2c2..a59fa30 100644 (file)
@@ -164,7 +164,7 @@ class ProfileAddresses extends ProfilePage
     {
         $res = XDB::query("SELECT  id, accuracy, text, postalText,
                                    postalCode, localityId, subAdministrativeAreaId, administrativeAreaId,
-                                   countryId, latitude, longitude, pub, comment, updateTime,
+                                   countryId, latitude, longitude, pub, comment, UNIX_TIMESTAMP(updateTime) AS updateTime,
                                    north, south, east, west,
                                    FIND_IN_SET('current', flags) AS current,
                                    FIND_IN_SET('temporary', flags) AS temporary,
index d0c128e..2311f47 100644 (file)
@@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS profile_addresses (
   south FLOAT(10,7) DEFAULT NULL,
   east FLOAT(10,7) DEFAULT NULL,
   west FLOAT(10,7) DEFAULT NULL,
-  updateTime DATE NOT NULL DEFAULT 0,
+  updateTime DATETIME NOT NULL DEFAULT 0,
   pub ENUM('public','ax','private') NOT NULL DEFAULT 'private',
   comment VARCHAR(255) DEFAULT NULL,
   PRIMARY KEY(pid, jobid, type, id),