New: Add number of active notification into tab title (like we do for
notes and documents)
This commit is contained in:
parent
f08759a17e
commit
65f47f7d10
@ -5,6 +5,7 @@ English Dolibarr ChangeLog
|
|||||||
|
|
||||||
***** ChangeLog for 3.7 compared to 3.6.* *****
|
***** ChangeLog for 3.7 compared to 3.6.* *****
|
||||||
For users:
|
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: Can add product into category from category card.
|
||||||
- New: PDF event report show project and status of event.
|
- New: PDF event report show project and status of event.
|
||||||
- New: Can filter on status on interventions.
|
- New: Can filter on status on interventions.
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
*/
|
*/
|
||||||
function societe_prepare_head($object)
|
function societe_prepare_head($object)
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $db, $langs, $conf, $user;
|
||||||
$h = 0;
|
$h = 0;
|
||||||
$head = array();
|
$head = array();
|
||||||
|
|
||||||
@ -109,8 +109,29 @@ function societe_prepare_head($object)
|
|||||||
// Notifications
|
// Notifications
|
||||||
if (! empty($conf->notification->enabled))
|
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][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Notifications");
|
$head[$h][1] = $langs->trans("Notifications");
|
||||||
|
if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
|
||||||
$head[$h][2] = 'notify';
|
$head[$h][2] = 'notify';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user