X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fvcard.inc.php;h=ddbc4dd4bf5736ed8dcfcb5605f751b09d81a33a;hb=d2100923749766ffcf61745b0145cf82a3886716;hp=1b67aee77de0c126e2840a0720ebe5ccfb4d08aa;hpb=32742f846e13a7806dde6b7b912c423a46f933d8;p=platal.git diff --git a/include/vcard.inc.php b/include/vcard.inc.php index 1b67aee..ddbc4dd 100644 --- a/include/vcard.inc.php +++ b/include/vcard.inc.php @@ -111,24 +111,26 @@ class VCard extends PlVCard } // 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']); + 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']); + } } }