This commit is contained in:
Laurent Destailleur 2011-06-15 08:39:03 +00:00
parent 4652b87c8a
commit b023117fc6
2 changed files with 45 additions and 45 deletions

View File

@ -404,7 +404,6 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
$var=!$var; $var=!$var;
} }
print "</table><br>";
$db->free($resql); $db->free($resql);
} }
@ -412,6 +411,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
{ {
print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("None").'</td></tr>'; print '<tr '.$bc[$var].'><td colspan="3">'.$langs->trans("None").'</td></tr>';
} }
print "</table><br>";
} }
} }

View File

@ -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 = "SELECT a.id, a.label, a.datep as dp, a.fk_user_author, a.percent,";
$sql.= " c.code, c.libelle,"; $sql.= " c.code, c.libelle,";
$sql.= " s.nom as sname, s.rowid, s.client"; $sql.= " s.nom as sname, s.rowid, s.client";
$sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a"; $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,";
$sql.= ", ".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"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ")"; $sql.= ")";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")"; $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) if ($resql)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
if ($num > 0)
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("LastActionsToDo",$max).'</td>';
print '<td colspan="2" align="right"><a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?status=todo">'.$langs->trans("FullList").'</a>';
print '</tr>';
$var = true;
$i = 0;
$staticaction=new ActionComm($db); print '<table class="noborder" width="100%">';
$customerstatic=new Client($db); print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("LastActionsToDo",$max).'</td>';
print '<td colspan="2" align="right"><a href="'.DOL_URL_ROOT.'/comm/action/listactions.php?status=todo">'.$langs->trans("FullList").'</a>';
print '</tr>';
while ($i < $num) $var = true;
{ $i = 0;
$obj = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'>'; $staticaction=new ActionComm($db);
$customerstatic=new Client($db);
$staticaction->type_code=$obj->code; while ($i < $num)
$staticaction->libelle=$obj->label; {
$staticaction->id=$obj->id; $obj = $db->fetch_object($resql);
print '<td>'.$staticaction->getNomUrl(1,34).'</td>'; $var=!$var;
// print '<td>'.dol_trunc($obj->label,22).'</td>'; print '<tr '.$bc[$var].'>';
print '<td>'; $staticaction->type_code=$obj->code;
if ($obj->rowid > 0) $staticaction->libelle=$obj->label;
$staticaction->id=$obj->id;
print '<td>'.$staticaction->getNomUrl(1,34).'</td>';
// print '<td>'.dol_trunc($obj->label,22).'</td>';
print '<td>';
if ($obj->rowid > 0)
{ {
$customerstatic->id=$obj->rowid; $customerstatic->id=$obj->rowid;
$customerstatic->name=$obj->sname; $customerstatic->name=$obj->sname;
@ -186,28 +186,28 @@ function show_array_actions_to_do($max=5)
} }
print '</td>'; print '</td>';
$datep=$db->jdate($obj->dp); $datep=$db->jdate($obj->dp);
$datep2=$db->jdate($obj->dp2); $datep2=$db->jdate($obj->dp2);
// Date // Date
print '<td width="100" align="right">'.dol_print_date($datep,'day').'&nbsp;'; print '<td width="100" align="right">'.dol_print_date($datep,'day').'&nbsp;';
$late=0; $late=0;
if ($obj->percent == 0 && $datep && $datep < time()) $late=1; if ($obj->percent == 0 && $datep && $datep < time()) $late=1;
if ($obj->percent == 0 && ! $datep && $datep2 && $datep2 < 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 && $datep2 < time()) $late=1;
if ($obj->percent > 0 && $obj->percent < 100 && ! $datep2 && $datep && $datep < time()) $late=1; if ($obj->percent > 0 && $obj->percent < 100 && ! $datep2 && $datep && $datep < time()) $late=1;
if ($late) print img_warning($langs->trans("Late")); if ($late) print img_warning($langs->trans("Late"));
print "</td>"; print "</td>";
// Statut // Statut
print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent,3)."</td>\n"; print "<td align=\"right\" width=\"14\">".$staticaction->LibStatut($obj->percent,3)."</td>\n";
print "</tr>\n"; print "</tr>\n";
$i++;
}
print "</table><br>";
$i++;
}
print "</table><br>";
}
$db->free($resql); $db->free($resql);
} }
else 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 = "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.= " c.code, c.libelle,";
$sql.= " s.rowid, s.nom as sname, s.client"; $sql.= " s.rowid, s.nom as sname, s.client";
$sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a"; $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,";
$sql.= ", ".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"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.=")"; $sql.=")";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid AND s.entity IN (0, ".$conf->entity.")";