Skip to content
Snippets Groups Projects
Commit 95044fba authored by Jared Hancock's avatar Jared Hancock
Browse files

search: Fixup hits on assignee and closed-by

This fixes hits when using the MySQL full text search backend
parent 3bec42a9
No related branches found
No related tags found
No related merge requests found
......@@ -167,12 +167,10 @@ class TicketsAjaxAPI extends AjaxController {
$where.=' AND ticket.team_id='.db_input($id);
$criteria['team_id'] = $id;
}
elseif($assignee[0]=='s') {
elseif($assignee[0]=='s' || is_numeric($id)) {
$where.=' AND ticket.staff_id='.db_input($id);
$criteria['staff_id'] = $id;
}
elseif(is_numeric($id))
$where.=' AND ticket.staff_id='.db_input($id);
$where.=')';
......@@ -186,6 +184,8 @@ class TicketsAjaxAPI extends AjaxController {
} elseif($req['staffId']) { # closed-by
$where.=' AND (ticket.staff_id='.db_input($req['staffId']).' AND
status.state IN("resolved", "closed")) ';
$criteria['state__in'] = array('resolved','closed');
$criteria['staff_id'] = $req['staffId'];
}
//dates
......
......@@ -308,8 +308,12 @@ class MysqlSearchBackend extends SearchBackend {
case 'state':
$where[] = 'A2.state = '.db_input($value);
break;
case 'state__in':
$where[] = 'A2.state IN ('.implode(',',db_input($value)).')';
break;
case 'topic_id':
case 'staff_id':
case 'team_id':
case 'dept_id':
case 'user_id':
case 'isanswered':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment