diff --git a/src/applications/conpherence/view/ConpherencePeopleWidgetView.php b/src/applications/conpherence/view/ConpherencePeopleWidgetView.php index bb455ee787..f9a61b9619 100644 --- a/src/applications/conpherence/view/ConpherencePeopleWidgetView.php +++ b/src/applications/conpherence/view/ConpherencePeopleWidgetView.php @@ -1,60 +1,60 @@ getConpherence(); $widget_data = $conpherence->getWidgetData(); $user = $this->getUser(); $conpherence = $this->getConpherence(); $participants = $conpherence->getParticipants(); $handles = $conpherence->getHandles(); + $handles = msort($handles, 'getName'); + $head_handles = array_select_keys($handles, array($user->getPHID())); + $handles = $head_handles + $handles; $body = array(); - // future proof by using participants to iterate through handles; - // we may have non-people handles sooner or later - foreach ($participants as $user_phid => $participant) { - $handle = $handles[$user_phid]; + foreach ($handles as $user_phid => $handle) { $remove_html = ''; if ($user_phid == $user->getPHID()) { $icon = id(new PHUIIconView()) ->setIconFont('fa-times lightbluetext'); $remove_html = javelin_tag( 'a', array( 'class' => 'remove', 'sigil' => 'remove-person', 'meta' => array( 'remove_person' => $handle->getPHID(), 'action' => 'remove_person', ), ), $icon); } $body[] = phutil_tag( 'div', array( 'class' => 'person-entry grouped', ), array( phutil_tag( 'a', array( 'class' => 'pic', 'href' => $handle->getURI(), ), phutil_tag( 'img', array( 'src' => $handle->getImageURI(), ), '')), $handle->renderLink(), $remove_html, )); } return $body; } }