mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-14 17:34:59 +02:00
Fixed grouped comments with id_agent
This commit is contained in:
parent
7918b883aa
commit
64e08d7124
@ -128,14 +128,23 @@ if ($get_comments === true) {
|
|||||||
} else {
|
} else {
|
||||||
// Consider if the event is grouped.
|
// Consider if the event is grouped.
|
||||||
if (isset($event['event_rep']) === true && $event['event_rep'] > 0) {
|
if (isset($event['event_rep']) === true && $event['event_rep'] > 0) {
|
||||||
|
// Evaluate if we are in metaconsole or not.
|
||||||
$eventTable = (is_metaconsole() === true) ? 'tmetaconsole_event' : 'tevento';
|
$eventTable = (is_metaconsole() === true) ? 'tmetaconsole_event' : 'tevento';
|
||||||
|
// Default grouped message filtering.
|
||||||
|
$whereGrouped = sprintf('`evento` = "%s"', io_safe_output($event['evento']));
|
||||||
|
// If id_agente is reported, filter the messages by them as well.
|
||||||
|
if ((int) $event['id_agente'] > 0) {
|
||||||
|
$whereGrouped .= sprintf(' AND `id_agente` = "%s"', $event['id_agente']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get grouped comments.
|
||||||
$eventsGrouped = db_get_all_rows_sql(
|
$eventsGrouped = db_get_all_rows_sql(
|
||||||
sprintf(
|
sprintf(
|
||||||
'SELECT `user_comment`
|
'SELECT `user_comment`
|
||||||
FROM `%s`
|
FROM `%s`
|
||||||
WHERE `evento` = "%s"',
|
WHERE %s',
|
||||||
$eventTable,
|
$eventTable,
|
||||||
io_safe_output($event['evento'])
|
$whereGrouped
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user