X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Faddresses.inc.php;h=49b7f959777569062e395e764e8abc8e7441e611;hb=98e827e273c7c5e473c0c8a4839efc4c5bb1225b;hp=5388595b67515e05738f9528850995dec6697fab;hpb=73f6c16524535d2bab4cbc2334b9d105e927bce1;p=platal.git diff --git a/modules/profile/addresses.inc.php b/modules/profile/addresses.inc.php index 5388595..49b7f95 100644 --- a/modules/profile/addresses.inc.php +++ b/modules/profile/addresses.inc.php @@ -93,7 +93,7 @@ class ProfileAddress extends ProfileGeocoding format_phone_number($tel['tel']), $tel['tel'], $tel['pub']); } - private function saveAddress($addrid, array &$address) + public function saveAddress($addrid, array &$address, $type) { require_once "geocoding.inc.php"; @@ -123,10 +123,10 @@ class ProfileAddress extends ProfileGeocoding subAdministrativeAreaId, administrativeAreaId, countryId, latitude, longitude, updateTime, pub, comment, north, south, east, west) - VALUES ({?}, 'home', {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, + VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, FROM_UNIXTIME({?}), {?}, {?}, {?}, {?}, {?}, {?})", - S::i('uid'), $addrid, $flags, $address['accuracy'], - $address['text'], 'postalText'/*$address['postalText']*/, $address['postalCode'], $address['localityId'], + S::i('uid'), $type, $addrid, $flags, $address['accuracy'], + $address['text'], $address['postalText'], $address['postalCode'], $address['localityId'], $address['subAdministrativeAreaId'], $address['administrativeAreaId'], $address['countryId'], $address['latitude'], $address['longitude'], $address['updateTime'], $address['pub'], $address['comment'], @@ -142,7 +142,7 @@ class ProfileAddress extends ProfileGeocoding WHERE uid = {?} AND link_type = 'address'", S::i('uid')); foreach ($value as $addrid => &$address) { - $this->saveAddress($addrid, $address); + $this->saveAddress($addrid, $address, 'home'); $profiletel = new ProfilePhones('address', $addrid); $profiletel->saveTels('tel', $address['tel']); } @@ -162,7 +162,7 @@ class ProfileAddresses extends ProfilePage protected function _fetchData() { - $res = XDB::query("SELECT type, id, accuracy, text, postalText, + $res = XDB::query("SELECT id, accuracy, text, postalText, postalCode, localityId, subAdministrativeAreaId, administrativeAreaId, countryId, latitude, longitude, pub, comment, updateTime, north, south, east, west,