email is now used as name, if name is empty
This commit is contained in:
parent
0b4149cb91
commit
149aa8e81b
@ -187,13 +187,10 @@ if ($reshook < 0) {
|
|||||||
if (empty($reshook) && $action == 'add') {
|
if (empty($reshook) && $action == 'add') {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$urlback = '';
|
$urlback = '';
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
|
|
||||||
if (!GETPOST("email")) {
|
if (!GETPOST("email")) {
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
|
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
|
||||||
@ -223,7 +220,12 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$readythirdparty = -1;
|
$readythirdparty = -1;
|
||||||
} elseif ($resultfetchthirdparty==0) {
|
} elseif ($resultfetchthirdparty==0) {
|
||||||
// creation of a new thirdparty
|
// creation of a new thirdparty
|
||||||
$thirdparty->name = GETPOST("societe");
|
if(!empty(GETPOST("societe"))){
|
||||||
|
$thirdparty->name = GETPOST("societe");
|
||||||
|
} else {
|
||||||
|
$thirdparty->name = $email;
|
||||||
|
}
|
||||||
|
|
||||||
$thirdparty->address = GETPOST("address");
|
$thirdparty->address = GETPOST("address");
|
||||||
$thirdparty->zip = GETPOST("zipcode");
|
$thirdparty->zip = GETPOST("zipcode");
|
||||||
$thirdparty->town = GETPOST("town");
|
$thirdparty->town = GETPOST("town");
|
||||||
@ -324,8 +326,8 @@ print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newmember">'.
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'" / >';
|
print '<input type="hidden" name="token" value="'.newToken().'" / >';
|
||||||
print '<input type="hidden" name="entity" value="'.$entity.'" />';
|
print '<input type="hidden" name="entity" value="'.$entity.'" />';
|
||||||
print '<input type="hidden" name="action" value="add" />';
|
print '<input type="hidden" name="action" value="add" />';
|
||||||
print '<input type="hidden" name="id" value="'.dol_encode($id, $key).'" />';
|
print '<input type="hidden" name="id" value="'.$encodedid.'" />';
|
||||||
print '<input type="hidden" name="securekey" value="'.$securekey.'" />';
|
print '<input type="hidden" name="securekey" value="'.$encodedsecurekeyandid.'" />';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user