diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 63ccd938d02..83e2ccc5b29 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -266,14 +266,14 @@ print ''; * */ -$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.label, ".$db->pdate("a.datea")." as da, c.code, c.libelle, a.fk_user_author, s.nom as sname, s.idp"; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE c.id=a.fk_action AND a.percent < 100 AND s.idp = a.fk_soc"; if ($socidp) { $sql .= " AND s.idp = $socidp"; } -$sql .= " ORDER BY a.datea ASC"; +$sql .= " ORDER BY a.datea DESC, a.id DESC"; $resql=$db->query($sql); if ($resql) @@ -282,7 +282,7 @@ if ($resql) if ($num > 0) { print ''; - print ''; + print ''; $var = true; $i = 0; @@ -292,18 +292,37 @@ if ($resql) $var=!$var; print ""; + if ($oldyear == strftime("%Y",$obj->da) ) + { + print ''; + } + else + { + print '\n"; + $oldyear = strftime("%Y",$obj->da); + } + + if ($oldmonth == strftime("%Y%b",$obj->da) ) + { + print ''; + } + else + { + print '\n"; + $oldmonth = strftime("%Y%b",$obj->da); + } + + print '\n"; + if (date("U",$obj->da) < time()) + { + print ""; + } print "'; - - print '"; + print ""; print ''; $i++;
'.$langs->trans("ActionsToDo").'
'.$langs->trans("ActionsToDo").'
|'.strftime("%Y",$obj->da)."|' .strftime("%b",$obj->da)."'.strftime("%d",$obj->da)."".img_warning("Late")."id\">".img_object($langs->trans("ShowTask"),"task"); $transcode=$langs->trans("Action".$obj->code); $libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle); print $libelle; print ''. dolibarr_print_date($obj->da); - if (date("U",$obj->da) < time()) - { - print img_warning("Late"); - } - print "$obj->label'.img_object($langs->trans("ShowCustomer"),"company").' '.$obj->sname.'