diff --git a/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php b/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php index 96701fa606..325077d5f1 100644 --- a/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php +++ b/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php @@ -1,7 +1,7 @@ getUser(); $offset = $request->getInt('offset', 0); $related_phid = $request->getStr('phid'); + $status = $request->getStr('status'); $pager = new AphrontPagerView(); $pager->setOffset($offset); @@ -32,11 +33,21 @@ class PhabricatorMetaMTAListController extends PhabricatorMetaMTAController { $mail = new PhabricatorMetaMTAMail(); $conn_r = $mail->establishConnection('r'); - if ($related_phid) { - $where_clause = qsprintf( + $wheres = array(); + if ($status) { + $wheres[] = qsprintf( $conn_r, - 'WHERE relatedPHID = %s', + 'status = %s', + $status); + } + if ($related_phid) { + $wheres[] = qsprintf( + $conn_r, + 'relatedPHID = %s', $related_phid); + } + if (count($wheres)) { + $where_clause = 'WHERE '.implode($wheres, ' AND '); } else { $where_clause = 'WHERE 1 = 1'; }