* * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ /** * Export Vcard * * guest * * @since 2004-09-15 * @author Christian Ehret <*****@*****.**> */ include_once "../includes/default.inc.php"; $filename = $request->GetVar('lastname', 'get') . $request->GetVar('firstname', 'get'); header("Content-type: text/directory"); header("Content-Disposition: attachment; filename=" . $filename . ".vcf"); header("Pragma: public"); $auth->is_authenticated(); include_once "guestclass.inc.php"; include_once "vcardclass.inc.php"; $guest = new Guest(); $vcard = new Vcard(); $vcard->fetch($guest->getGuest($request->GetVar('guestid', 'get'))); ?>
/** * Return a sample VCard for testing. */ public function getJohnDoe() { $inputs = $this->getJohnDoeInputs(); $vcard = new VCard(); $vcard->setUID('urn:uuid:090301ca-97aa-11e4-83c8-40167e365cc1'); VCard::builder('n')->setValue($inputs['n'])->pushTo($vcard); VCard::builder('fn')->setValue($inputs['fn'])->pushTo($vcard); VCard::builder('tel')->setValue($inputs['tel1'])->setTypes($inputs['tel1_type'])->pushTo($vcard)->setValue($inputs['tel2'])->setTypes($inputs['tel2_type'])->pushTo($vcard)->setValue($inputs['tel3'])->setTypes($inputs['tel3_type'])->pushTo($vcard); Vcard::builder('email')->setValue($inputs['email1'])->setTypes($inputs['email1_type'])->setPref($inputs['email1_pref'])->pushTo($vcard); Vcard::builder('email')->setValue($inputs['email2'])->setTypes($inputs['email2_type'])->pushTo($vcard); VCard::builder('adr')->setValue($inputs['adr'])->setTypes($inputs['adr_type'])->pushTo($vcard); VCard::builder('url')->setValue($inputs['url'])->pushTo($vcard); VCard::builder('photo')->setValue($inputs['photo'])->setMediaType($inputs['photo_mediatype'])->setValueType($inputs['photo_value'])->pushTo($vcard); return $vcard; }