#12268 dashboard widget events redirect event view

This commit is contained in:
Jonathan 2023-11-02 17:13:16 +01:00
parent c9149d04d9
commit ab6aa1ba57
2 changed files with 18 additions and 2 deletions

View File

@ -1739,3 +1739,8 @@ function loadModal() {
}
}
window.onload = loadModal;
function openEvents(severity) {
$('input[name="filter[severity]"]').val(severity);
$("#event_redirect").submit();
}

View File

@ -530,6 +530,16 @@ class EventCardboard extends Widget
);
}
$output .= '<form style="display: none" action="'.ui_get_full_url('index.php?sec=eventos&sec2=operation/events/events').'" method="POST" id="event_redirect">';
$output .= html_print_input_hidden('filter[event_type]', $this->values['eventType'], true, false, false, 'filter[event_type]');
$output .= html_print_input_hidden('filter[event_view_hr]', $this->values['maxHours'], true, false, false, 'filter[event_view_hr]');
$output .= html_print_input_hidden('filter[status]', $this->values['eventStatus'], true, false, false, 'filter[status]');
$output .= html_print_input_hidden('filter[id_group_filter]', $this->values['groupId'][0], true, false, false, 'filter[id_group_filter]');
$output .= html_print_input_hidden('filter[severity]', '', true, false, false, 'filter[severity]');
$output .= html_print_input_hidden('get_events', '1', true, false, false, 'get_events');
$output .= html_print_input_hidden('filter[tag_with]', 'WyIwIl0=', true, false, false, 'filter[tag_with]');
$output .= html_print_input_hidden('filter[tag_without]', 'WyIwIl0=', true, false, false, 'filter[tag_without]');
$output .= '</form>';
$output .= '<table class="w100p h100p table-border-0 event-cardboard-widget"><tbody><tr>';
$width_td = (100 / count(explode(',', $severity)));
@ -543,7 +553,8 @@ class EventCardboard extends Widget
}
}
switch ((int) $key) {
$severity_row = (int) $key;
switch ($severity_row) {
case 0:
$text = __('Maintenance');
$color = get_priority_class((int) $key);
@ -604,7 +615,7 @@ class EventCardboard extends Widget
$border = ' border-right: 1px solid white; border-collapse: collapse;';
}
$output .= '<td class="'.$color.'" style="width: '.$width_td.'%;'.$border.'"><span class="med_data">';
$output .= '<td class="'.$color.'" style="width: '.$width_td.'%;'.$border.'" onclick="openEvents('.$severity_row.')"><span class="med_data">';
$output .= $count;
$output .= '</span><br>';
$output .= $text;