From dc451cbc859f6d42e0b684bacc7b5d15698491f9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 17 Aug 2020 17:42:22 -0400 Subject: [PATCH] Use filter class --- web/skins/classic/views/export.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/web/skins/classic/views/export.php b/web/skins/classic/views/export.php index 6abfd62bf..b1d43134b 100644 --- a/web/skins/classic/views/export.php +++ b/web/skins/classic/views/export.php @@ -85,20 +85,18 @@ if ( $user['MonitorIds'] ) { } if ( isset($_REQUEST['eid']) and $_REQUEST['eid'] ) { - ZM\Logger::Debug('Loading events by single eid'); $eventsSql .= ' AND E.Id=?'; $eventsValues[] = $_REQUEST['eid']; -} elseif ( isset($_REQUEST['eids']) and count($_REQUEST['eids']) > 0 ) { - ZM\Logger::Debug('Loading events by eids'); +} else if ( isset($_REQUEST['eids']) and count($_REQUEST['eids']) > 0 ) { $eventsSql .= ' AND E.Id IN ('.implode(',', array_map(function(){return '?';}, $_REQUEST['eids'])). ')'; $eventsValues += $_REQUEST['eids']; } else if ( isset($_REQUEST['filter']) ) { parseSort(); - parseFilter($_REQUEST['filter']); - $filterQuery = $_REQUEST['filter']['query']; + $filter = Filter::parse($_REQUEST['filter']); + $filterQuery = $filter->querystring(); - if ( $_REQUEST['filter']['sql'] ) { - $eventsSql .= $_REQUEST['filter']['sql']; + if ( $filter->sql() ) { + $eventsSql .= $filter->sql(); } $eventsSql .= " ORDER BY $sortColumn $sortOrder"; if ( isset($_REQUEST['filter']['Query']['limit']) )