diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index fcfd4c831e8..adb31aa485c 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -96,7 +96,7 @@ class Contact $this->name=trim($this->name); if (! $this->socid) $this->socid = 0; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (datec, fk_soc, name, fk_user_create)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."socpeople (datec, fk_soc, name, fk_user_creat)"; $sql.= " VALUES (now(),"; if ($this->socid > 0) $sql.= " ".$this->socid.","; else $sql.= "null,"; @@ -580,7 +580,7 @@ class Contact */ function info($id) { - $sql = "SELECT c.idp, ".$this->db->pdate("c.datec")." as datec, c.fk_user_create"; + $sql = "SELECT c.idp, ".$this->db->pdate("c.datec")." as datec, c.fk_user_creat"; $sql .= ", ".$this->db->pdate("c.tms")." as tms, c.fk_user_modif"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql .= " WHERE c.idp = ".$id; @@ -594,8 +594,8 @@ class Contact $this->id = $obj->idp; - if ($obj->fk_user_create) { - $cuser = new User($this->db, $obj->fk_user_create); + if ($obj->fk_user_creat) { + $cuser = new User($this->db, $obj->fk_user_creat); $cuser->fetch(); $this->user_creation = $cuser; } diff --git a/htdocs/user.class.php b/htdocs/user.class.php index a11a5624da0..03a4b1c2fcc 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -607,7 +607,7 @@ class User // Si contact, supprime lien if ($this->contact_id) { - $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user = null WHERE idp = $this->contact_id"; + $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user_creat = null WHERE idp = $this->contact_id"; if ($this->db->query($sql)) { diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index 3db9bbe958c..3f4d18b0a7a 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -534,4 +534,5 @@ ALTER TABLE llx_product ADD COLUMN volume_units tinyint DEFAULT NULL after volum ALTER TABLE llx_product modify ref varchar(32) NOT NULL; -ALTER TABLE `llx_socpeople` CHANGE `fk_user` `fk_user_create` INT( 11 ) NULL DEFAULT '0'; \ No newline at end of file +ALTER TABLE `llx_socpeople` CHANGE `fk_user` `fk_user_creat` INT( 11 ) NULL DEFAULT '0'; +ALTER TABLE `llx_socpeople` CHANGE `fk_user_create` `fk_user_creat` INT( 11 ) NULL DEFAULT '0'; \ No newline at end of file diff --git a/mysql/tables/llx_socpeople.sql b/mysql/tables/llx_socpeople.sql index b8d099c7af7..41db956f22f 100644 --- a/mysql/tables/llx_socpeople.sql +++ b/mysql/tables/llx_socpeople.sql @@ -41,7 +41,7 @@ create table llx_socpeople fax varchar(30), email varchar(255), jabberid varchar(255), - fk_user_create integer DEFAULT 0, -- user qui a créé l'enregistrement + fk_user_creat integer DEFAULT 0, -- user qui a créé l'enregistrement fk_user_modif integer, note text )type=innodb;