Seul le nom ou prnom est obligatoire au lieu de nom et prnom.

This commit is contained in:
Laurent Destailleur 2004-12-16 19:45:40 +00:00
parent b0479b7aaf
commit d8a45261bd

View File

@ -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 <a href=# onclick=history.back()>Retour</a> 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 "<div class='error'>";
print join("<br>",$error);
print "</div>\n";
}
/*
* Onglets
*/
@ -181,15 +190,6 @@ if ($_GET["action"] == 'delete')
print '<br>';
}
// Affiche les erreurs
if (sizeof($error))
{
print '<div class="message"><br>'.LDAP_SERVER_TYPE.'<br>';
print join("<br>",$error);
print '<br><br></div>';
}
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 '<tr><td valign="top">Titre : '.$contact->civilite."<br>";
print '<tr><td valign="top">'.$langs->trans("Name").' : '.$contact->name.' '.$contact->firstname ."<br>";
print '<tr><td valign="top">';
if ($contact->name || $contact->firstname) {
print $langs->trans("Name").' : '.$contact->name.' '.$contact->firstname ."<br>";
}
if ($contact->poste)
print 'Poste : '.$contact->poste ."<br>";