1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-20 13:52:40 +01:00

Provide a way to view MetaMTA messages by status

Summary:
Added a query option of status for the MetaMTA list controller. There currently
isn't a ui for accessing this.

Task ID: #

Blame Rev:

Test Plan:
loaded /mail/, /mail/?status=queued, /mail?phid=PHID...&status=...
each request returned a sane list of data

Revert Plan:

Tags:

Reviewers: epriestley, btrahan, jungejason

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1784
This commit is contained in:
Nick Harper 2012-03-05 11:22:51 -08:00
parent f5f7987013
commit 8f27f4272c

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -24,6 +24,7 @@ class PhabricatorMetaMTAListController extends PhabricatorMetaMTAController {
$user = $request->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';
}