Seul le nom ou prénom est obligatoire au lieu de nom et prénom.

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["action"] == 'add')
{ {
if (! $_POST["name"] && ! $_POST["firstname"]) { 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."); array_push($error,'Le champ nom ou prénom est obligatoire.');
$_GET["id"]=0; $_GET["action"]="create";
} }
else { else {
$contact = new Contact($db); $contact = new Contact($db);
@ -139,6 +139,15 @@ llxHeader();
$form = new Form($db); $form = new Form($db);
// Affiche les erreurs
if (sizeof($error))
{
print "<div class='error'>";
print join("<br>",$error);
print "</div>\n";
}
/* /*
* Onglets * Onglets
*/ */
@ -181,15 +190,6 @@ if ($_GET["action"] == 'delete')
print '<br>'; 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) if ($_GET["socid"] > 0)
{ {
$objsoc = new Societe($db); $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 //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">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) if ($contact->poste)
print 'Poste : '.$contact->poste ."<br>"; print 'Poste : '.$contact->poste ."<br>";