From be0c4a8aa095b707e9a18813008a7e32020f50fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 Mar 2004 20:56:30 +0000 Subject: [PATCH] La fonction "Modifier" ne fonctionnait pas. --- htdocs/comm/people.php | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/people.php b/htdocs/comm/people.php index 37e3246496f..6187a8a0484 100644 --- a/htdocs/comm/people.php +++ b/htdocs/comm/people.php @@ -1,5 +1,6 @@ + * 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 @@ -36,12 +37,33 @@ if ($sortorder == "") if ($action == 'create_user') { - $nuser = new User($db); - $contact = new Contact($db); - $nuser->nom = $contact->nom; - $nuser->prenom = $contact->prenom; - $result = $contact->fetch($contactid); - $nuser->create_from_contact($contact); + // Recuperation contact actuel + $contact = new Contact($db); + $result = $contact->fetch($_GET["contactid"]); + + // Creation user + $nuser = new User($db); + $nuser->nom = $contact->nom; + $nuser->prenom = $contact->prenom; + $nuser->create_from_contact($contact); +} + +if ($action == 'update') +{ + // Recuperation contact actuel + $contact = new Contact($db); + $contact->fetch($_POST["contactid"]); + + // Modification contact + $contact->nom = $_POST["name"]; + $contact->prenom = $_POST["firstname"]; + $contact->poste = $_POST["poste"]; + $contact->phone = $_POST["phone"]; + $contact->fax = $_POST["fax"]; + $contact->email = $_POST["email"]; + $contact->note = $_POST["note"]; + + $contact->update($_POST["contactid"]); } /*