Fixes bugs in name edition.
[platal.git] / include / vcard.inc.php
index 9026171..2a1402a 100644 (file)
@@ -83,7 +83,7 @@ class VCard extends PlVCard
         }
 
         // Homes
-        $adrs = $pf->getAddresses(Profile::ADDRESS_PERSO);
+        $adrs = $pf->iterAddresses(Profile::ADDRESS_PERSO);
         while ($adr = $adrs->next()) {
             // TODO : find a way to fetch only the "street" part of the address
             $group = $entry->addHome($adr['text'], null, null, $adr['postalCode'],
@@ -98,7 +98,7 @@ class VCard extends PlVCard
         }
 
         // Pro
-        $adrs = $pf->getAddresses(Profile::ADDRESS_PRO);
+        $adrs = $pf->iterAddresses(Profile::ADDRESS_PRO);
         while ($adr = $adrs->next()) {
             // TODO : link address to company
             $group = $entry->addWork(null, null, null, null,
@@ -129,7 +129,6 @@ class VCard extends PlVCard
         if (!is_null($user)) {
             $groups = $user->groups();
             if (count($groups)) {
-                require_once "directory.enums.inc.php";
                 $gn = DirEnum::getOptions(DirEnum::GROUPESX);
                 $gns = array();
                 foreach (array_keys($groups) as $gid) {
@@ -142,7 +141,6 @@ class VCard extends PlVCard
         $binets = $pf->getBinets();
 
         if (count($binets)) {
-            require_once "directory.enums.inc.php";
             $bn = DirEnum::getOptions(DirEnum::BINETS);
             $bns = array();
             foreach ($binets as $bid) {
@@ -151,7 +149,6 @@ class VCard extends PlVCard
             $entry->set('X-BINETS', join(', ', $bid));
         }
         if (!empty($pf->section)) {
-            require_once "directory.enums.inc.php";
             $sections = DirEnum::getOptions(DirEnum::SECTIONS);
             $entry->set('X-SECTION', $sections[$pf->section]);
         }