3 final class NuanceQueueViewController
4 extends NuanceQueueController
{
6 public function handleRequest(AphrontRequest
$request) {
7 $viewer = $this->getViewer();
9 $queue = id(new NuanceQueueQuery())
11 ->withIDs(array($request->getURIData('id')))
14 return new Aphront404Response();
17 $title = $queue->getName();
19 $crumbs = $this->buildApplicationCrumbs();
20 $crumbs->addTextCrumb(pht('Queues'), $this->getApplicationURI('queue/'));
21 $crumbs->addTextCrumb($queue->getName());
22 $crumbs->setBorder(true);
24 $header = $this->buildHeaderView($queue);
25 $curtain = $this->buildCurtain($queue);
27 $timeline = $this->buildTransactionTimeline(
29 new NuanceQueueTransactionQuery());
30 $timeline->setShouldTerminate(true);
32 $view = id(new PHUITwoColumnView())
34 ->setCurtain($curtain)
35 ->setMainColumn($timeline);
37 return $this->newPage()
43 private function buildHeaderView(NuanceQueue
$queue) {
44 $viewer = $this->getViewer();
46 $header = id(new PHUIHeaderView())
48 ->setHeader($queue->getName())
49 ->setPolicyObject($queue);
54 private function buildCurtain(NuanceQueue
$queue) {
55 $viewer = $this->getViewer();
56 $id = $queue->getID();
58 $can_edit = PhabricatorPolicyFilter
::hasCapability(
61 PhabricatorPolicyCapability
::CAN_EDIT
);
63 $curtain = $this->newCurtainView($queue);
66 id(new PhabricatorActionView())
67 ->setName(pht('Edit Queue'))
68 ->setIcon('fa-pencil')
69 ->setHref($this->getApplicationURI("queue/edit/{$id}/"))
70 ->setDisabled(!$can_edit)
71 ->setWorkflow(!$can_edit));
74 id(new PhabricatorActionView())
75 ->setName(pht('Begin Work'))
76 ->setIcon('fa-play-circle-o')
77 ->setHref($this->getApplicationURI("queue/work/{$id}/"))
78 ->setDisabled(!$can_edit)
79 ->setWorkflow(!$can_edit));