From 53d1a1326604592bb598a958646f398d96a903ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 17 May 2008 22:17:29 +0000 Subject: [PATCH] Fix: Can not create a member --- htdocs/adherents/adherent.class.php | 5 +++-- mysql/migration/2.2.0-2.4.0.sql | 3 +++ mysql/tables/llx_adherent.sql | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php index a52a2d97acb..412c44858a2 100644 --- a/htdocs/adherents/adherent.class.php +++ b/htdocs/adherents/adherent.class.php @@ -371,10 +371,11 @@ class Adherent extends CommonObject // Insertion membre $sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent"; - $sql.= " (datec,login)"; + $sql.= " (datec,login,fk_user_author,fk_user_mod,fk_user_valid)"; $sql.= " VALUES ("; $sql.= " '".$this->db->idate($this->datec)."',"; - $sql.= " '".addslashes($this->login)."'"; + $sql.= " '".addslashes($this->login)."',"; + $sql.= " '".$user->id."',null,null"; $sql.= ")"; dolibarr_syslog("Adherent::create sql=".$sql); diff --git a/mysql/migration/2.2.0-2.4.0.sql b/mysql/migration/2.2.0-2.4.0.sql index 30a85e373c4..657d5830891 100644 --- a/mysql/migration/2.2.0-2.4.0.sql +++ b/mysql/migration/2.2.0-2.4.0.sql @@ -310,3 +310,6 @@ INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (225, 'Canadian P6', 'Format Canadian P6', '107', '140', 'mm', 0); ALTER TABLE llx_commande_fournisseurdet DROP COLUMN price; + +alter table llx_adherent modify fk_user_mod integer; +alter table llx_adherent modify fk_user_valid integer; diff --git a/mysql/tables/llx_adherent.sql b/mysql/tables/llx_adherent.sql index 5e734e378cd..420b8507864 100644 --- a/mysql/tables/llx_adherent.sql +++ b/mysql/tables/llx_adherent.sql @@ -53,7 +53,7 @@ create table llx_adherent datec datetime, -- date de creation tms timestamp, -- date de modification fk_user_author integer NOT NULL, - fk_user_mod integer NOT NULL, - fk_user_valid integer NOT NULL, + fk_user_mod integer, + fk_user_valid integer, UNIQUE INDEX(login) )type=innodb;