Put back filter query code

pull/3065/head
Isaac Connor 2020-10-23 14:02:27 -04:00
parent ad137adb4c
commit 8a3e0e108c
1 changed files with 20 additions and 0 deletions

View File

@ -23,6 +23,26 @@ if ( !canView('Events') || (!empty($_REQUEST['execute']) && !canEdit('Events'))
return;
}
require_once('includes/Event.php');
require_once('includes/Filter.php');
$eventsSql = 'SELECT E.*,M.Name AS MonitorName,M.DefaultScale FROM Monitors AS M INNER JOIN Events AS E on (M.Id = E.MonitorId) WHERE';
if ( $user['MonitorIds'] ) {
$user_monitor_ids = ' M.Id in ('.$user['MonitorIds'].')';
$eventsSql .= $user_monitor_ids;
} else {
$eventsSql .= ' 1';
}
$filter = isset($_REQUEST['filter_id']) ? new ZM\Filter($_REQUEST['filter_id']) : new ZM\Filter();
if ( isset($_REQUEST['filter'])) {
$filter->set($_REQUEST['filter']);
}
parseSort();
$filterQuery = $filter->querystring();
xhtmlHeaders(__FILE__, translate('Events'));
getBodyTopHTML();