Debug vcard v4
This commit is contained in:
parent
7138a06b2b
commit
3e12a8ab21
@ -353,7 +353,7 @@ class vCard
|
|||||||
$text .= "VERSION:4.0\r\n"; // With V4, all encoding are UTF-8
|
$text .= "VERSION:4.0\r\n"; // With V4, all encoding are UTF-8
|
||||||
//$text.= "VERSION:2.1\r\n";
|
//$text.= "VERSION:2.1\r\n";
|
||||||
foreach ($this->properties as $key => $value) {
|
foreach ($this->properties as $key => $value) {
|
||||||
$text .= "$key:$value\r\n";
|
$text .= $key.":".$value."\r\n";
|
||||||
}
|
}
|
||||||
$text .= "REV:".date("Y-m-d")."T".date("H:i:s")."Z\r\n";
|
$text .= "REV:".date("Y-m-d")."T".date("H:i:s")."Z\r\n";
|
||||||
//$text .= "MAILER: Dolibarr\r\n";
|
//$text .= "MAILER: Dolibarr\r\n";
|
||||||
@ -374,7 +374,7 @@ class vCard
|
|||||||
/**
|
/**
|
||||||
* Return a VCARD string
|
* Return a VCARD string
|
||||||
*
|
*
|
||||||
* @param Object $object Object
|
* @param Object $object Object (User, Contact)
|
||||||
* @param Societe $company Company
|
* @param Societe $company Company
|
||||||
* @param Translate $langs Lang object
|
* @param Translate $langs Lang object
|
||||||
* @return string String
|
* @return string String
|
||||||
@ -403,8 +403,13 @@ class vCard
|
|||||||
$this->setNote($object->note_public);
|
$this->setNote($object->note_public);
|
||||||
$this->setTitle($object->job);
|
$this->setTitle($object->job);
|
||||||
|
|
||||||
if ($company->id > 0) {
|
// For user, type=home
|
||||||
|
// For contact, this is not defined
|
||||||
|
$this->setURL($object->url, "TYPE=HOME");
|
||||||
|
|
||||||
|
if (is_object($company)) {
|
||||||
$this->setURL($company->url, "TYPE=WORK");
|
$this->setURL($company->url, "TYPE=WORK");
|
||||||
|
|
||||||
if (!$object->office_phone) {
|
if (!$object->office_phone) {
|
||||||
$this->setPhoneNumber($company->phone, "TYPE=WORK,VOICE");
|
$this->setPhoneNumber($company->phone, "TYPE=WORK,VOICE");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,6 +96,7 @@ $company = $mysoc;
|
|||||||
if ($mode == 'vcard') {
|
if ($mode == 'vcard') {
|
||||||
// We create VCard
|
// We create VCard
|
||||||
$v = new vCard();
|
$v = new vCard();
|
||||||
|
|
||||||
$output = $v->buildVCardString($object, $company, $langs);
|
$output = $v->buildVCardString($object, $company, $langs);
|
||||||
|
|
||||||
$filename = trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
|
$filename = trim(urldecode($v->getFileName())); // "Nom prenom.vcf"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user