Skip to content
Snippets Groups Projects
Commit de8084be authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Gestion erreur liste propals

parent 74ec2a25
No related branches found
No related tags found
No related merge requests found
......@@ -284,12 +284,12 @@ class Propal
}
else
{
print $this->db->error() . '<b><br>'.$sql;
dolibarr_print_error($this->db);
}
}
else
{
print $this->db->error() . '<b><br>'.$sql;
dolibarr_print_error($this->db);
}
return $this->id;
}
......@@ -439,7 +439,7 @@ class Propal
}
else
{
print $this->db->error();
dolibarr_print_error($this->db);
}
/*
......@@ -478,14 +478,14 @@ class Propal
}
else
{
print $this->db->error();
dolibarr_print_error($this->db);
}
}
return 1;
}
else
{
print $this->db->error();
dolibarr_print_error($this->db);
return 0;
}
}
......@@ -510,7 +510,7 @@ class Propal
}
else
{
print $this->db->error() . ' in ' . $sql;
dolibarr_print_error($this->db);
return -1;
}
}
......@@ -539,7 +539,7 @@ class Propal
}
else
{
print $this->db->error() . ' in ' . $sql;
dolibarr_print_error($this->db);
}
}
}
......@@ -564,7 +564,7 @@ class Propal
}
else
{
print $this->db->error() . ' in ' . $sql;
dolibarr_print_error($this->db);
return 0;
}
}
......@@ -579,7 +579,6 @@ class Propal
{
$this->statut = $statut;
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fk_statut = $statut, note = '$note', date_cloture=now(), fk_user_cloture=$user->id";
$sql .= " WHERE rowid = $this->id;";
......@@ -609,7 +608,7 @@ class Propal
}
else
{
print $this->db->error() . ' in ' . $sql;
dolibarr_print_error($this->db);
}
}
......@@ -647,13 +646,16 @@ class Propal
}
else
{
print $this->db->error() . ' in ' . $sql;
dolibarr_print_error($this->db);
}
}
/**
*
*
* \brief Renvoi la liste des propal (ventuellement filtre sur un user) dans un tableau
* \param brouillon 0=non brouillon, 1=brouillon
* \param user Objet user de filtre
* \return int -1 si erreur, tableau rsultat si ok
*/
function liste_array ($brouillon=0, $user='')
......@@ -661,7 +663,8 @@ class Propal
$ga = array();
$sql = "SELECT rowid, ref FROM ".MAIN_DB_PREFIX."propal";
if ($brouillon = 1)
if ($brouillon)
{
$sql .= " WHERE fk_statut = 0";
if ($user)
......@@ -679,16 +682,17 @@ class Propal
$sql .= " ORDER BY datep DESC";
if ($this->db->query($sql) )
$result=$this->db->query($sql);
if ($result)
{
$nump = $this->db->num_rows();
$nump = $this->db->num_rows($result);
if ($nump)
{
$i = 0;
while ($i < $nump)
{
$obj = $this->db->fetch_object();
$obj = $this->db->fetch_object($result);
$ga[$obj->rowid] = $obj->ref;
$i++;
......@@ -698,7 +702,7 @@ class Propal
}
else
{
print $this->db->error();
return -1;
}
}
......@@ -732,7 +736,7 @@ class Propal
}
else
{
print $this->db->error();
dolibarr_print_error($this->db);
}
}
......@@ -779,7 +783,7 @@ class Propal
}
else
{
print $this->db->error() . ' in ' . $sql;
dolibarr_print_error($this->db);
return -1;
}
}
......@@ -832,7 +836,7 @@ class Propal
}
else
{
print $this->db->error();
dolibarr_print_error($this->db);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment