Fix: Firstname/Lastname lost

This commit is contained in:
Laurent Destailleur 2012-04-30 16:08:34 +02:00
parent d804683b32
commit 8898b9a3b0
3 changed files with 12 additions and 12 deletions

View File

@ -160,7 +160,7 @@ if ($action == 'confirm_create_user' && $confirm == 'yes' && $user->rights->user
{ {
// Creation user // Creation user
$nuser = new User($db); $nuser = new User($db);
$result=$nuser->create_from_member($object,GETPOST('login','alpha')); $result=$nuser->create_from_member($object,GETPOST('login'));
if ($result < 0) if ($result < 0)
{ {
@ -181,7 +181,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
{ {
// Creation user // Creation user
$company = new Societe($db); $company = new Societe($db);
$result=$company->create_from_member($object,GETPOST('companyname','alpha')); $result=$company->create_from_member($object,GETPOST('companyname'));
if ($result < 0) if ($result < 0)
{ {

View File

@ -34,9 +34,7 @@ if (GETPOST('msg','alpha')) $message='<div class="error">'.GETPOST('msg','alpha'
$urldolibarr='http://www.dolibarr.org/downloads/'; $urldolibarr='http://www.dolibarr.org/downloads/';
//$urldolibarrmodules='http://www.dolibarr.org/downloads/cat_view/65-modulesaddon';
$urldolibarrmodules='http://www.dolistore.com/'; $urldolibarrmodules='http://www.dolistore.com/';
//$urldolibarrthemes='http://www.dolibarr.org/';
$urldolibarrthemes='http://www.dolistore.com/'; $urldolibarrthemes='http://www.dolistore.com/';
$dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT); $dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT);
$dolibarrroot=preg_replace('/([^\\/]+)$/i','',$dolibarrroot); $dolibarrroot=preg_replace('/([^\\/]+)$/i','',$dolibarrroot);
@ -83,7 +81,7 @@ if (GETPOST('action','alpha')=='install')
{ {
$langs->load("errors"); $langs->load("errors");
$mesg = '<div class="error">'.$langs->trans($result['error'],$original_file).'</div>'; $mesg = '<div class="error">'.$langs->trans($result['error'],$original_file).'</div>';
} }
else else
{ {

View File

@ -935,12 +935,12 @@ class User extends CommonObject
// Positionne parametres // Positionne parametres
$this->admin = 0; $this->admin = 0;
$this->nom = $member->nom; $this->lastname = $member->lastname;
$this->prenom = $member->prenom; $this->firstname = $member->firstname;
$this->email = $member->email; $this->email = $member->email;
$this->pass = $member->pass; $this->pass = $member->pass;
if (empty($login)) $login=strtolower(substr($member->prenom, 0, 4)) . strtolower(substr($member->nom, 0, 4)); if (empty($login)) $login=strtolower(substr($member->firstname, 0, 4)) . strtolower(substr($member->lastname, 0, 4));
$this->login = $login; $this->login = $login;
$this->db->begin(); $this->db->begin();
@ -1044,8 +1044,8 @@ class User extends CommonObject
dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass); dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember.", nosyncmemberpass=".$nosyncmemberpass);
// Clean parameters // Clean parameters
$this->nom = trim($this->nom); // TODO deprecated $this->nom = trim($this->nom); // deprecated
$this->prenom = trim($this->prenom); // TODO deprecated $this->prenom = trim($this->prenom); // deprecated
$this->lastname = trim($this->lastname); $this->lastname = trim($this->lastname);
$this->firstname = trim($this->firstname); $this->firstname = trim($this->firstname);
$this->login = trim($this->login); $this->login = trim($this->login);
@ -1139,8 +1139,10 @@ class User extends CommonObject
if ($result >= 0) if ($result >= 0)
{ {
$adh->prenom=$this->firstname; $adh->prenom=$this->firstname; // deprecated
$adh->nom=$this->lastname; $adh->nom=$this->lastname; // deprecated
$adh->firstname=$this->firstname;
$adh->lastname=$this->lastname;
$adh->login=$this->login; $adh->login=$this->login;
$adh->pass=$this->pass; $adh->pass=$this->pass;
$adh->societe=(empty($adh->societe) && $this->societe_id ? $this->societe_id : $adh->societe); $adh->societe=(empty($adh->societe) && $this->societe_id ? $this->societe_id : $adh->societe);