set ref at create

This commit is contained in:
Frédéric FRANCE 2020-11-11 12:17:23 +01:00
parent c7557fdb8a
commit 0735993839
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1

View File

@ -525,9 +525,10 @@ class Adherent extends CommonObject
// Insert member
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent";
$sql .= " (datec,login,fk_user_author,fk_user_mod,fk_user_valid,morphy,fk_adherent_type,entity,import_key)";
$sql .= " (ref, datec,login,fk_user_author,fk_user_mod,fk_user_valid,morphy,fk_adherent_type,entity,import_key)";
$sql .= " VALUES (";
$sql .= " '".$this->db->idate($this->datec)."'";
$sql .= " '(PROV)'";
$sql .= ", '".$this->db->idate($this->datec)."'";
$sql .= ", ".($this->login ? "'".$this->db->escape($this->login)."'" : "null");
$sql .= ", ".($user->id > 0 ? $user->id : "null"); // Can be null because member can be created by a guest or a script
$sql .= ", null, null, '".$this->db->escape($this->morphy)."'";