2013-10-22 22:49:37 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorProjectHistoryController
|
|
|
|
extends PhabricatorProjectController {
|
|
|
|
|
|
|
|
private $id;
|
|
|
|
|
|
|
|
public function shouldAllowPublic() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function willProcessRequest(array $data) {
|
|
|
|
$this->id = $data['id'];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$viewer = $request->getUser();
|
|
|
|
|
|
|
|
$id = $this->id;
|
|
|
|
|
|
|
|
$project = id(new PhabricatorProjectQuery())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->withIDs(array($id))
|
|
|
|
->executeOne();
|
|
|
|
if (!$project) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
|
|
|
|
|
|
|
$xactions = id(new PhabricatorProjectTransactionQuery())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->withObjectPHIDs(array($project->getPHID()))
|
|
|
|
->execute();
|
|
|
|
|
|
|
|
$timeline = id(new PhabricatorApplicationTransactionView())
|
|
|
|
->setUser($viewer)
|
|
|
|
->setObjectPHID($project->getPHID())
|
|
|
|
->setTransactions($xactions);
|
|
|
|
|
2013-12-19 02:47:34 +01:00
|
|
|
$crumbs = $this->buildApplicationCrumbs()
|
|
|
|
->addTextCrumb(
|
|
|
|
$project->getName(),
|
|
|
|
$this->getApplicationURI("view/{$id}/"))
|
|
|
|
->addTextCrumb(pht('History'));
|
2013-10-22 22:49:37 +02:00
|
|
|
|
|
|
|
return $this->buildApplicationPage(
|
|
|
|
array(
|
|
|
|
$crumbs,
|
|
|
|
$timeline,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'title' => $project->getName(),
|
|
|
|
'device' => true,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|