* Copyright (C) 2004 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 * 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$ * */ require("./pre.inc.php"); require("../contact.class.php"); require (DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php"); if ($_POST["action"] == 'update') { $contact = new Contact($db); $contact->id = $_POST["contactid"]; if ($_POST["birthdayyear"]) { if ($_POST["birthdayyear"]<=1970 && $_SERVER["WINDIR"]) { # windows mktime does not support negative date timestamp so birthday is not support for old persons $contact->birthday = $_POST["birthdayyear"].'-'.$_POST["birthdaymonth"].'-'.$_POST["birthdayday"]; //array_push($error,"Windows ne sachant pas gérer des dates avant 1970, les dates de naissance avant cette date ne seront pas sauvegardées"); } else { $contact->birthday = mktime(0,0,0,$_POST["birthdaymonth"],$_POST["birthdayday"],$_POST["birthdayyear"]); } } $contact->birthday_alert = $_POST["birthday_alert"]; $result = $contact->update_perso($_POST["contactid"], $user); } /* * * */ llxHeader(); print '
'; print 'Général'; print 'Informations personnelles'; print 'VCard'; print 'Info'; print '
'; print '
'; if ($_GET["action"] == 'edit') { // Fiche info perso en mode edition $contact = new Contact($db); $contact->fetch($_GET["id"], $user); print_fiche_titre ("Contact : ". $contact->firstname.' '.$contact->name); print '
'; print ''; print ''; if ($contact->socid > 0) { $objsoc = new Societe($db); $objsoc->fetch($contact->socid); print 'Société : '.$objsoc->nom_url.'
'; } print 'Nom : '.$contact->name.' '.$contact->firstname ."
"; print ''; $html = new Form($db); print ''; print ''; } else { print ''; } print "
Date de naissance'; if ($contact->birthday && $contact->birthday > 0) { print $html->select_date($contact->birthday,'birthday',0,0,0); } else { print $html->select_date(0,'birthday',0,0,1); } print 'Alerte : '; if ($contact->birthday_alert) { print '
"; print '
'; print ""; } else { /* * Visualisation de la fiche * */ $contact = new Contact($db); $contact->fetch($_GET["id"], $user); print_fiche_titre ("Contact : ". $contact->firstname.' '.$contact->name); if ($contact->socid > 0) { $objsoc = new Societe($db); $objsoc->fetch($contact->socid); print 'Société : '.$objsoc->nom_url.'
'; } if ($contact->birthday && $contact->birthday > 0) { print 'Date de naissance : '.dolibarr_print_date($contact->birthday); if ($contact->birthday_alert) print ' (alerte anniversaire active)
'; else print ' (alerte anniversaire inactive)
'; } print "
"; print "
"; if ($user->societe_id == 0) { print '
'; print 'Editer'; print 'Supprimer'; print "
"; } } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>