PDA

View Full Version : QR Code for contacts


aronallenson
June 8th, 2011, 08:11 AM
When creating a QR code for contacts, there is a property field called "TEL:"
In the vCard spec there are some parameters that can go with the TEL property such as.

TEL;WORK;VOICE:(111) 222-2222
TEL;HOME;VOICE:(222) 222-2222
TEL;CELL;VOICE:444-444-44444
TEL;WORK;FAX:(333) 333-3333

When I try to use these I get the following error.

SyntaxError: missing : after property ID

How can I specify the telephone number type in the QR code?

Dan Korn
June 8th, 2011, 09:08 AM
Can you please post the JavaScript code that's generating the error?

Here's an example of a rule which outputs a QR code with vCard contact info:
http://forums.printable.com/showpost.php?p=7336&postcount=3

Also, the upcoming FusionPro 7.2 release will include a built-in template rule to encode a QR barcode with vCard contact info as a graphic.

aronallenson
June 8th, 2011, 11:15 AM
Great, thanks.
That was the answer.
When using the parameters, I need to put them inside quotes.

scubajbc
June 8th, 2011, 11:20 AM
Also, the upcoming FusionPro 7.2 release will include a built-in template rule to encode a QR barcode with vCard contact info as a graphic.

Is there any timeframe for FusionPro 7.2 yet?

Dan Korn
June 8th, 2011, 11:56 AM
Is there any timeframe for FusionPro 7.2 yet?
It's in final QA testing right now. I would expect it to be released within the week.

Dan Korn
June 8th, 2011, 12:15 PM
Great, thanks.
That was the answer.
When using the parameters, I need to put them inside quotes.
Right, in code like this:
var info = {
// ADD OR REMOVE FIELDS HERE TO MATCH YOUR DATA
N: FieldOrRule("QR Contact Name"),
"TEL;WORK;VOICE": FieldOrRule("QR Phone").replace(/\D/g,''),
"TEL;WORK;FAX": FieldOrRule("QR Fax").replace(/\D/g,''),
EMAIL: FieldOrRule("QR Email"),
URL: FieldOrRule("www"),
ORG: FieldOrRule("Organization"),
TITLE: FieldOrRule("title1"),
}It's actually declaring a JavaScript object literal (https://developer.mozilla.org/en/JavaScript/Guide/Values%2c_Variables%2c_and_Literals#Object_Literal s) named "info", with a set of properties, one per line, each of which has a name to the left of the colon and a value to the right of the colon. The name of a property can be just about anything, but if it's not a valid identifier (https://developer.mozilla.org/en/JavaScript/Guide/Values%2c_Variables%2c_and_Literals#Variables), it has to be enclosed in quotes as a string literal. You could put every property name inside quotes in the object literal and that would work fine too.