From: Stéphane Jacob Date: Mon, 13 Apr 2009 10:46:47 +0000 (+0200) Subject: Fixes time saving and uses CRLF in address text because of RFC 1738. X-Git-Tag: xorg/1.0.0~332^2~313^2~11 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=eecbf7f5bd13ea323966881a3b34abe7eabaaf3f;p=platal.git Fixes time saving and uses CRLF in address text because of RFC 1738. --- diff --git a/include/geocoding.inc.php b/include/geocoding.inc.php index cb27635..2e99434 100644 --- a/include/geocoding.inc.php +++ b/include/geocoding.inc.php @@ -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. diff --git a/modules/profile/addresses.inc.php b/modules/profile/addresses.inc.php index c6cb2c2..a59fa30 100644 --- a/modules/profile/addresses.inc.php +++ b/modules/profile/addresses.inc.php @@ -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, diff --git a/upgrade/newdirectory-0.0.1/15_addresses.sql b/upgrade/newdirectory-0.0.1/15_addresses.sql index d0c128e..2311f47 100644 --- a/upgrade/newdirectory-0.0.1/15_addresses.sql +++ b/upgrade/newdirectory-0.0.1/15_addresses.sql @@ -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),