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

Look: Ajout picto sur statut commercial

parent 12fa5bf2
No related branches found
No related tags found
No related merge requests found
...@@ -528,6 +528,8 @@ if ($conf->contrat->enabled && 0) // \todo A REFAIRE DEPUIS NOUVEAU CONTRAT ...@@ -528,6 +528,8 @@ if ($conf->contrat->enabled && 0) // \todo A REFAIRE DEPUIS NOUVEAU CONTRAT
*/ */
if ($conf->propal->enabled && $user->rights->propale->lire) if ($conf->propal->enabled && $user->rights->propale->lire)
{ {
$langs->load("propal");
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp"; $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.fk_statut, ".$db->pdate("p.datep")." as dp";
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user"; if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
...@@ -560,7 +562,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) ...@@ -560,7 +562,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
print "<td align=\"right\">"; print "<td align=\"right\">";
print dolibarr_print_date($obj->dp)."</td>\n"; print dolibarr_print_date($obj->dp)."</td>\n";
print "<td align=\"right\">".price($obj->price)."</td>"; print "<td align=\"right\">".price($obj->price)."</td>";
print "<td align=\"center\">".$propalstatic->LibStatut($objp->fk_statut,3)."</td>\n"; print "<td align=\"center\">".$propalstatic->LibStatut($obj->fk_statut,3)."</td>\n";
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
$total += $obj->price; $total += $obj->price;
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/prospect.class.php");
$langs->load("propal"); $langs->load("propal");
...@@ -163,6 +164,8 @@ if ($resql) ...@@ -163,6 +164,8 @@ if ($resql)
$var=true; $var=true;
$prospectstatic=new Prospect($db);
while ($i < min($num,$conf->liste_limit)) while ($i < min($num,$conf->liste_limit))
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
...@@ -179,9 +182,7 @@ if ($resql) ...@@ -179,9 +182,7 @@ if ($resql)
print "<td align=\"center\">".dolibarr_print_date($obj->datec)."</td>"; print "<td align=\"center\">".dolibarr_print_date($obj->datec)."</td>";
// Statut // Statut
print "<td align=\"center\">"; print "<td align=\"center\">";
$transcode=$langs->trans("StatusProspect".$obj->fk_stcomm); print $prospectstatic->LibStatut($obj->fk_stcomm,2);
$libelle=($transcode!="StatusProspect".$obj->fk_stcomm?$transcode:$obj->stcomm);
print $libelle;
print "</td>"; print "</td>";
$sts = array(-1,0,1,2,3); $sts = array(-1,0,1,2,3);
......
...@@ -114,6 +114,14 @@ class Prospect extends Societe ...@@ -114,6 +114,14 @@ class Prospect extends Societe
global $langs; global $langs;
$langs->load('customers'); $langs->load('customers');
if ($mode == 2)
{
if ($statut == -1) return img_action(0,-1).' '.$langs->trans("StatusProspect-1");
if ($statut == 0) return img_action(0, 0).' '.$langs->trans("StatusProspect0");
if ($statut == 1) return img_action(0, 1).' '.$langs->trans("StatusProspect1");
if ($statut == 2) return img_action(0, 2).' '.$langs->trans("StatusProspect2");
if ($statut == 3) return img_action(0, 3).' '.$langs->trans("StatusProspect3");
}
if ($mode == 4) if ($mode == 4)
{ {
if ($statut == -1) return img_action(0,-1).' '.$langs->trans("StatusProspect-1"); if ($statut == -1) return img_action(0,-1).' '.$langs->trans("StatusProspect-1");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment