diff --git a/htdocs/contact/exportimport.php b/htdocs/contact/exportimport.php
new file mode 100644
index 00000000000..5a9a126f95c
--- /dev/null
+++ b/htdocs/contact/exportimport.php
@@ -0,0 +1,108 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
+ * $Source$
+ */
+
+/**
+ \file htdocs/contact/exportimport.php
+ \ingroup societe
+ \brief Onglet exports-imports d'un contact
+ \version $Revision$
+*/
+
+require("./pre.inc.php");
+require("../contact.class.php");
+
+$langs->load("companies");
+
+
+/*
+ *
+ *
+ */
+
+llxHeader();
+
+$form = new Form($db);
+
+$contact = new Contact($db);
+$contact->fetch($_GET["id"], $user);
+
+
+$h=0;
+
+$head[$h][0] = DOL_URL_ROOT.'/contact/fiche.php?id='.$_GET["id"];
+$head[$h][1] = $langs->trans("General");
+$h++;
+
+$head[$h][0] = DOL_URL_ROOT.'/contact/perso.php?id='.$_GET["id"];
+$head[$h][1] = $langs->trans("PersonalInformations");
+$h++;
+
+$head[$h][0] = DOL_URL_ROOT.'/contact/exportimport.php?id='.$_GET["id"];
+$head[$h][1] = $langs->trans("ExportImport");
+$hselected=$h;
+$h++;
+
+$head[$h][0] = DOL_URL_ROOT.'/contact/info.php?id='.$_GET["id"];
+$head[$h][1] = $langs->trans("Info");
+$h++;
+
+dolibarr_fiche_head($head, $hselected, $langs->trans("Contact").": ".$contact->firstname.' '.$contact->name);
+
+
+/*
+ * Fiche en mode visu
+ */
+print '
";
}
+
}
$db->close();
diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php
index b8569e426f8..792fc45b755 100644
--- a/htdocs/contact/vcard.php
+++ b/htdocs/contact/vcard.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004 Laurent Destailleur
+/* Copyright (C) 2004 Rodolphe Quiedeville
+ * Copyright (C) 2004-2005 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
*
*/
-/*!
+/**
\file htdocs/contact/vcard.php
\ingroup societe
\brief Onglet vcard d'un contact
@@ -32,38 +32,43 @@ require("./pre.inc.php");
require("../contact.class.php");
require (DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
-/*
- *
- *
- */
+
$contact = new Contact($db);
$contact->fetch($_GET["id"]);
+
+// On crée car la VCard
+
$v = new vCard();
$v->setName($contact->name, $contact->firstname, "", "");
$v->setPhoneNumber($contact->phone_perso, "PREF;HOME;VOICE");
-if ($contact->birthday)
- $v->setBirthday($contact->birthday);
+if ($contact->birthday) $v->setBirthday($contact->birthday);
// TODO finir le support des adresses dans les contacts
-
$v->setAddress("", "", $contact->address, $contact->ville, "", $contact->cp, $contact->pays);
+
$v->setEmail($contact->email);
+
//$v->setNote("You can take some notes here.\r\nMultiple lines are supported via \\r\\n.");
//$v->setURL("http://www.thomas-mustermann.de", "WORK");
-$output = $v->getVCard();
-$filename = $v->getFileName();
+$db->close();
+
+
+// Renvoi VCard au navigateur
+
+$output = $v->getVCard();
+
+$filename = sanitize_string(ereg_replace('^%20','',$v->getFileName()));
Header("Content-Disposition: attachment; filename=$filename");
Header("Content-Length: ".strlen($output));
Header("Connection: close");
Header("Content-Type: text/x-vCard; name=$filename");
-echo $output;
+print $output;
-$db->close();
?>
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index bc646a0fe19..f67f475091d 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -94,4 +94,6 @@ NbOfAttachedFiles=Number of attached files
AttachANewFile=Attach a new file
FileWasRemoved=Files was removed
NoRIB=No RIB defined
-NoParentCompany=None
\ No newline at end of file
+NoParentCompany=None
+ExportImport=Import-Export
+ExportCardToFormat=Export card to format
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang
index 3c79263df84..a0b7277eb1d 100644
--- a/htdocs/langs/fr_FR/companies.lang
+++ b/htdocs/langs/fr_FR/companies.lang
@@ -94,4 +94,6 @@ NbOfAttachedFiles=Nombre de fichiers joints
AttachANewFile=Joindre un nouveau fichier
FileWasRemoved=Le fichier a été supprimé
NoRIB=Aucun RIB défini
-NoParentCompany=Aucune
\ No newline at end of file
+NoParentCompany=Aucune
+ExportImport=Import-Export
+ExportCardToFormat=Exporter fiche au format
\ No newline at end of file