Fix: count of notification emails was wrong
This commit is contained in:
parent
c1432eb2da
commit
dfe1ee7e7d
@ -54,7 +54,7 @@ MaxSize=Maximum size
|
|||||||
AttachANewFile=Attach a new file/document
|
AttachANewFile=Attach a new file/document
|
||||||
LinkedObject=Linked object
|
LinkedObject=Linked object
|
||||||
Miscellaneous=Miscellaneous
|
Miscellaneous=Miscellaneous
|
||||||
NbOfActiveNotifications=Number of notifications
|
NbOfActiveNotifications=Number of notifications (nb of recipient emails)
|
||||||
PredefinedMailTest=This is a test mail.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__
|
PredefinedMailTest=This is a test mail.\nThe two lines are separated by a carriage return.\n\n__SIGNATURE__
|
||||||
PredefinedMailTestHtml=This is a <b>test</b> mail (the word test must be in bold).<br>The two lines are separated by a carriage return.<br><br>__SIGNATURE__
|
PredefinedMailTestHtml=This is a <b>test</b> mail (the word test must be in bold).<br>The two lines are separated by a carriage return.<br><br>__SIGNATURE__
|
||||||
PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
PredefinedMailContentSendInvoice=__CONTACTCIVNAME__\n\nYou will find here the invoice __FACREF__\n\n__PERSONALIZED__Sincerely\n\n__SIGNATURE__
|
||||||
|
|||||||
@ -169,6 +169,8 @@ if ($result > 0)
|
|||||||
|
|
||||||
print '<tr><td>'.$langs->trans("NbOfActiveNotifications").'</td>';
|
print '<tr><td>'.$langs->trans("NbOfActiveNotifications").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
|
$nb=0;
|
||||||
|
// List of per contact notifications
|
||||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n";
|
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n";
|
||||||
$sql.= " WHERE fk_soc = ".$object->id;
|
$sql.= " WHERE fk_soc = ".$object->id;
|
||||||
@ -187,6 +189,13 @@ if ($result > 0)
|
|||||||
else {
|
else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
|
// List of notifications enabled for fixed email
|
||||||
|
foreach($conf->global as $key => $val)
|
||||||
|
{
|
||||||
|
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
|
||||||
|
$listtmp=explode(',',$val);
|
||||||
|
$nb+=count($listtmp);
|
||||||
|
}
|
||||||
print $nb;
|
print $nb;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -273,16 +282,21 @@ if ($result > 0)
|
|||||||
foreach($conf->global as $key => $val)
|
foreach($conf->global as $key => $val)
|
||||||
{
|
{
|
||||||
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
|
if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
|
||||||
//print $key.' - '.$val.' - '.$reg[1].'<br>';
|
print '<tr '.$bc[$var].'><td>';
|
||||||
print '<tr '.$bc[$var].'><td>'.$val;
|
$listtmp=explode(',',$val);
|
||||||
if (isValidEmail($val))
|
foreach($listtmp as $keyemail => $valemail)
|
||||||
{
|
{
|
||||||
print ' <'.$val.'>';
|
$valemail=trim($valemail);
|
||||||
|
//print $keyemail.' - '.$valemail.' - '.$reg[1].'<br>';
|
||||||
|
if (isValidEmail($valemail))
|
||||||
|
{
|
||||||
|
print ' <'.$valemail.'>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$val);
|
print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user