--- vcard.module 2009-10-21 02:59:09.000000000 -0700 +++ vcard_new.module 2010-08-13 12:04:56.000000000 -0700 @@ -135,9 +135,14 @@ function vcard_get($uid) { $account = user_load(array('uid' => $uid)); $vcard = _vcard_init(); + $full = vcard_get_field('fullname', $account); $first = vcard_get_field('givenname', $account); - $last = vcard_get_field('familyname', $account); - if (!empty($first) && !empty($last)) { + $last = vcard_get_field('familyname', $account); + if (isset($full)) { + $vcard->setName('', $full, '', '', ''); + $vcard->setFormattedName($full); + } + elseif (!empty($first) && !empty($last)) { $vcard->setName($last, $first, '', '', ''); $vcard->setFormattedName($first .' '. $last); } @@ -175,10 +180,18 @@ function vcard_get($uid) { $vcard->setURL($url); } - // Telephone - $tel = vcard_get_field('telephone', $account); + // Home telephone + $tel = vcard_get_field('home telephone', $account); + if (!empty($tel)) { + $vcard->addTelephone($tel); + $vcard->addParam('TYPE', 'home'); + } + + // Work telephone + $tel = vcard_get_field('work telephone', $account); if (!empty($tel)) { $vcard->addTelephone($tel); + $vcard->addParam('TYPE', 'work'); } // Address @@ -245,17 +258,19 @@ function _vcard_init() { */ function _vcard_properties() { return array( - 'givenname' => t('Given Name'), - 'familyname' => t('Family name'), - 'birthday' => t('Birthday'), - 'organization' => t('Organization'), - 'telephone' => t('Telephone'), - 'url' => t('URL'), - 'street' => t('Street'), - 'city' => t('City'), - 'postal' => t('Postal'), - 'province' => t('Province'), - 'country' => t('Country'), + 'fullname' => t('Full name'), + 'givenname' => t('Given name'), + 'familyname' => t('Family name'), + 'birthday' => t('Birthday'), + 'organization' => t('Organization'), + 'home telephone' => t('Home telephone'), + 'work telephone' => t('Work telephone'), + 'url' => t('URL'), + 'street' => t('Street'), + 'city' => t('City'), + 'postal' => t('Postal'), + 'province' => t('Province'), + 'country' => t('Country'), ); } @@ -313,9 +328,16 @@ function theme_vcard($account) { } // name + $fullname = vcard_get_field('fullname', $account); $firstname = vcard_get_field('givenname', $account); - $lastname = vcard_get_field('familyname', $account); - if ($firstname && $lastname) { + $lastname = vcard_get_field('familyname', $account); + if ($fullname) { + $name = '