2014-12-02 22:10:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorApplicationTransactionShowOlderController
|
|
|
|
extends PhabricatorApplicationTransactionController {
|
|
|
|
|
|
|
|
public function shouldAllowPublic() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$viewer = $request->getUser();
|
|
|
|
|
|
|
|
$object = id(new PhabricatorObjectQuery())
|
|
|
|
->withPHIDs(array($request->getURIData('phid')))
|
|
|
|
->setViewer($viewer)
|
|
|
|
->executeOne();
|
|
|
|
if (!$object) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
|
|
|
if (!$object instanceof PhabricatorApplicationTransactionInterface) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
|
|
|
|
|
|
|
$template = $object->getApplicationTransactionTemplate();
|
2015-08-13 23:49:00 +02:00
|
|
|
$queries = id(new PhutilClassMapQuery())
|
2014-12-02 22:10:29 +01:00
|
|
|
->setAncestorClass('PhabricatorApplicationTransactionQuery')
|
2015-08-13 23:49:00 +02:00
|
|
|
->execute();
|
2014-12-02 22:10:29 +01:00
|
|
|
|
|
|
|
$object_query = null;
|
|
|
|
foreach ($queries as $query) {
|
|
|
|
if ($query->getTemplateApplicationTransaction() == $template) {
|
|
|
|
$object_query = $query;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$object_query) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
|
|
|
|
|
|
|
$timeline = $this->buildTransactionTimeline(
|
|
|
|
$object,
|
|
|
|
$query);
|
|
|
|
|
|
|
|
$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
|
|
|
}
|
|
|
|
|
|
|
|
}
|