Bugfix
This commit is contained in:
parent
b8368e3388
commit
9896a2098e
@ -1407,6 +1407,36 @@ class User
|
|||||||
$socid = rand(1, $num_socs);
|
$socid = rand(1, $num_socs);
|
||||||
$this->societe_id = $socids[$socid];
|
$this->societe_id = $socids[$socid];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Charge la liste des entrepots pour l'utilisateur
|
||||||
|
* \return int 0 si ok, <> 0 si erreur
|
||||||
|
*/
|
||||||
|
function load_entrepots()
|
||||||
|
{
|
||||||
|
$err=0;
|
||||||
|
$this->entrepots = array();
|
||||||
|
$sql = "SELECT fk_entrepot,consult,send";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."user_entrepot";
|
||||||
|
$sql.= " WHERE fk_user = '".$this->id."'";
|
||||||
|
|
||||||
|
if ( $this->db->query($sql) )
|
||||||
|
{
|
||||||
|
while ($obj = $this->db->fetch_object($result) )
|
||||||
|
{
|
||||||
|
$this->entrepots[$i]['id'] = $obj->consult;
|
||||||
|
$this->entrepots[$i]['consult'] = $obj->consult;
|
||||||
|
$this->entrepots[$i]['send'] = $obj->send;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$err++;
|
||||||
|
dolibarr_print_error($this->db);
|
||||||
|
}
|
||||||
|
return $err;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1457,33 +1487,6 @@ function creer_pass_aleatoire_2($sel = "")
|
|||||||
return $pass;
|
return $pass;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* \brief Charge la liste des entrepots pour l'utilisateur
|
|
||||||
* \return int 0 si ok, <> 0 si erreur
|
|
||||||
*/
|
|
||||||
function load_entrepots()
|
|
||||||
{
|
|
||||||
$err=0;
|
|
||||||
$this->entrepots = array();
|
|
||||||
$sql = "SELECT fk_entrepot,consult,send";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user_entrepot";
|
|
||||||
$sql.= " WHERE fk_user = '".$this->id."'";
|
|
||||||
|
|
||||||
if ( $this->db->query($sql) )
|
|
||||||
{
|
|
||||||
while ($obj = $this->db->fetch_object($result) )
|
|
||||||
{
|
|
||||||
$this->entrepots[$i]['id'] = $obj->consult;
|
|
||||||
$this->entrepots[$i]['consult'] = $obj->consult;
|
|
||||||
$this->entrepots[$i]['send'] = $obj->send;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$err++;
|
|
||||||
dolibarr_print_error($this->db);
|
|
||||||
}
|
|
||||||
return $err;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user