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

New: Add number of active notification into tab title (like we do for

notes and documents)
parent f08759a1
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* *****
For users:
- New: Add number of active notification into tab title (like we do for notes and documents)
- New: Can add product into category from category card.
- New: PDF event report show project and status of event.
- New: Can filter on status on interventions.
......
......@@ -37,7 +37,7 @@
*/
function societe_prepare_head($object)
{
global $langs, $conf, $user;
global $db, $langs, $conf, $user;
$h = 0;
$head = array();
......@@ -109,8 +109,29 @@ function societe_prepare_head($object)
// Notifications
if (! empty($conf->notification->enabled))
{
$nbNote = 0;
$sql = "SELECT COUNT(n.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def 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);
}
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Notifications");
if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
$head[$h][2] = 'notify';
$h++;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment