3 final class PhabricatorContactNumbersSettingsPanel
4 extends PhabricatorSettingsPanel
{
6 public function getPanelKey() {
10 public function getPanelName() {
11 return pht('Contact Numbers');
14 public function getPanelMenuIcon() {
18 public function getPanelGroupKey() {
19 return PhabricatorSettingsAuthenticationPanelGroup
::PANELGROUPKEY
;
22 public function isMultiFactorEnrollmentPanel() {
26 public function processRequest(AphrontRequest
$request) {
27 $user = $this->getUser();
28 $viewer = $request->getUser();
30 $numbers = id(new PhabricatorAuthContactNumberQuery())
32 ->withObjectPHIDs(array($user->getPHID()))
34 $numbers = msortv($numbers, 'getSortVector');
37 $row_classes = array();
38 foreach ($numbers as $number) {
39 if ($number->getIsPrimary()) {
40 $primary_display = pht('Primary');
41 $row_classes[] = 'highlighted';
43 $primary_display = null;
44 $row_classes[] = null;
48 $number->newIconView(),
52 'href' => $number->getURI(),
54 $number->getDisplayName()),
56 phabricator_datetime($number->getDateCreated(), $viewer),
60 $table = id(new AphrontTableView($rows))
62 pht("You haven't added any contact numbers to your account."))
63 ->setRowClasses($row_classes)
81 $buttons[] = id(new PHUIButtonView())
84 ->setText(pht('Add Contact Number'))
85 ->setHref('/auth/contact/edit/')
86 ->setColor(PHUIButtonView
::GREY
);
88 return $this->newBox(pht('Contact Numbers'), $table, $buttons);