User creation not correctly managed if not defined

This commit is contained in:
Laurent Destailleur 2008-07-20 17:14:19 +00:00
parent 5cf8180a74
commit 4fd6ce5e0d
3 changed files with 6 additions and 5 deletions

View File

@ -195,7 +195,7 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
$propal->contactid = $_POST['contactidp'];
$propal->projetidp = $_POST['projetidp'];
$propal->modelpdf = $_POST['model'];
$propal->author = $user->id;
$propal->author = $user->id; // deprecated
$propal->note = $_POST['note'];
$propal->ref = $_POST['ref'];
$propal->statut = 0;
@ -219,7 +219,7 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
$propal->contactid = $_POST['contactidp'];
$propal->projetidp = $_POST['projetidp'];
$propal->modelpdf = $_POST['model'];
$propal->author = $user->id;
$propal->author = $user->id; // deprecated
$propal->note = $_POST['note'];
$propal->ref_client = $_POST['ref_client'];
$propal->ref = $_POST['ref'];
@ -235,7 +235,7 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
}
}
$id = $propal->create();
$id = $propal->create($user);
}
if ($id > 0)

View File

@ -134,7 +134,7 @@ class Facture extends CommonObject
function create($user,$notrigger=0)
{
global $langs,$conf,$mysoc;
unset($user);
// Nettoyage paramètres
if (! $this->type) $this->type = 0;
$this->ref_client=trim($this->ref_client);

View File

@ -530,7 +530,8 @@ class Propal extends CommonObject
$sql.= ") ";
$sql.= " VALUES (".$this->socid.", 0,";
$sql.= " ".$this->remise.", ".($this->remise_percent?$this->remise_percent:'null').", ".($this->remise_absolue?$this->remise_absolue:'null').",";
$sql.= " 0,0,".$this->db->idate($this->datep).", now(), '".$this->ref."', ".$this->author.",";
$sql.= " 0,0,".$this->db->idate($this->datep).", now(), '".$this->ref."', ";
$sql.= ($user->id > 0 ? "'".$user->id."'":"null").",";
$sql.= "'".addslashes($this->note)."',";
$sql.= "'".addslashes($this->note_public)."',";
$sql.= "'".$this->modelpdf."',".$this->db->idate($this->fin_validite).",";