X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=upgrade%2F1.0.1%2Fphone.php;h=39466192e889ab29a916826c274506ffa7dad612;hb=3095cd657bf45cad1a487bc584d3a32a840868e7;hp=4239ece4345b88160041bed52fea00b0ec557776;hpb=1c0419d6b4c94643bfa7bed9a6b435bbdbbae02f;p=platal.git diff --git a/upgrade/1.0.1/phone.php b/upgrade/1.0.1/phone.php index 4239ece..3946619 100755 --- a/upgrade/1.0.1/phone.php +++ b/upgrade/1.0.1/phone.php @@ -54,5 +54,19 @@ foreach ($phones as $country => $phone) { $phone, $country); } +$res = XDB::iterator('SELECT pid, link_type, link_id, tel_id AS id, search_tel AS search, search_tel AS display + FROM profile_phones + WHERE search_tel LIKE \'33%\''); +while ($item = $res->next()) { + $phone = new Phone($item); + $phone->format(); + XDB::execute('UPDATE profile_phones + SET display_tel = {?} + WHERE pid = {?} AND link_type = {?} + AND link_id = {?} AND tel_id = {?}', + $phone->display, $phone->pid(), $phone->linkType(), + $phone->linkId(), $phone->id()); +} + /* vim:set et sw=4 sts=4 ts=4: */ ?>