X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvcard.inc.php;h=dfdadaad4113b9903a49de47fe3fc46b49318ab8;hb=2553b7686e0678b8e27858a7c377e73ecb410aec;hp=844d45f9e811d1b3e7b171a88c26d4c37f212714;hpb=90c614cd296ec8ead5b30e28ab7d44e9d49fcc4a;p=platal.git diff --git a/include/vcard.inc.php b/include/vcard.inc.php index 844d45f..dfdadaa 100644 --- a/include/vcard.inc.php +++ b/include/vcard.inc.php @@ -1,6 +1,6 @@ addWork($pro['entreprise'], null, $pro['poste'], $pro['fonction'], - $street, null, null, $pro['postcode'], $pro['city'], $pro['region'], @$pro['country']); - if (!empty($pro['tel'])) { - $entry->addTel($group, $pro['tel']); - } - if (!empty($pro['fax'])) { - $entry->addTel($group, $pro['fax'], true); - } - if (!empty($pro['email'])) { - $entry->addMail($group, $pro['email']); + if (!empty($user['adr_pro'])) { + foreach ($user['adr_pro'] as $pro) { + $street = array($adr['adr1']); + if (!empty($pro['adr2'])) { + $street[] = $pro['adr2']; + } + if (!empty($pro['adr3'])) { + $street[] = $pro['adr3']; + } + $group = $entry->addWork($pro['entreprise'], null, $pro['poste'], $pro['fonction'], + $street, null, null, $pro['postcode'], $pro['city'], $pro['region'], @$pro['country']); + if (!empty($pro['tel'])) { + $entry->addTel($group, $pro['tel']); + } + if (!empty($pro['fax'])) { + $entry->addTel($group, $pro['fax'], true); + } + if (!empty($pro['email'])) { + $entry->addMail($group, $pro['email']); + } } } @@ -163,7 +165,7 @@ class VCard extends PlVCard $res = XDB::query( "SELECT attach, attachmime FROM photo AS p - WHERE u.user_id = {?}", $login->id()); + WHERE p.uid = {?}", $login->id()); if ($res->numRows()) { list($data, $type) = $res->fetchOneRow(); $entry->setPhoto($data, strtoupper($type));