diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index ab70b430173..a1552e0885e 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -447,9 +447,9 @@ if ($conf->contrat->enabled && 0) // \todo A REFAIRE DEPUIS NOUVEAU CONTRAT
*/
if ($conf->propal->enabled && $user->rights->propale->lire)
{
- $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
- $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
- $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut = 1";
+ $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp";
+ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
+ $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = 1";
if ($socidp) $sql .= " AND s.idp = $socidp";
$sql .= " ORDER BY p.rowid DESC";
@@ -470,7 +470,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
$obj = $db->fetch_object($result);
$var=!$var;
print "
| propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref." | ";
- print "idp\">".img_object($langs->trans("ShowCompany"),"company")." ".dolibarr_trunc($obj->nom,40)." | \n";
+ print "idp\">".img_object($langs->trans("ShowCompany"),"company")." ".dolibarr_trunc($obj->nom,44)." | \n";
print "";
print dolibarr_print_date($obj->dp)." | \n";
print "".price($obj->price)." |
\n";
@@ -497,9 +497,9 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
if ($conf->propal->enabled && $user->rights->propale->lire) {
$NBMAX=5;
- $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
- $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
- $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.fk_statut > 1";
+ $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp";
+ $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
+ $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut > 1";
if ($socidp)
{
$sql .= " AND s.idp = $socidp";
@@ -507,6 +507,9 @@ if ($conf->propal->enabled && $user->rights->propale->lire) {
$sql .= " ORDER BY p.rowid DESC";
$sql .= $db->plimit($NBMAX, 0);
+ include_once("../propal.class.php");
+ $propalstatic=new Propal($db);
+
if ( $db->query($sql) )
{
$num = $db->num_rows();
@@ -522,7 +525,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) {
print '';
print ''.img_object($langs->trans("ShowPropal"),"propal").' ';
print $objp->ref.' | ';
- print ''.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,40).' | ';
+ print ''.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).' | ';
$now = time();
$lim = 3600 * 24 * 15 ;
@@ -538,7 +541,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) {
print "";
print dolibarr_print_date($objp->dp)." | \n";
print "".price($objp->price)." | \n";
- print "$objp->statut | \n";
+ print "".$propalstatic->LibStatut($objp->fk_statut)." | \n";
print "\n";
$i++;
$var=!$var;