mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-14 07:48:38 +01:00
Summary: Fixes T5446. Depends on D9687. Test Plan: Mostly regexp'd this. Lint doesn't complain. Reviewers: chad Reviewed By: chad Subscribers: epriestley, hach-que Maniphest Tasks: T5446 Differential Revision: https://secure.phabricator.com/D9690
50 lines
973 B
PHP
50 lines
973 B
PHP
<?php
|
|
|
|
final class NuanceQueueEditController extends NuanceController {
|
|
|
|
private $queueID;
|
|
|
|
public function setQueueID($queue_id) {
|
|
$this->queueID = $queue_id;
|
|
return $this;
|
|
}
|
|
public function getQueueID() {
|
|
return $this->queueID;
|
|
}
|
|
|
|
public function willProcessRequest(array $data) {
|
|
$this->setQueueID(idx($data, 'id'));
|
|
}
|
|
|
|
public function processRequest() {
|
|
$request = $this->getRequest();
|
|
$user = $request->getUser();
|
|
|
|
$queue_id = $this->getQueueID();
|
|
$is_new = !$queue_id;
|
|
|
|
if ($is_new) {
|
|
$queue = new NuanceQueue();
|
|
|
|
} else {
|
|
$queue = id(new NuanceQueueQuery())
|
|
->setViewer($user)
|
|
->withIDs(array($queue_id))
|
|
->executeOne();
|
|
}
|
|
|
|
if (!$queue) {
|
|
return new Aphront404Response();
|
|
}
|
|
|
|
$crumbs = $this->buildApplicationCrumbs();
|
|
$title = 'TODO';
|
|
|
|
return $this->buildApplicationPage(
|
|
$crumbs,
|
|
array(
|
|
'title' => $title,
|
|
));
|
|
}
|
|
|
|
}
|