From 473bdfc7ae0ccf156ea8438f9b46d079aad4fd19 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 30 Jan 2004 17:24:36 +0000 Subject: [PATCH] Ajout de la note et autres infos --- htdocs/contact/fiche.php | 96 ++++++++++++++++++++++++++-------------- 1 file changed, 63 insertions(+), 33 deletions(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index da4150bf691..03f7307dec8 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -21,12 +21,7 @@ */ require("./pre.inc.php"); require("../contact.class.php"); - -if ($sortorder == "") -{ - $sortfield="lower(s.nom)"; - $sortorder="ASC"; -} +require (DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php"); if ($HTTP_POST_VARS["action"] == 'add') { @@ -43,6 +38,7 @@ if ($HTTP_POST_VARS["action"] == 'add') $contact->phone_pro = $HTTP_POST_VARS["phone_pro"]; $contact->phone_perso = $HTTP_POST_VARS["phone_perso"]; $contact->phone_mobile = $HTTP_POST_VARS["phone_mobile"]; + $contact->jabberid = $HTTP_POST_VARS["jabberid"]; $_GET["id"] = $contact->create($user); } @@ -57,7 +53,6 @@ if ($_GET["action"] == 'delete') $result = $contact->delete($_GET["id"]); Header("Location: index.php"); - } @@ -70,16 +65,24 @@ if ($action == 'update') $contact->name = $HTTP_POST_VARS["name"]; $contact->firstname = $HTTP_POST_VARS["firstname"]; - $contact->poste = $poste; + $contact->poste = $HTTP_POST_VARS["poste"]; $contact->phone_pro = $HTTP_POST_VARS["phone_pro"]; $contact->phone_perso = $HTTP_POST_VARS["phone_perso"]; $contact->phone_mobile = $HTTP_POST_VARS["phone_mobile"]; $contact->fax = $HTTP_POST_VARS["fax"]; - $contact->note = $note; + $contact->note = $HTTP_POST_VARS["note"]; $contact->email = $HTTP_POST_VARS["email"]; - - $result = $contact->update($HTTP_POST_VARS["contactid"]); + $contact->jabberid = $HTTP_POST_VARS["jabberid"]; + + $contact->birthday = mktime(12, 1 , 1, + $HTTP_POST_VARS["remonth"], + $HTTP_POST_VARS["reday"], + $HTTP_POST_VARS["reyear"]); + + $contact->birthday_alert = $HTTP_POST_VARS["birthday_alert"]; + + $result = $contact->update($HTTP_POST_VARS["contactid"], $user); } @@ -110,7 +113,7 @@ if ($_GET["action"] == 'create') print 'Nom'; print 'Prenom'; - print 'Tel Pro'; + print 'Tel Pro'; print 'Poste'; @@ -125,6 +128,7 @@ if ($_GET["action"] == 'create') print 'Fax'; print 'Email'; + print 'Note'; print ''; print ""; print ""; @@ -135,54 +139,83 @@ elseif ($_GET["action"] == 'edit') print_fiche_titre ("Edition d'un contact"); $contact = new Contact($db); - $contact->fetch($_GET["id"]); + $contact->fetch($_GET["id"], $user); print '
'; print ''; print ''; print ''; print ''; - print ''; + print '
'; print ''; print ''; print ''; - print ''; + print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + + print ''; + } + else + { + print ''; + } + + print ''; + print ''; print "
NomPrenomTel Pro
Poste
PosteTel Perso
Tel Perso
AdresseMobile
Portable
CP Ville Fax
Email
Email
Jabberid
Jabberid
Date de naissance'; + $html = new Form($db); + print $html->select_date(); + print 'Alerte : '; + if ($contact->birthday_alert) + { + print '
Note
"; print "
"; } else { $contact = new Contact($db); - $contact->fetch($_GET["id"]); + $contact->fetch($_GET["id"], $user); print_fiche_titre ("Contact : ". $contact->firstname.' '.$contact->name); print ''; - print ''; - - - + print ''; print "
Nom : '.$contact->name.' '.$contact->firstname; + print '
Nom : '.$contact->name.' '.$contact->firstname ."
"; + + if ($contact->poste) + print 'Poste : '.$contact->poste ."
"; if ($contact->email) - print '
Email : '.$contact->email; + print 'Email : '.$contact->email ."
"; + + if ($contact->jabberid) + print 'Jabber : '.$contact->jabberid ."
"; + + if ($contact->birthday) + print 'Date de naissance : '.strftime("%d %B %Y",$contact->birthday); + + if ($contact->birthday_alert) + print ' (alerte)'; + + print "
"; print '
'; - if ($contact->phone_perso) + if ($contact->phone_pro) print 'Tel Pro : '.$contact->phone_pro ."
"; if ($contact->phone_perso) @@ -194,13 +227,10 @@ else if($contact->fax) print 'Fax : '.$contact->fax."
"; - - print '
"; - + + print nl2br($contact->note); if ($user->societe_id == 0) { @@ -209,14 +239,14 @@ else print 'Editer'; print '-'; - print '-'; + print 'VCard'; + print '-'; - print 'Supprimer'; + print 'Supprimer'; print ""; } print "

\n"; - }