Add statuses and flags selection to advanced search

Fix search backend to use the new statuses
Merge pull request #1200 from protich/issue/advanced-search

Add statuses and flags selection to advanced search

Reviewed-By: Jared Hancock <jared@osticket.com>