Page MenuHomePhabricator

D9621.diff
No OneTemporary

D9621.diff

diff --git a/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
@@ -41,23 +41,29 @@
->withPHIDs($phids)
->execute();
+ $table = id(new PhutilConsoleTable())
+ ->setShowHeader(false)
+ ->addColumn('id', array('title' => 'ID'))
+ ->addColumn('author', array('title' => 'Author'))
+ ->addColumn('phid', array('title' => 'Related PHID'))
+ ->addColumn('subject', array('title' => 'Subject'));
+
foreach (array_reverse($mails) as $mail) {
- $console->writeOut(
- "%s\n",
- sprintf(
- '% 8d %-16s %-20s %s',
- $mail->getID(),
- $mail->getAuthorPHID()
- ? $handles[$mail->getAuthorPHID()]->getName()
- : '-',
- $mail->getRelatedPHID()
- ? $handles[$mail->getRelatedPHID()]->getName()
- : '-',
- $mail->getSubject()
- ? $mail->getSubject()
- : pht('(No subject.)')));
+ $table->addRow(array(
+ 'id' => $mail->getID(),
+ 'author' => $mail->getAuthorPHID()
+ ? $handles[$mail->getAuthorPHID()]->getName()
+ : '-',
+ 'phid' => $mail->getRelatedPHID()
+ ? $handles[$mail->getRelatedPHID()]->getName()
+ : '-',
+ 'subject' => $mail->getSubject()
+ ? $mail->getSubject()
+ : pht('(No subject.)'),
+ ));
}
+ $table->draw();
return 0;
}
diff --git a/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
@@ -33,16 +33,23 @@
return 0;
}
+ $table = id(new PhutilConsoleTable())
+ ->setShowHeader(false)
+ ->addColumn('id', array('title' => 'ID'))
+ ->addColumn('status', array('title' => 'Status'))
+ ->addColumn('subject', array('title' => 'Subject'));
+
foreach (array_reverse($mails) as $mail) {
- $console->writeOut(
- "%s\n",
- sprintf(
- '% 8d %-8s %s',
- $mail->getID(),
- PhabricatorMetaMTAMail::getReadableStatus($mail->getStatus()),
- $mail->getSubject()));
+ $status = $mail->getStatus();
+
+ $table->addRow(array(
+ 'id' => $mail->getID(),
+ 'status' => PhabricatorMetaMTAMail::getReadableStatus($status),
+ 'subject' => $mail->getSubject(),
+ ));
}
+ $table->draw();
return 0;
}
diff --git a/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php b/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php
--- a/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php
+++ b/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php
@@ -34,16 +34,21 @@
return 0;
}
+ $table = id(new PhutilConsoleTable())
+ ->setShowHeader(false)
+ ->addColumn('id', array('title' => 'ID'))
+ ->addColumn('status', array('title' => 'Status'))
+ ->addColumn('recv', array('title' => 'Recipient'));
+
foreach (array_reverse($sms_messages) as $sms) {
- $console->writeOut(
- "%s\n",
- sprintf(
- '% 8d %-8s To: %s',
- $sms->getID(),
- $sms->getSendStatus(),
- $sms->getToNumber()));
+ $table->addRow(array(
+ 'id' => $sms->getID(),
+ 'status' => $sms->getSendStatus(),
+ 'recv' => $sms->getToNumber(),
+ ));
}
+ $table->draw();
return 0;
}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 8, 9:39 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6737794
Default Alt Text
D9621.diff (4 KB)

Event Timeline