$AppUI->redirect('m=public&a=access_denied'); } if ($contact_id) { $contact = new CContact(); $contact->loadFull($AppUI, $contact_id); // include PEAR vCard class require_once $AppUI->getLibraryClass('PEAR/Contact_Vcard_Build'); // instantiate a builder object // (defaults to version 3.0) $vcard = new Contact_Vcard_Build(); // set a formatted name $vcard->setFormattedName($contact->contact_first_name . ' ' . $contact->contact_last_name); // set the structured name parts $vcard->setName($contact->contact_last_name, $contact->contact_first_name, $contact->contact_type, $contact->contact_title, ''); // set the source of the vCard $vcard->setSource($w2Pconfig['company_name'] . ' ' . $w2Pconfig['page_title'] . ': ' . $w2Pconfig['site_domain']); // set the birthday of the contact $vcard->setBirthday($contact->contact_birthday); // set a note of the contact $contact->contact_notes = mb_str_replace("\r", ' ', $contact->contact_notes); $vcard->setNote($contact->contact_notes); // add an organization $vcard->addOrganization($contact->company_name); // add dp company id $vcard->setUniqueID($contact->contact_company); // add a phone number $vcard->addTelephone($contact->contact_phone); $vcard->addParam('TYPE', 'PF'); // add a phone number $vcard->addTelephone($contact->contact_phone2); // add a mobile phone number