mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
#12376 fixed only enabled alerts in tactical view
This commit is contained in:
parent
7223423dc7
commit
3132fabef9
@ -22,7 +22,7 @@ require_once $config['homedir'].'/include/functions_modules.php';
|
|||||||
require_once $config['homedir'].'/include/functions_users.php';
|
require_once $config['homedir'].'/include/functions_users.php';
|
||||||
|
|
||||||
|
|
||||||
function alerts_get_alerts($id_group=0, $free_search='', $status='all', $standby=-1, $acl=false, $total=false, $id_agent=0)
|
function alerts_get_alerts($id_group=0, $free_search='', $status='all', $standby=-1, $acl=false, $total=false, $id_agent=0, $only_enabled=false)
|
||||||
{
|
{
|
||||||
$sql = '';
|
$sql = '';
|
||||||
$alerts = [];
|
$alerts = [];
|
||||||
@ -121,6 +121,10 @@ function alerts_get_alerts($id_group=0, $free_search='', $status='all', $standby
|
|||||||
// Only enabled agent.
|
// Only enabled agent.
|
||||||
$sql .= ' AND t3.disabled = 0';
|
$sql .= ' AND t3.disabled = 0';
|
||||||
|
|
||||||
|
if ($only_enabled === true) {
|
||||||
|
$sql .= ' AND t0.disabled = 0';
|
||||||
|
}
|
||||||
|
|
||||||
$row_alerts = db_get_all_rows_sql($sql);
|
$row_alerts = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
if ($total) {
|
if ($total) {
|
||||||
|
@ -83,7 +83,7 @@ class Alerts extends Element
|
|||||||
*/
|
*/
|
||||||
public function getActiveAlerts():string
|
public function getActiveAlerts():string
|
||||||
{
|
{
|
||||||
$total = alerts_get_alerts(0, '', 'all', -1, 'AR', true);
|
$total = alerts_get_alerts(0, '', 'all', -1, 'AR', true, 0, true);
|
||||||
return html_print_div(
|
return html_print_div(
|
||||||
[
|
[
|
||||||
'content' => format_numeric($total, 0),
|
'content' => format_numeric($total, 0),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user