Add filter eventcardboard pandora_enterprise#11760

This commit is contained in:
daniel 2023-11-08 10:31:42 +01:00
parent 5bc1cb1862
commit 161b0e8a34
2 changed files with 36 additions and 10 deletions

View File

@ -6022,8 +6022,38 @@ function get_count_event_criticity(
} }
$status = ' '; $status = ' ';
if ((int) $eventStatus !== -1) { if (empty($eventStatus) === false) {
$status = 'AND estado = '.$eventStatus; switch ($eventStatus) {
case EVENT_ALL:
default:
// Do not filter.
break;
case EVENT_NEW:
case EVENT_VALIDATE:
case EVENT_PROCESS:
$status = sprintf(
' AND estado = %d',
$eventStatus
);
break;
case EVENT_NO_VALIDATED:
$status = sprintf(
' AND (estado = %d OR estado = %d)',
EVENT_NEW,
EVENT_PROCESS
);
break;
case EVENT_NO_PROCESS:
$status = sprintf(
' AND (estado = %d OR estado = %d)',
EVENT_NEW,
EVENT_VALIDATE
);
break;
}
} }
$criticity = ' '; $criticity = ' ';

View File

@ -296,11 +296,7 @@ class EventCardboard extends Widget
]; ];
// Event status. // Event status.
$fields = [ $fields = events_get_all_status(true);
-1 => __('All event'),
1 => __('Only validated'),
0 => __('Only pending'),
];
$inputs['inputs']['row1'][] = [ $inputs['inputs']['row1'][] = [
'label' => __('Event status'), 'label' => __('Event status'),