mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 14:30:56 +01:00
Fix new Question in Ponder
Summary: I derped here and broke new questions, also remove old Answer constants Test Plan: Ask a new question, see it save Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D13899
This commit is contained in:
parent
603c91e08a
commit
3a6c3cc5ca
3 changed files with 22 additions and 36 deletions
|
@ -7,9 +7,6 @@ final class PonderQuestionStatus extends PonderConstants {
|
|||
const STATUS_CLOSED_OBSOLETE = 'obsolete';
|
||||
const STATUS_CLOSED_DUPLICATE = 'duplicate';
|
||||
|
||||
const ANSWER_STATUS_VISIBLE = 'visible';
|
||||
const ANSWER_STATUS_HIDDEN = 'hidden';
|
||||
|
||||
public static function getQuestionStatusMap() {
|
||||
return array(
|
||||
self::STATUS_OPEN => pht('Open'),
|
||||
|
@ -89,20 +86,4 @@ final class PonderQuestionStatus extends PonderConstants {
|
|||
);
|
||||
}
|
||||
|
||||
public static function getAnswerStatusMap() {
|
||||
return array(
|
||||
self::ANSWER_STATUS_VISIBLE => pht('Visible'),
|
||||
self::ANSWER_STATUS_HIDDEN => pht('Hidden'),
|
||||
);
|
||||
}
|
||||
|
||||
public static function getAnswerStatusName($status) {
|
||||
$map = array(
|
||||
self::ANSWER_STATUS_VISIBLE => pht('Visible'),
|
||||
self::ANSWER_STATUS_HIDDEN => pht('Hidden'),
|
||||
);
|
||||
return idx($map, $status, pht('Unknown'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -68,9 +68,11 @@ final class PonderQuestionEditController extends PonderController {
|
|||
->setTransactionType(PonderQuestionTransaction::TYPE_CONTENT)
|
||||
->setNewValue($v_content);
|
||||
|
||||
if (!$is_new) {
|
||||
$xactions[] = id(clone $template)
|
||||
->setTransactionType(PonderQuestionTransaction::TYPE_STATUS)
|
||||
->setNewValue($v_status);
|
||||
}
|
||||
|
||||
$xactions[] = id(clone $template)
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
|
||||
|
|
|
@ -171,6 +171,12 @@ final class PonderQuestionViewController extends PonderController {
|
|||
|
||||
$view->invokeWillRenderEvent();
|
||||
|
||||
$details = PhabricatorMarkupEngine::renderOneObject(
|
||||
$question,
|
||||
$question->getMarkupField(),
|
||||
$viewer);
|
||||
|
||||
if ($details) {
|
||||
$view->addSectionHeader(
|
||||
pht('Details'),
|
||||
PHUIPropertyListView::ICON_SUMMARY);
|
||||
|
@ -182,12 +188,9 @@ final class PonderQuestionViewController extends PonderController {
|
|||
array(
|
||||
'class' => 'phabricator-remarkup',
|
||||
),
|
||||
PhabricatorMarkupEngine::renderOneObject(
|
||||
$question,
|
||||
$question->getMarkupField(),
|
||||
$viewer)),
|
||||
$details),
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue