Gere plus d'info sur la vcard
This commit is contained in:
parent
be068e4f23
commit
fe2f54dcb2
@ -24,6 +24,7 @@ English Dolibarr changelog
|
|||||||
- Some bugs fixes.
|
- Some bugs fixes.
|
||||||
- Traduction more complete.
|
- Traduction more complete.
|
||||||
- Better code comments for Doxygen documentation.
|
- Better code comments for Doxygen documentation.
|
||||||
|
- Better support of vcard export format.
|
||||||
|
|
||||||
|
|
||||||
***** Changelog for 2.1 compared to 2.0.1 *****
|
***** Changelog for 2.1 compared to 2.0.1 *****
|
||||||
|
|||||||
@ -29,30 +29,49 @@
|
|||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/societe.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
|
||||||
|
|
||||||
|
|
||||||
$contact = new Contact($db);
|
$contact = new Contact($db);
|
||||||
$contact->fetch($_GET["id"]);
|
$result=$contact->fetch($_GET["id"]);
|
||||||
|
|
||||||
|
$physicalperson=1;
|
||||||
|
|
||||||
// On crée car la VCard
|
$company = new Societe($db);
|
||||||
|
if ($contact->socid)
|
||||||
|
{
|
||||||
|
$result=$company->fetch($contact->socid);
|
||||||
|
//print "ee";
|
||||||
|
}
|
||||||
|
|
||||||
|
// We create VCard
|
||||||
$v = new vCard();
|
$v = new vCard();
|
||||||
|
|
||||||
$v->setName($contact->name, $contact->firstname, "", "");
|
$v->setName($contact->name, $contact->firstname, "", "", "");
|
||||||
|
$v->setFormattedName($contact->fullname);
|
||||||
|
|
||||||
$v->setPhoneNumber($contact->phone_perso, "PREF;HOME;VOICE");
|
// By default, all informations are for work (except phone_perso and phone_mobile)
|
||||||
|
$v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE");
|
||||||
if ($contact->birthday) $v->setBirthday($contact->birthday);
|
$v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE");
|
||||||
|
$v->setPhoneNumber($contact->fax, "WORK;FAX");
|
||||||
$v->setAddress("", "", $contact->address, $contact->ville, "", $contact->cp, $contact->pays);
|
|
||||||
|
|
||||||
|
$v->setAddress("", "", $contact->address, $contact->ville, "", $contact->cp, $contact->pays, "WORK;POSTAL");
|
||||||
$v->setEmail($contact->email);
|
$v->setEmail($contact->email);
|
||||||
|
$v->setNote($contact->note);
|
||||||
|
|
||||||
//$v->setNote("You can take some notes here.\r\nMultiple lines are supported via \\r\\n.");
|
// Data from linked company
|
||||||
//$v->setURL("http://www.thomas-mustermann.de", "WORK");
|
if ($company->id)
|
||||||
|
{
|
||||||
|
$v->setURL($company->url, "WORK");
|
||||||
|
if (! $contact->phone_pro) $v->setPhoneNumber($company->tel, "WORK;VOICE");
|
||||||
|
if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX");
|
||||||
|
if (! $contact->cp) $v->setAddress("", "", $company->adresse, $company->ville, "", $company->cp, $company->pays_code, "WORK;POSTAL");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Personal informations
|
||||||
|
$v->setPhoneNumber($contact->phone_perso, "HOME;VOICE");
|
||||||
|
if ($contact->birthday) $v->setBirthday($contact->birthday);
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user