mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch 'ent-8939-Cambiar-comportamiento-de-los-comentarios-en-eventos-rendimiento' into 'develop'
Ent 8939 cambiar comportamiento de los comentarios en eventos rendimiento See merge request artica/pandorafms!4889
This commit is contained in:
commit
a257f43d49
@ -1424,16 +1424,19 @@ function events_get_all(
|
|||||||
$group_selects = '';
|
$group_selects = '';
|
||||||
if ($group_by != '') {
|
if ($group_by != '') {
|
||||||
if ($count === false) {
|
if ($count === false) {
|
||||||
$group_selects = ',COUNT(id_evento) AS event_rep,
|
|
||||||
GROUP_CONCAT(DISTINCT user_comment SEPARATOR "<br>") AS comments,
|
|
||||||
MAX(utimestamp) as timestamp_last,
|
|
||||||
MIN(utimestamp) as timestamp_first,
|
|
||||||
MAX(id_evento) as max_id_evento';
|
|
||||||
|
|
||||||
$idx = array_search('te.user_comment', $fields);
|
$idx = array_search('te.user_comment', $fields);
|
||||||
if ($idx !== false) {
|
if ($idx !== false) {
|
||||||
unset($fields[$idx]);
|
unset($fields[$idx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$group_selects = sprintf(
|
||||||
|
',COUNT(id_evento) AS event_rep,
|
||||||
|
%s
|
||||||
|
MAX(utimestamp) as timestamp_last,
|
||||||
|
MIN(utimestamp) as timestamp_first,
|
||||||
|
MAX(id_evento) as max_id_evento',
|
||||||
|
($idx !== false) ? 'GROUP_CONCAT(DISTINCT user_comment SEPARATOR "<br>") AS comments,' : ''
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$idx = array_search('te.user_comment', $fields);
|
$idx = array_search('te.user_comment', $fields);
|
||||||
|
@ -615,6 +615,10 @@ class EventsListWidget extends Widget
|
|||||||
$fields = $default_fields;
|
$fields = $default_fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($filter['search']) === false || empty($filter['user_comment']) === false) {
|
||||||
|
$fields[] = 'user_comment';
|
||||||
|
}
|
||||||
|
|
||||||
// Get column names.
|
// Get column names.
|
||||||
$column_names = events_get_column_names($fields, true);
|
$column_names = events_get_column_names($fields, true);
|
||||||
|
|
||||||
|
@ -284,7 +284,6 @@ if (is_ajax() === true) {
|
|||||||
'te.event_type',
|
'te.event_type',
|
||||||
'te.id_alert_am',
|
'te.id_alert_am',
|
||||||
'te.criticity',
|
'te.criticity',
|
||||||
'te.user_comment',
|
|
||||||
'te.tags',
|
'te.tags',
|
||||||
'te.source',
|
'te.source',
|
||||||
'te.id_extra',
|
'te.id_extra',
|
||||||
@ -301,6 +300,13 @@ if (is_ajax() === true) {
|
|||||||
'ta.direccion',
|
'ta.direccion',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (strpos($config['event_fields'], 'user_comment') !== false
|
||||||
|
|| empty($user_comment) === false
|
||||||
|
|| empty($search) === false
|
||||||
|
) {
|
||||||
|
$fields[] = 'te.user_comment';
|
||||||
|
}
|
||||||
|
|
||||||
$order = get_datatable_order(true);
|
$order = get_datatable_order(true);
|
||||||
|
|
||||||
if (is_array($order) === true && $order['field'] === 'mini_severity') {
|
if (is_array($order) === true && $order['field'] === 'mini_severity') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user