From d8a45261bde32eccb8abd50080366610c225f55d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 16 Dec 2004 19:45:40 +0000 Subject: [PATCH] =?UTF-8?q?Seul=20le=20nom=20ou=20pr=E9nom=20est=20obligat?= =?UTF-8?q?oire=20au=20lieu=20de=20nom=20et=20pr=E9nom.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/contact/fiche.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index aa3901ce182..fdd1dca5f37 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -55,8 +55,8 @@ if ($_GET["action"] == 'create_user' && $user->admin) if ($_POST["action"] == 'add') { if (! $_POST["name"] && ! $_POST["firstname"]) { - array_push($error,"Le champ nom ou prénom est obligatoire. Cliquez sur Retour et réessayez."); - $_GET["id"]=0; + array_push($error,'Le champ nom ou prénom est obligatoire.'); + $_GET["action"]="create"; } else { $contact = new Contact($db); @@ -139,6 +139,15 @@ llxHeader(); $form = new Form($db); +// Affiche les erreurs +if (sizeof($error)) +{ + print "
"; + print join("
",$error); + print "
\n"; +} + + /* * Onglets */ @@ -181,15 +190,6 @@ if ($_GET["action"] == 'delete') print '
'; } -// Affiche les erreurs -if (sizeof($error)) -{ - print '

'.LDAP_SERVER_TYPE.'
'; - print join("
",$error); - print '

'; -} - - if ($_GET["socid"] > 0) { $objsoc = new Societe($db); @@ -323,7 +323,11 @@ else //TODO Aller chercher le libellé de la civilite a partir de l'id $contact->civilite_id //print 'Titre : '.$contact->civilite."
"; - print ''.$langs->trans("Name").' : '.$contact->name.' '.$contact->firstname ."
"; + print ''; + + if ($contact->name || $contact->firstname) { + print $langs->trans("Name").' : '.$contact->name.' '.$contact->firstname ."
"; + } if ($contact->poste) print 'Poste : '.$contact->poste ."
";