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 ." ";
|