diff --git a/src/forms/static/vcard.php b/src/forms/static/vcard.php index 79b89d4..6a042b0 100644 --- a/src/forms/static/vcard.php +++ b/src/forms/static/vcard.php @@ -138,7 +138,14 @@ - + +
+
+ + +
+
+ diff --git a/src/lib/StaticQrcode/StaticQrcode.php b/src/lib/StaticQrcode/StaticQrcode.php index 04ebb53..68fd0ce 100644 --- a/src/lib/StaticQrcode/StaticQrcode.php +++ b/src/lib/StaticQrcode/StaticQrcode.php @@ -171,7 +171,7 @@ class StaticQrcode { * create a qr code of type "vcard" * */ - public function vcardQrcode($fullname, $nickname, $email, $website, $phone, $home_phone, $work_phone, $company, $role, $categories, $note, $photo, $address, $city, $postcode, $state) + public function vcardQrcode($fullname, $nickname, $email, $website, $phone, $home_phone, $work_phone, $company, $role, $categories, $note, $photo, $address, $city, $postcode, $state, $country) { if($fullname != NULL && $phone != NULL){ @@ -188,7 +188,7 @@ class StaticQrcode { $vcard->categories($categories); $vcard->note($note); $vcard->photo($photo); - $vcard->address($address, $city, $postcode, $state); + $vcard->address($address, $city, $state, $postcode, $country); $vcard->create(); $this->sData = $vcard->get(); @@ -202,7 +202,7 @@ class StaticQrcode { $this->sContent .= '
'; - $this->sContent .= 'Phone: '.$phone.'
'.'Home Phone: '.$home_phone.'
'.'Work phone: '.$work_phone.'
'.'Address: '.$address.' '.$city.' '.$postcode.' '.$state.'
'; + $this->sContent .= 'Phone: '.$phone.'
'.'Home Phone: '.$home_phone.'
'.'Work phone: '.$work_phone.'
'.'Address: '.$address.' '.$city.' '.$postcode.' '.$state.' '.$country.''; $this->sContent .= ''; diff --git a/src/lib/vCard/vCard.php b/src/lib/vCard/vCard.php index f95589c..17d7dd7 100644 --- a/src/lib/vCard/vCard.php +++ b/src/lib/vCard/vCard.php @@ -43,10 +43,11 @@ class vCard * * @return self */ - public function address($sAddress, $sCity, $sPostcode, $sState) + public function address($sAddress, $sCity, $sState, $sPostcode, $sCountry) { + // Component order per vCard 4.0 ADR: pobox;ext;street;locality;region;code;country $this->sData .= 'ADR:;;'.$sAddress.';'; - $this->sData .= $sCity.';'.$sPostcode.';'.$sState."\n"; + $this->sData .= $sCity.';'.$sState.';'.$sPostcode.';'.$sCountry."\n"; return $this; } diff --git a/src/static_qrcode.php b/src/static_qrcode.php index dca4c3f..07b5f9d 100644 --- a/src/static_qrcode.php +++ b/src/static_qrcode.php @@ -65,7 +65,7 @@ if($_SERVER["REQUEST_METHOD"] === "POST" && !isset($_POST["edit"]) && !isset($_P case 'location': $static_qrcode_instance->locationQrcode($_POST['latitude'], $_POST['longitude']); break; - case 'vcard': $static_qrcode_instance->vcardQrcode($_POST['full_name'], $_POST['nickname'], $_POST['email'], $_POST['website'], $_POST['phone'], $_POST['home_phone'], $_POST['work_phone'], $_POST['company'], $_POST['role'], $_POST['categories'], $_POST['note'], $_POST['photo'], $_POST['address'], $_POST['city'], $_POST['post_code'], $_POST['state']); + case 'vcard': $static_qrcode_instance->vcardQrcode($_POST['full_name'], $_POST['nickname'], $_POST['email'], $_POST['website'], $_POST['phone'], $_POST['home_phone'], $_POST['work_phone'], $_POST['company'], $_POST['role'], $_POST['categories'], $_POST['note'], $_POST['photo'], $_POST['address'], $_POST['city'], $_POST['post_code'], $_POST['state'], $_POST['country']); break; case 'event': $static_qrcode_instance->eventQrcode($_POST['title'], $_POST['start'], $_POST['end'], $_POST['timezone'], $_POST['location'], $_POST['description'], $_POST['url']);