[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/contact/ -> vcard.php (source)

   1  <?php
   2  /* Copyright (C) 2004      Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004-2005 Laurent Destailleur  <eldy@users.sourceforge.net>
   4   *
   5   * This program is free software; you can redistribute it and/or modify
   6   * it under the terms of the GNU General Public License as published by
   7   * the Free Software Foundation; either version 2 of the License, or
   8   * (at your option) any later version.
   9   *
  10   * This program is distributed in the hope that it will be useful,
  11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13   * GNU General Public License for more details.
  14   *
  15   * You should have received a copy of the GNU General Public License
  16   * along with this program; if not, write to the Free Software
  17   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18   *
  19   * $Id: vcard.php,v 1.8 2005/10/30 13:15:58 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/contact/vcard.php,v $
  21   */
  22  
  23  /**
  24          \file       htdocs/contact/vcard.php
  25          \ingroup    societe
  26          \brief      Onglet vcard d'un contact
  27          \version    $Revision: 1.8 $
  28  */
  29  
  30  require ("./pre.inc.php");
  31  require_once (DOL_DOCUMENT_ROOT."/contact.class.php");
  32  require_once(DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
  33  
  34  
  35  $contact = new Contact($db);
  36  $contact->fetch($_GET["id"]);
  37  
  38  
  39  // On crée car la VCard
  40  
  41  $v = new vCard();
  42  
  43  $v->setName($contact->name, $contact->firstname, "", "");
  44  
  45  $v->setPhoneNumber($contact->phone_perso, "PREF;HOME;VOICE");
  46  
  47  if ($contact->birthday) $v->setBirthday($contact->birthday);
  48  
  49  $v->setAddress("", "", $contact->address, $contact->ville, "", $contact->cp, $contact->pays);
  50  
  51  $v->setEmail($contact->email);
  52  
  53  //$v->setNote("You can take some notes here.\r\nMultiple lines are supported via \\r\\n.");
  54  //$v->setURL("http://www.thomas-mustermann.de", "WORK");
  55  
  56  
  57  $db->close();
  58  
  59  
  60  // Renvoi la VCard au navigateur
  61  
  62  $output = $v->getVCard();
  63  
  64  $filename =trim(urldecode($v->getFileName()));      // "Nom prenom.vcf"
  65  $filenameurlencoded = sanitize_string(urlencode($filename));
  66  //$filename = sanitize_string($filename);
  67  
  68  Header("Content-Disposition: attachment; filename=\"$filename\"");
  69  Header("Content-Length: ".strlen($output));
  70  Header("Connection: close");
  71  Header("Content-Type: text/x-vCard; name=\"$filename\"");
  72  
  73  print $output;
  74  
  75  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics