mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-05 05:02:44 +01:00
70a5ec600d
Summary: Fixes T3579 As a basic overview, this enables the author of a question to open/close a question. Other bits; - Add "Open" filter to the builtin queries - Add "Status" to search form - Refactor ponder constants - Add coloured bars for different question statuses Test Plan: - Open/Close questions - Search for some bits - Use filters Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T3579 Differential Revision: https://secure.phabricator.com/D6590 Conflicts: src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
38 lines
965 B
PHP
38 lines
965 B
PHP
<?php
|
|
|
|
final class PonderAnswerPreviewController
|
|
extends PonderController {
|
|
|
|
public function processRequest() {
|
|
|
|
$request = $this->getRequest();
|
|
$user = $request->getUser();
|
|
$question_id = $request->getInt('question_id');
|
|
|
|
$question = PonderQuestionQuery::loadSingle($user, $question_id);
|
|
if (!$question) {
|
|
return new Aphront404Response();
|
|
}
|
|
|
|
$author_phid = $user->getPHID();
|
|
$object_phids = array($author_phid);
|
|
$handles = $this->loadViewerHandles($object_phids);
|
|
|
|
$answer = new PonderAnswer();
|
|
$answer->setContent($request->getStr('content'));
|
|
$answer->setAuthorPHID($author_phid);
|
|
|
|
$view = new PonderPostBodyView();
|
|
$view
|
|
->setQuestion($question)
|
|
->setTarget($answer)
|
|
->setPreview(true)
|
|
->setUser($user)
|
|
->setHandles($handles)
|
|
->setAction(PonderLiterals::LITERAL_ANSWERED);
|
|
|
|
return id(new AphrontAjaxResponse())
|
|
->setContent($view->render());
|
|
}
|
|
|
|
}
|