- 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);
- }
+ $adrs = $pf->iterAddresses(Profile::ADDRESS_PRO);
+ while ($adr = $adrs->next()) {
+ // TODO : link address to company
+ $group = $entry->addWork(null, null, null, null,
+ $adr['text'], null, null, $adr['postalCode'],
+ $adr['locality'], $adr['administrativeArea'], $adr['country']);
+ if (!empty($adr['fixed_tel'])) {
+ $entry->addTel($group, $adr['fixed_tel']);
+ }
+ if (!empty($adr['fax_tel'])) {
+ $entry->addTel($group, $adr['display_tel'], true);
+ }
+ /* TODO : fetch email for jobs, too