mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
#10637 Fix all group view
This commit is contained in:
parent
330f36a3cf
commit
fa2d3ec2e5
@ -2582,30 +2582,55 @@ function reporting_html_group_report($table, $item, $pdf=0)
|
|||||||
$table->colspan['group_report']['cell'] = 3;
|
$table->colspan['group_report']['cell'] = 3;
|
||||||
$table->cellstyle['group_report']['cell'] = 'text-align: center;';
|
$table->cellstyle['group_report']['cell'] = 'text-align: center;';
|
||||||
|
|
||||||
$group_id = db_get_value('id_grupo', 'tgrupo', 'nombre', $item['subtitle']);
|
if ($item['subtitle'] === 'All') {
|
||||||
$description = db_get_value('description', 'tgrupo', 'id_grupo', $group_id);
|
$group_id = [];
|
||||||
$icon_url = db_get_value('icon', 'tgrupo', 'id_grupo', $group_id);
|
$all_group_id = db_get_all_rows_sql('SELECT id_grupo FROM tgrupo');
|
||||||
$icon = html_print_image(
|
|
||||||
'images/'.$icon_url,
|
|
||||||
true,
|
|
||||||
[
|
|
||||||
'title' => $item['subtitle'],
|
|
||||||
'class' => 'main_menu_icon invert_filter',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
$group_events = db_get_all_rows_sql(
|
foreach ($all_group_id as $group) {
|
||||||
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
$group_id[] = $group['id_grupo'];
|
||||||
FROM tevento as te
|
}
|
||||||
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente WHERE te.id_grupo = '.$group_id.'
|
|
||||||
GROUP BY te.id_agente'
|
|
||||||
);
|
|
||||||
|
|
||||||
$group_os = db_get_all_rows_sql(
|
$description = __('Data view of all groups');
|
||||||
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
$icon = '';
|
||||||
FROM tconfig_os as os
|
|
||||||
INNER JOIN tagente as ta ON ta.id_os = os.id_os WHERE ta.id_grupo = '.$group_id.' GROUP by os.name'
|
$group_events = db_get_all_rows_sql(
|
||||||
);
|
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||||
|
FROM tevento as te
|
||||||
|
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente
|
||||||
|
GROUP BY te.id_agente'
|
||||||
|
);
|
||||||
|
|
||||||
|
$group_os = db_get_all_rows_sql(
|
||||||
|
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||||
|
FROM tconfig_os as os
|
||||||
|
INNER JOIN tagente as ta ON ta.id_os = os.id_os GROUP by os.name'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$group_id = db_get_value('id_grupo', 'tgrupo', 'nombre', $item['subtitle']);
|
||||||
|
$description = db_get_value('description', 'tgrupo', 'id_grupo', $group_id);
|
||||||
|
$icon_url = db_get_value('icon', 'tgrupo', 'id_grupo', $group_id);
|
||||||
|
$icon = html_print_image(
|
||||||
|
'images/'.$icon_url,
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'title' => $item['subtitle'],
|
||||||
|
'class' => 'main_menu_icon invert_filter',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$group_events = db_get_all_rows_sql(
|
||||||
|
'SELECT COUNT(te.id_evento) as count_events, ta.alias
|
||||||
|
FROM tevento as te
|
||||||
|
INNER JOIN tagente as ta ON te.id_agente = ta.id_agente WHERE te.id_grupo = '.$group_id.'
|
||||||
|
GROUP BY te.id_agente'
|
||||||
|
);
|
||||||
|
|
||||||
|
$group_os = db_get_all_rows_sql(
|
||||||
|
'SELECT COUNT(os.name) as count_os, os.name as name_os, ta.id_grupo
|
||||||
|
FROM tconfig_os as os
|
||||||
|
INNER JOIN tagente as ta ON ta.id_os = os.id_os WHERE ta.id_grupo = '.$group_id.' GROUP by os.name'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$graph_width = 180;
|
$graph_width = 180;
|
||||||
$graph_height = 200;
|
$graph_height = 200;
|
||||||
@ -2622,7 +2647,7 @@ function reporting_html_group_report($table, $item, $pdf=0)
|
|||||||
$out .= '<tr>';
|
$out .= '<tr>';
|
||||||
$out .= '<td style="word-wrap:break-word; text-align: left;">
|
$out .= '<td style="word-wrap:break-word; text-align: left;">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>'.__('Description').'</legend>'.$description.'</fieldset>
|
<legend>'.__('Group Description').'</legend>'.$description.'</fieldset>
|
||||||
</td>';
|
</td>';
|
||||||
|
|
||||||
$out .= '<td>';
|
$out .= '<td>';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user