diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 4807b4d6112..60346217c79 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -30,6 +30,7 @@
require("./pre.inc.php");
if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
+require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
if (!$user->rights->commercial->main->lire)
accessforbidden();
@@ -300,39 +301,14 @@ if ($resql)
$var = true;
$i = 0;
+ $staticaction=new ActionComm($db);
+
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print "
";
- if ($oldyear == strftime("%Y",$obj->dp) )
- {
- print '| | | ';
- }
- else
- {
- print ''.strftime("%Y",$obj->dp)." | \n";
- $oldyear = strftime("%Y",$obj->dp);
- }
-
- if ($oldmonth == strftime("%Y%b",$obj->dp) )
- {
- print '| | ';
- }
- else
- {
- print '' .strftime("%b",$obj->dp)." | \n";
- $oldmonth = strftime("%Y%b",$obj->dp);
- }
-
- print ''.strftime("%d",$obj->dp)." | \n";
- if (date("U",$obj->dp) < time())
- {
- print "".img_warning($langs->trans("Late"))." | ";
- } else {
- print " | ";
- }
print "id\">".img_object($langs->trans("ShowTask"),"task");
$transcode=$langs->trans("Action".$obj->code);
$libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle);
@@ -341,6 +317,20 @@ if ($resql)
print " | $obj->label | ";
print ''.img_object($langs->trans("ShowCustomer"),"company").' '.$obj->sname.' | ';
+
+ // Date
+ print ''.dolibarr_print_date($obj->dp).' ';
+ if (date("U",$obj->dp) < time())
+ {
+ print img_warning($langs->trans("Late"));
+ }
+ print " | ";
+
+ // Statut
+ print "".$staticaction->LibStatut($obj->percent,3)." | \n";
+
+ print "
\n";
+
$i++;
}
// TODO Ajouter rappel pour "il y a des contrats à mettre en service"
@@ -359,7 +349,7 @@ else
* Dernières actions commerciales effectuées
*/
-$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.code, c.libelle, a.fk_user_author, s.nom as sname, s.idp";
+$sql = "SELECT a.id, a.percent, ".$db->pdate("a.datea")." as da, c.code, c.libelle, a.fk_user_author, s.nom as sname, s.idp";
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -381,10 +371,12 @@ if ($resql)
$num = $db->num_rows($resql);
print '';
- print '| '.$langs->trans("LastDoneTasks",$max).' |
';
+ print '| '.$langs->trans("LastDoneTasks",$max).' |
';
$var = true;
$i = 0;
+ $staticaction=new ActionComm($db);
+
while ($i < $num)
{
$obj = $db->fetch_object($resql);
@@ -397,8 +389,16 @@ if ($resql)
print $libelle;
print '';
- print "".dolibarr_print_date($obj->da)." | ";
print ''.img_object($langs->trans("ShowCustomer"),"company").' '.$obj->sname.' | ';
+
+ // Date
+ print ''.dolibarr_print_date($obj->da);
+ print " | ";
+
+ // Statut
+ print "".$staticaction->LibStatut($obj->percent,3)." | \n";
+
+ print "\n";
$i++;
}
// TODO Ajouter rappel pour "il y a des contrats à mettre en service"