From cca0dd9db4a2df7189e30e12b29c2d8c8b727e35 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 31 Jan 2004 11:55:37 +0000 Subject: [PATCH] Gestion des onglets --- htdocs/contact/fiche.php | 97 ++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 43 deletions(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 03f7307dec8..96bfefb3bb9 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -27,6 +27,8 @@ if ($HTTP_POST_VARS["action"] == 'add') { $contact = new Contact($db); + $contact->socid = $HTTP_POST_VARS["socid"]; + $contact->name = $HTTP_POST_VARS["name"]; $contact->firstname = $HTTP_POST_VARS["firstname"]; @@ -75,13 +77,6 @@ if ($action == 'update') $contact->email = $HTTP_POST_VARS["email"]; $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); } @@ -103,6 +98,21 @@ if ($action == 'create_user') llxHeader(); +print '
'; +print 'Général'; +print 'Informations personnelles'; +print 'VCard'; +print 'Info'; +print '
'; +print '
'; + + +if ($_GET["socid"] > 0) +{ + $objsoc = new Societe($db); + $objsoc->fetch($_GET["socid"]); +} + if ($_GET["action"] == 'create') { print_fiche_titre ("Création d'un nouveau contact"); @@ -110,12 +120,18 @@ if ($_GET["action"] == 'create') print "
"; print ''; print ''; + + if ($_GET["socid"] > 0) + { + print ''; + print ''; + } + print ''; print ''; print ''; - print ''; print ''; @@ -129,13 +145,12 @@ if ($_GET["action"] == 'create') print ''; print ''; print ''; - print ''; + print ''; print "
Société'.$objsoc->nom.'
NomPrenomTel Pro
PosteTel Perso
Fax
Email
Note
"; print "
"; } elseif ($_GET["action"] == 'edit') { - print_fiche_titre ("Edition d'un contact"); $contact = new Contact($db); @@ -147,6 +162,12 @@ elseif ($_GET["action"] == 'edit') print ''; print ''; print ''; + + if ($_GET["socid"] > 0) + { + print ''; + } + print ''; print ''; @@ -167,20 +188,6 @@ elseif ($_GET["action"] == 'edit') print ''; - - print ''; - } - else - { - print ''; - } - print ''; print ''; print "
Société'.$objsoc->nom.'
NomPrenom
Jabberid
Date de naissance'; - $html = new Form($db); - print $html->select_date(); - print 'Alerte : '; - if ($contact->birthday_alert) - { - print '
Note
"; @@ -188,12 +195,27 @@ elseif ($_GET["action"] == 'edit') } else { + /* + * Visualisation de la fiche + * + */ + $contact = new Contact($db); $contact->fetch($_GET["id"], $user); print_fiche_titre ("Contact : ". $contact->firstname.' '.$contact->name); print ''; + + + if ($contact->socid > 0) + { + $objsoc = new Societe($db); + $objsoc->fetch($contact->socid); + + print ''; + } + print '
Société : '.$objsoc->nom_url.'
Nom : '.$contact->name.' '.$contact->firstname ."
"; if ($contact->poste) @@ -205,12 +227,6 @@ else 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 '
'; @@ -232,25 +248,20 @@ else print nl2br($contact->note); + print ""; + if ($user->societe_id == 0) { - print '

'; + print '
'; - print '
'; + print 'Editer'; - print ''; - print ''; - - print ''; - - print ''; - print "
Editer-VCard-Supprimer
"; + print 'Supprimer'; + + print ""; } - print "

\n"; } - - -$db->close(); + $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>