Ajout du compteur des commentaires

This commit is contained in:
Rodolphe Quiedeville 2005-11-22 13:00:45 +00:00
parent c26788fb1f
commit 6cc5bed772

View File

@ -49,6 +49,21 @@ if ($_GET["id"])
{
if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
{
/* Commentaires */
$sql = "SELECT c.commentaire, ".$db->pdate("c.datec") ." as datec";
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_commentaire as c";
$sql .= " WHERE fk_soc = ".$soc->id;
$sql .= " ORDER BY c.datec DESC";
$resql = $db->query($sql);
if ($resql)
{
$num_comments = $db->num_rows($resql);
$db->free($resql);
}
/* Fin Commentaires */
$h=0;
$head[$h][0] = DOL_URL_ROOT."/telephonie/client/fiche.php?id=".$soc->id;
$head[$h][1] = $langs->trans("Contrats");
@ -81,6 +96,14 @@ if ($_GET["id"])
$head[$h][1] = $langs->trans("Tarifs (".$row[0].")");
$h++;
$head[$h][0] = DOL_URL_ROOT."/telephonie/client/commentaires.php?id=".$soc->id;
$head[$h][1] = $langs->trans("Commentaires");
if ($num_comments > 0)
{
$head[$h][1] = $langs->trans("Commentaires ($num_comments)");
}
$h++;
if ($soc->perm_perms)
{
$head[$h][0] = DOL_URL_ROOT."/telephonie/client/permissions.php?id=".$soc->id;