diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index ace94099d33..001cdd63bc5 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -42,7 +42,7 @@ abstract class ActionsCardCommon var $error; //! Error array var $errors=array(); - + /** * Instantiation of DAO class @@ -126,10 +126,11 @@ abstract class ActionsCardCommon { $this->object->particulier = GETPOST("private"); - $this->object->nom = empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?trim($_POST["prenom"].' '.$_POST["nom"]):trim($_POST["nom"].' '.$_POST["prenom"]); - $this->object->nom_particulier = $_POST["nom"]; - $this->object->prenom = $_POST["prenom"]; + $this->object->name = empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?trim($_POST["prenom"].' '.$_POST["nom"]):trim($_POST["nom"].' '.$_POST["prenom"]); $this->object->civilite_id = $_POST["civilite_id"]; + // Add non official properties + $this->object->name_bis = $_POST["nom"]; + $this->object->firstname = $_POST["prenom"]; } else { @@ -224,8 +225,8 @@ abstract class ActionsCardCommon $contact=new Contact($this->db); $contact->civilite_id = $this->object->civilite_id; - $contact->name = $this->object->nom_particulier; - $contact->firstname = $this->object->prenom; + $contact->name = $this->object->name_bis; + $contact->firstname = $this->object->firstname; $contact->address = $this->object->address; $contact->cp = $this->object->cp; $contact->ville = $this->object->ville; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a944721e9f1..39ce333b8ea 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -43,10 +43,8 @@ class Societe extends CommonObject protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; - var $name; // TODO obsolete - var $nom; - var $nom_particulier; - var $prenom; + var $name; + var $nom; // TODO obsolete var $particulier; var $address; var $adresse; // TODO obsolete diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 5d095155377..ea8237c36cc 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -110,9 +110,10 @@ if (empty($reshook)) $object->particulier = GETPOST("private"); $object->name = empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?trim($_POST["prenom"].' '.$_POST["nom"]):trim($_POST["nom"].' '.$_POST["prenom"]); - $object->nom_particulier = $_POST["nom"]; - $object->prenom = $_POST["prenom"]; $object->civilite_id = $_POST["civilite_id"]; + // Add non official properties + $object->name_bis = $_POST["nom"]; + $object->firstname = $_POST["prenom"]; } else { @@ -229,8 +230,8 @@ if (empty($reshook)) $contact=new Contact($db); $contact->civilite_id = $object->civilite_id; - $contact->name = $object->nom_particulier; - $contact->firstname = $object->prenom; + $contact->name = $object->name_bis; + $contact->firstname = $object->firstname; $contact->address = $object->address; $contact->zip = $object->zip; $contact->cp = $object->cp; // TODO obsolete