add status filter alert list

This commit is contained in:
marcos 2021-01-22 14:15:26 +01:00
parent d9309616c4
commit dc455636d9
2 changed files with 7 additions and 4 deletions

View File

@ -146,11 +146,9 @@ $form_filter .= html_print_select_groups(false, 'AR', $return_all_group, 'ag_gro
$form_filter .= '</td></tr>';
$alert_status_filter = [];
$alert_status_filter['all_enabled'] = __('All (Enabled)');
$alert_status_filter['all'] = __('All');
$alert_status_filter['fired'] = __('Fired');
$alert_status_filter['notfired'] = __('Not fired');
$alert_status_filter['disabled'] = __('Disabled');
$form_filter .= "<tr><td style='font-weight: bold;'>".__('Status').'</td><td>';
$form_filter .= html_print_select($alert_status_filter, 'status_alert', $status_alert, '', '', '', true);
@ -187,8 +185,12 @@ $total = 0;
$where = '';
if ($searchFlag) {
if ($status_alert != -1 && $status_alert != '') {
$where .= ' ';
if ($status_alert == 'fired' && $status_alert != 'all') {
$where .= ' AND id_alert_template IN (SELECT id FROM talert_template_modules WHERE times_fired > 0)';
}
if ($status_alert == 'notfired' && $status_alert != 'all') {
$where .= ' AND id_alert_template IN (SELECT id FROM talert_template_modules WHERE times_fired = 0)';
}
if ($priority != -1 && $priority != '') {

View File

@ -65,6 +65,7 @@ $searchType = get_parameter('search_type', '');
$priority = get_parameter('priority', '');
$searchFlag = get_parameter('search', 0);
$enabledisable = get_parameter('enabledisable', '');
$status_alert = get_parameter('status_alert', '');
$standby = get_parameter('standby', '');
$pure = get_parameter('pure', 0);
$ag_group = get_parameter('ag_group', 0);