X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Faddresses.inc.php;h=2bc00b22c9340abff2569508cbbbe7a9ab543a0b;hb=184b012d1fb4d02b6f5e5ed9e11fcd6457a36b06;hp=3105bf1b2a083fb296319e2a5e5713ea18cc742f;hpb=d2100923749766ffcf61745b0145cf82a3886716;p=platal.git diff --git a/modules/profile/addresses.inc.php b/modules/profile/addresses.inc.php index 3105bf1..2bc00b2 100644 --- a/modules/profile/addresses.inc.php +++ b/modules/profile/addresses.inc.php @@ -1,6 +1,6 @@ pid()); XDB::execute("DELETE FROM profile_phones - WHERE uid = {?} AND link_type = 'address'", + WHERE pid = {?} AND link_type = 'address'", $page->pid()); foreach ($value as $addrid => &$address) { - $this->saveAddress($page->pid(), $addrid, $address); + $this->saveAddress($page->pid(), $addrid, $address, 'home'); $profiletel = new ProfilePhones('address', $addrid); $profiletel->saveTels($page->pid(), 'tel', $address['tel']); } @@ -142,9 +142,9 @@ 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, + 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, @@ -163,7 +163,7 @@ class ProfileAddresses extends ProfilePage $res = XDB::iterator("SELECT link_id AS addrid, tel_type AS type, pub, display_tel AS tel, comment FROM profile_phones - WHERE uid = {?} AND link_type = 'address' + WHERE pid = {?} AND link_type = 'address' ORDER BY link_id", $this->pid()); $i = 0; @@ -187,9 +187,18 @@ class ProfileAddresses extends ProfilePage } foreach ($this->values['addresses'] as $id => &$address) { if (!isset($address['tel'])) { - $address['tel'] = array(); + $address['tel'] = array( + 0 => array( + 'type' => 'fixed', + 'tel' => '', + 'pub' => 'private', + 'comment' => '', + ) + ); } unset($address['id']); + $address['changed'] = 0; + $address['removed'] = 0; } } }