@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorApplicationTransactionShowOlderController
4 extends PhabricatorApplicationTransactionController {
5
6 public function shouldAllowPublic() {
7 return true;
8 }
9
10 public function handleRequest(AphrontRequest $request) {
11 $viewer = $this->getViewer();
12
13 $object = id(new PhabricatorObjectQuery())
14 ->withPHIDs(array($request->getURIData('phid')))
15 ->setViewer($viewer)
16 ->executeOne();
17 if (!$object) {
18 return new Aphront404Response();
19 }
20
21 if (!$object instanceof PhabricatorApplicationTransactionInterface) {
22 return new Aphront404Response();
23 }
24
25 $query = PhabricatorApplicationTransactionQuery::newQueryForObject($object);
26 if (!$query) {
27 return new Aphront404Response();
28 }
29
30 $raw_view_data = $request->getStr('viewData');
31 try {
32 $view_data = phutil_json_decode($raw_view_data);
33 } catch (Exception $ex) {
34 $view_data = array();
35 }
36
37 $timeline = $this->buildTransactionTimeline(
38 $object,
39 $query,
40 null,
41 $view_data);
42
43 $phui_timeline = $timeline->buildPHUITimelineView($with_hiding = false);
44 $phui_timeline->setShouldAddSpacers(false);
45 $events = $phui_timeline->buildEvents();
46
47 return id(new AphrontAjaxResponse())
48 ->setContent(array(
49 'timeline' => hsprintf('%s', $events),
50 ));
51 }
52
53}