mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
fixed secondary group in events
This commit is contained in:
parent
2469b65192
commit
fad70cfdc0
@ -1042,6 +1042,8 @@ function events_get_all(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$user_admin_group_all = ($user_is_admin && $groups == 0) ? '' : 'tasg.';
|
||||||
|
|
||||||
// TAgs ACLS.
|
// TAgs ACLS.
|
||||||
if (check_acl($config['id_user'], 0, 'ER')) {
|
if (check_acl($config['id_user'], 0, 'ER')) {
|
||||||
$tags_acls_condition = tags_get_acl_tags(
|
$tags_acls_condition = tags_get_acl_tags(
|
||||||
@ -1066,7 +1068,7 @@ function events_get_all(
|
|||||||
// Table tag for id_grupo.
|
// Table tag for id_grupo.
|
||||||
'te.',
|
'te.',
|
||||||
// Alt table tag for id_grupo.
|
// Alt table tag for id_grupo.
|
||||||
'tasg.'
|
$user_admin_group_all
|
||||||
);
|
);
|
||||||
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
|
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
|
||||||
} else if (check_acl($config['id_user'], 0, 'EW')) {
|
} else if (check_acl($config['id_user'], 0, 'EW')) {
|
||||||
@ -1092,7 +1094,7 @@ function events_get_all(
|
|||||||
// Table tag for id_grupo.
|
// Table tag for id_grupo.
|
||||||
'te.',
|
'te.',
|
||||||
// Alt table tag for id_grupo.
|
// Alt table tag for id_grupo.
|
||||||
'tasg.'
|
$user_admin_group_all
|
||||||
);
|
);
|
||||||
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
|
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
|
||||||
} else if (check_acl($config['id_user'], 0, 'EM')) {
|
} else if (check_acl($config['id_user'], 0, 'EM')) {
|
||||||
@ -1118,7 +1120,7 @@ function events_get_all(
|
|||||||
// Table tag for id_grupo.
|
// Table tag for id_grupo.
|
||||||
'te.',
|
'te.',
|
||||||
// Alt table tag for id_grupo.
|
// Alt table tag for id_grupo.
|
||||||
'tasg.'
|
$user_admin_group_all
|
||||||
);
|
);
|
||||||
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
|
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
|
||||||
}
|
}
|
||||||
@ -1228,8 +1230,11 @@ function events_get_all(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Secondary groups.
|
// Secondary groups.
|
||||||
db_process_sql('SET group_concat_max_len = 9999999');
|
$event_lj = '';
|
||||||
$event_lj = events_get_secondary_groups_left_join($table);
|
if (!$user_is_admin || ($user_is_admin && isset($groups) && $groups > 0)) {
|
||||||
|
db_process_sql('SET group_concat_max_len = 9999999');
|
||||||
|
$event_lj = events_get_secondary_groups_left_join($table);
|
||||||
|
}
|
||||||
|
|
||||||
$group_selects = '';
|
$group_selects = '';
|
||||||
if ($group_by != '') {
|
if ($group_by != '') {
|
||||||
|
@ -308,14 +308,13 @@ function groups_get_children($parent, $ignorePropagate=false)
|
|||||||
static $groups;
|
static $groups;
|
||||||
|
|
||||||
if (empty($groups)) {
|
if (empty($groups)) {
|
||||||
|
$aux_groups = [];
|
||||||
$groups = db_get_all_rows_in_table('tgrupo');
|
$groups = db_get_all_rows_in_table('tgrupo');
|
||||||
$groups = array_reduce(
|
foreach ($groups as $key => $value) {
|
||||||
$groups,
|
$aux_groups[$value['id_grupo']] = $value;
|
||||||
function ($carry, $item) {
|
}
|
||||||
$carry[$item['id_grupo']] = $item;
|
|
||||||
return $carry;
|
$groups = $aux_groups;
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$return = [];
|
$return = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user