Use filter class
This commit is contained in:
parent
e3fe75f21b
commit
dc451cbc85
|
@ -85,20 +85,18 @@ if ( $user['MonitorIds'] ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset($_REQUEST['eid']) and $_REQUEST['eid'] ) {
|
if ( isset($_REQUEST['eid']) and $_REQUEST['eid'] ) {
|
||||||
ZM\Logger::Debug('Loading events by single eid');
|
|
||||||
$eventsSql .= ' AND E.Id=?';
|
$eventsSql .= ' AND E.Id=?';
|
||||||
$eventsValues[] = $_REQUEST['eid'];
|
$eventsValues[] = $_REQUEST['eid'];
|
||||||
} elseif ( isset($_REQUEST['eids']) and count($_REQUEST['eids']) > 0 ) {
|
} else if ( isset($_REQUEST['eids']) and count($_REQUEST['eids']) > 0 ) {
|
||||||
ZM\Logger::Debug('Loading events by eids');
|
|
||||||
$eventsSql .= ' AND E.Id IN ('.implode(',', array_map(function(){return '?';}, $_REQUEST['eids'])). ')';
|
$eventsSql .= ' AND E.Id IN ('.implode(',', array_map(function(){return '?';}, $_REQUEST['eids'])). ')';
|
||||||
$eventsValues += $_REQUEST['eids'];
|
$eventsValues += $_REQUEST['eids'];
|
||||||
} else if ( isset($_REQUEST['filter']) ) {
|
} else if ( isset($_REQUEST['filter']) ) {
|
||||||
parseSort();
|
parseSort();
|
||||||
parseFilter($_REQUEST['filter']);
|
$filter = Filter::parse($_REQUEST['filter']);
|
||||||
$filterQuery = $_REQUEST['filter']['query'];
|
$filterQuery = $filter->querystring();
|
||||||
|
|
||||||
if ( $_REQUEST['filter']['sql'] ) {
|
if ( $filter->sql() ) {
|
||||||
$eventsSql .= $_REQUEST['filter']['sql'];
|
$eventsSql .= $filter->sql();
|
||||||
}
|
}
|
||||||
$eventsSql .= " ORDER BY $sortColumn $sortOrder";
|
$eventsSql .= " ORDER BY $sortColumn $sortOrder";
|
||||||
if ( isset($_REQUEST['filter']['Query']['limit']) )
|
if ( isset($_REQUEST['filter']['Query']['limit']) )
|
||||||
|
|
Loading…
Reference in New Issue