2014-12-02 22:10:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorApplicationTransactionShowOlderController
|
|
|
|
extends PhabricatorApplicationTransactionController {
|
|
|
|
|
|
|
|
public function shouldAllowPublic() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
2015-12-02 04:46:57 +01:00
|
|
|
$viewer = $this->getViewer();
|
2014-12-02 22:10:29 +01:00
|
|
|
|
|
|
|
$object = id(new PhabricatorObjectQuery())
|
|
|
|
->withPHIDs(array($request->getURIData('phid')))
|
|
|
|
->setViewer($viewer)
|
|
|
|
->executeOne();
|
|
|
|
if (!$object) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
2015-12-21 16:08:17 +01:00
|
|
|
|
2014-12-02 22:10:29 +01:00
|
|
|
if (!$object instanceof PhabricatorApplicationTransactionInterface) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
|
|
|
|
2015-12-21 16:08:17 +01:00
|
|
|
$query = PhabricatorApplicationTransactionQuery::newQueryForObject($object);
|
|
|
|
if (!$query) {
|
2014-12-02 22:10:29 +01:00
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
|
|
|
|
2015-12-21 16:08:17 +01:00
|
|
|
$timeline = $this->buildTransactionTimeline($object, $query);
|
2014-12-02 22:10:29 +01:00
|
|
|
|
|
|
|
$phui_timeline = $timeline->buildPHUITimelineView($with_hiding = false);
|
|
|
|
$phui_timeline->setShouldAddSpacers(false);
|
|
|
|
$events = $phui_timeline->buildEvents();
|
|
|
|
|
|
|
|
return id(new AphrontAjaxResponse())
|
|
|
|
->setContent(array(
|
2015-04-05 14:29:39 +02:00
|
|
|
'timeline' => hsprintf('%s', $events),
|
|
|
|
));
|
2014-12-02 22:10:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|