Modification de l'appel de create ajout du parametre user

This commit is contained in:
Rodolphe Quiedeville 2006-12-04 11:31:57 +00:00
parent 9b0d084d1c
commit 56ca62a92b

View File

@ -623,7 +623,7 @@ class User
* \brief Crée un utilisateur en base * \brief Crée un utilisateur en base
* \return int si erreur <0, si ok renvoie id compte créé * \return int si erreur <0, si ok renvoie id compte créé
*/ */
function create() function create($user)
{ {
global $conf,$langs; global $conf,$langs;
@ -673,8 +673,8 @@ class User
// Appel des triggers // Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php"); include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($this->db); $interface = new Interfaces($this->db);
$result=$interface->run_triggers('USER_CREATE',$this,$user,$lang,$conf); $result = $interface->run_triggers('USER_CREATE',$this,$user,$lang,$conf);
if ($result < 0) $error++; if ($result < 0) $error++;
// Fin appel triggers // Fin appel triggers
@ -1416,17 +1416,22 @@ class User
{ {
$err=0; $err=0;
$this->entrepots = array(); $this->entrepots = array();
$sql = "SELECT fk_entrepot,consult,send"; $sql = "SELECT e.rowid,ue.consult,ue.send,e.label";
$sql.= " FROM ".MAIN_DB_PREFIX."user_entrepot"; $sql.= " FROM ".MAIN_DB_PREFIX."user_entrepot as ue,".MAIN_DB_PREFIX."entrepot as e";
$sql.= " WHERE fk_user = '".$this->id."'"; $sql.= " WHERE fk_user = '".$this->id."'";
$sql .= " AND e.statut = 1";
$sql .= " AND e.rowid = ue.fk_entrepot";
if ( $this->db->query($sql) ) if ( $this->db->query($sql) )
{ {
$i=0;
while ($obj = $this->db->fetch_object($result) ) while ($obj = $this->db->fetch_object($result) )
{ {
$this->entrepots[$i]['id'] = $obj->consult; $this->entrepots[$i]['id'] = $obj->consult;
$this->entrepots[$i]['consult'] = $obj->consult; $this->entrepots[$i]['consult'] = $obj->consult;
$this->entrepots[$i]['send'] = $obj->send; $this->entrepots[$i]['send'] = $obj->send;
$this->entrepots[$i]['label'] = $obj->label;
$i++;
} }
} }
else else