diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 5af7abf8cd7..1be33b3efee 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -404,7 +404,6 @@ if ($conf->societe->enabled && $user->rights->societe->lire) $var=!$var; } - print "
"; $db->free($resql); } @@ -412,6 +411,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire) { print ''.$langs->trans("None").''; } + print "
"; } } diff --git a/htdocs/lib/agenda.lib.php b/htdocs/lib/agenda.lib.php index 1446b9e138d..91a96d0e6e2 100644 --- a/htdocs/lib/agenda.lib.php +++ b/htdocs/lib/agenda.lib.php @@ -134,8 +134,8 @@ function show_array_actions_to_do($max=5) $sql = "SELECT a.id, a.label, a.datep as dp, a.fk_user_author, a.percent,"; $sql.= " c.code, c.libelle,"; $sql.= " s.nom as sname, s.rowid, s.client"; - $sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a"; - $sql.= ", ".MAIN_DB_PREFIX."c_actioncomm as c"; + $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,"; + $sql.= " ".MAIN_DB_PREFIX."actioncomm as a"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ")"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")"; @@ -150,34 +150,34 @@ function show_array_actions_to_do($max=5) if ($resql) { $num = $db->num_rows($resql); - if ($num > 0) - { - print ''; - print ''; - print ''; - $var = true; - $i = 0; - $staticaction=new ActionComm($db); - $customerstatic=new Client($db); + print '
'.$langs->trans("LastActionsToDo",$max).''.$langs->trans("FullList").''; - print '
'; + print ''; + print ''; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var=!$var; + $var = true; + $i = 0; - print ''; + $staticaction=new ActionComm($db); + $customerstatic=new Client($db); + + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $var=!$var; - $staticaction->type_code=$obj->code; - $staticaction->libelle=$obj->label; - $staticaction->id=$obj->id; - print ''; + print ''; - // print ''; + $staticaction->type_code=$obj->code; + $staticaction->libelle=$obj->label; + $staticaction->id=$obj->id; + print ''; - print ''; + + print ''; - $datep=$db->jdate($obj->dp); - $datep2=$db->jdate($obj->dp2); + $datep=$db->jdate($obj->dp); + $datep2=$db->jdate($obj->dp2); - // Date - print '"; + // Date + print '"; - // Statut - print "\n"; + // Statut + print "\n"; - print "\n"; + print "\n"; + + $i++; + } + print "
'.$langs->trans("LastActionsToDo",$max).''.$langs->trans("FullList").''; + print '
'.$staticaction->getNomUrl(1,34).'
'.dol_trunc($obj->label,22).''.$staticaction->getNomUrl(1,34).''; - if ($obj->rowid > 0) + // print ''.dol_trunc($obj->label,22).''; + if ($obj->rowid > 0) { $customerstatic->id=$obj->rowid; $customerstatic->name=$obj->sname; @@ -186,28 +186,28 @@ function show_array_actions_to_do($max=5) } print ''.dol_print_date($datep,'day').' '; - $late=0; - if ($obj->percent == 0 && $datep && $datep < time()) $late=1; - if ($obj->percent == 0 && ! $datep && $datep2 && $datep2 < time()) $late=1; - if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) $late=1; - if ($obj->percent > 0 && $obj->percent < 100 && ! $datep2 && $datep && $datep < time()) $late=1; - if ($late) print img_warning($langs->trans("Late")); - print "'.dol_print_date($datep,'day').' '; + $late=0; + if ($obj->percent == 0 && $datep && $datep < time()) $late=1; + if ($obj->percent == 0 && ! $datep && $datep2 && $datep2 < time()) $late=1; + if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) $late=1; + if ($obj->percent > 0 && $obj->percent < 100 && ! $datep2 && $datep && $datep < time()) $late=1; + if ($late) print img_warning($langs->trans("Late")); + print "".$staticaction->LibStatut($obj->percent,3)."".$staticaction->LibStatut($obj->percent,3)."

"; - $i++; - } - print "
"; - } $db->free($resql); } else @@ -230,8 +230,8 @@ function show_array_last_actions_done($max=5) $sql = "SELECT a.id, a.percent, a.datep as da, a.datep2 as da2, a.fk_user_author, a.label,"; $sql.= " c.code, c.libelle,"; $sql.= " s.rowid, s.nom as sname, s.client"; - $sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a"; - $sql.= ", ".MAIN_DB_PREFIX."c_actioncomm as c"; + $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,"; + $sql.= " ".MAIN_DB_PREFIX."actioncomm as a"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.=")"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")";