Skip to content
Snippets Groups Projects
Commit 1efedbda authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix badge on project tab

parent 2e372ced
Branches
No related tags found
No related merge requests found
...@@ -88,6 +88,26 @@ function societe_prepare_head(Societe $object) ...@@ -88,6 +88,26 @@ function societe_prepare_head(Societe $object)
{ {
$head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Projects"); $head[$h][1] = $langs->trans("Projects");
$nbNote = 0;
$sql = "SELECT COUNT(n.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as n";
$sql.= " WHERE fk_soc = ".$object->id;
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$nbNote=$obj->nb;
$i++;
}
}
else {
dol_print_error($db);
}
if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
$head[$h][2] = 'project'; $head[$h][2] = 'project';
$h++; $h++;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment