2013-07-28 18:32:55 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PonderAnswerHistoryController extends PonderController {
|
|
|
|
|
2015-08-21 06:49:49 -07:00
|
|
|
public function shouldAllowPublic() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-07-22 13:23:11 -07:00
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$viewer = $request->getViewer();
|
|
|
|
$id = $request->getURIData('id');
|
2013-07-28 18:32:55 -07:00
|
|
|
|
|
|
|
$answer = id(new PonderAnswerQuery())
|
|
|
|
->setViewer($viewer)
|
2015-07-22 13:23:11 -07:00
|
|
|
->withIDs(array($id))
|
2013-07-28 18:32:55 -07:00
|
|
|
->executeOne();
|
|
|
|
if (!$answer) {
|
|
|
|
return new Aphront404Response();
|
|
|
|
}
|
|
|
|
|
Transactions - deploy buildTransactionTimeline to remaining applications
Summary:
Ref T4712. Specifically...
- Differential
- needed getApplicationTransactionViewObject() implemented
- Audit
- needed getApplicationTransactionViewObject() implemented
- Repository
- one object needed PhabricatorApplicationTransactionInterface implemented
- setShouldTerminate(true)
- Ponder
- BONUS BUG FIX - leaving a comment on an answer had a bad redirect URI
- both PonderQuestion and PonderAnswer needed PhabricatorApplicationTransactionInterface implemented
- setShouldTerminate(true) on both "history" controllers
- left a "TODO" on buildAnswers on the question view controller, which is non-standard and should be re-written eventually
- Phortune
- BONUS BUG FIX - fix new user "createNewAccount" code to not fatal
- PhortuneAccount, PhortuneMerchant, and PhortuneCart needed PhabricatorApplicationTransactionInterface implemented
- setShouldTerminate(true) on Account view, merchant view, and cart view controller
- Fund
- Legalpad
- Nuance
- NuanceSource needed PhabricatorApplicationTransactionInterface implemented
- Releeph (this product is kind of a mess...)
- HACKQUEST - had to manually create an arcanist project to even be able to make a "product" and get started...!
- BONUS BUG FIX - make sure to "setName" on product edit
- ReleephProject (should be ReleepProduct...?), ReleephBranch, and ReleepRequest needed PhabricatorApplicationTransactionInterface implemented
- Harbormaster
- HarbormasterBuildable, HarbormasterBuild, HarbormasterBuildPlan, and HarbormasterBuildStep all needed PhabricatorApplicationTransactionInterface implemented
- setShouldTerminate(true) all over the place
Test Plan: foreach application, viewed the timeline(s) and made sure they still rendered
Reviewers: epriestley
Reviewed By: epriestley
Subscribers: Korvin, epriestley
Maniphest Tasks: T4712
Differential Revision: https://secure.phabricator.com/D10925
2014-12-03 15:35:47 -08:00
|
|
|
$timeline = $this->buildTransactionTimeline(
|
|
|
|
$answer,
|
|
|
|
new PonderAnswerTransactionQuery());
|
|
|
|
$timeline->setShouldTerminate(true);
|
2013-07-28 18:32:55 -07:00
|
|
|
|
|
|
|
$qid = $answer->getQuestion()->getID();
|
|
|
|
$aid = $answer->getID();
|
|
|
|
|
|
|
|
$crumbs = $this->buildApplicationCrumbs();
|
2015-08-05 09:42:39 -07:00
|
|
|
$crumbs->setBorder(true);
|
2013-12-18 17:47:34 -08:00
|
|
|
$crumbs->addTextCrumb("Q{$qid}", "/Q{$qid}");
|
|
|
|
$crumbs->addTextCrumb("A{$aid}", "/Q{$qid}#{$aid}");
|
|
|
|
$crumbs->addTextCrumb(pht('History'));
|
2016-03-27 13:07:53 -07:00
|
|
|
$crumbs->setBorder(true);
|
|
|
|
|
|
|
|
$header = id(new PHUIHeaderView())
|
|
|
|
->setHeader(pht('Answer History'))
|
|
|
|
->setHeaderIcon('fa-history');
|
|
|
|
|
|
|
|
$view = id(new PHUITwoColumnView())
|
|
|
|
->setHeader($header)
|
|
|
|
->setFooter($timeline);
|
2013-07-28 18:32:55 -07:00
|
|
|
|
2016-03-27 13:07:53 -07:00
|
|
|
return $this->newPage()
|
|
|
|
->setTitle(pht('Answer History'))
|
|
|
|
->setCrumbs($crumbs)
|
|
|
|
->appendChild($view);
|
2013-07-28 18:32:55 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|