mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
Merge branch '1296-Barra-de-eventos---Vista-táctica-metaconsola-dev' into 'develop'
added filter by user groups See merge request !810
This commit is contained in:
commit
ab3b6838b9
@ -3882,6 +3882,20 @@ function reporting_get_event_histogram_meta ($width) {
|
|||||||
EVENT_CRIT_CRITICAL => COL_CRITICAL
|
EVENT_CRIT_CRITICAL => COL_CRITICAL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$user_groups = users_get_groups($config['id_user'], 'ER');
|
||||||
|
$user_groups_ids = array_keys($user_groups);
|
||||||
|
|
||||||
|
if (empty($user_groups)) {
|
||||||
|
$groups_condition = ' 1 = 0 ';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$groups_condition = ' id_grupo IN (' . implode(',', $user_groups_ids) . ') ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!check_acl ($config['id_user'], 0, "PM")) {
|
||||||
|
$groups_condition .= " AND id_grupo != 0";
|
||||||
|
}
|
||||||
|
|
||||||
$cont = 0;
|
$cont = 0;
|
||||||
for ($i = 0; $i < $interval; $i++) {
|
for ($i = 0; $i < $interval; $i++) {
|
||||||
$bottom = $datelimit + ($periodtime * $i);
|
$bottom = $datelimit + ($periodtime * $i);
|
||||||
@ -3912,7 +3926,8 @@ function reporting_get_event_histogram_meta ($width) {
|
|||||||
$event = db_get_row_filter ('tmetaconsole_event',
|
$event = db_get_row_filter ('tmetaconsole_event',
|
||||||
array (
|
array (
|
||||||
'utimestamp > '.$bottom,
|
'utimestamp > '.$bottom,
|
||||||
'utimestamp < '.$top),
|
'utimestamp < '.$top,
|
||||||
|
$groups_condition),
|
||||||
'criticity, utimestamp');
|
'criticity, utimestamp');
|
||||||
|
|
||||||
if (!empty($event['utimestamp'])) {
|
if (!empty($event['utimestamp'])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user