コード例 #1
0
 private function buildPropertyView(NuanceItem $item)
 {
     $viewer = $this->getViewer();
     $properties = id(new PHUIPropertyListView())->setUser($viewer);
     $properties->addProperty(pht('Date Created'), phabricator_datetime($item->getDateCreated(), $viewer));
     $requestor_phid = $item->getRequestorPHID();
     if ($requestor_phid) {
         $requestor_view = $viewer->renderHandle($requestor_phid);
     } else {
         $requestor_view = phutil_tag('em', array(), pht('None'));
     }
     $properties->addProperty(pht('Requestor'), $requestor_view);
     $properties->addProperty(pht('Source'), $viewer->renderHandle($item->getSourcePHID()));
     $queue_phid = $item->getQueuePHID();
     if ($queue_phid) {
         $queue_view = $viewer->renderHandle($queue_phid);
     } else {
         $queue_view = phutil_tag('em', array(), pht('None'));
     }
     $properties->addProperty(pht('Queue'), $queue_view);
     $source = $item->getSource();
     $definition = $source->getDefinition();
     $definition->renderItemEditProperties($viewer, $item, $properties);
     return $properties;
 }