1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-25 06:50:55 +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:
Chad Little 2015-08-14 09:51:52 -07:00
parent 603c91e08a
commit 3a6c3cc5ca
3 changed files with 22 additions and 36 deletions

View file

@ -7,9 +7,6 @@ final class PonderQuestionStatus extends PonderConstants {
const STATUS_CLOSED_OBSOLETE = 'obsolete'; const STATUS_CLOSED_OBSOLETE = 'obsolete';
const STATUS_CLOSED_DUPLICATE = 'duplicate'; const STATUS_CLOSED_DUPLICATE = 'duplicate';
const ANSWER_STATUS_VISIBLE = 'visible';
const ANSWER_STATUS_HIDDEN = 'hidden';
public static function getQuestionStatusMap() { public static function getQuestionStatusMap() {
return array( return array(
self::STATUS_OPEN => pht('Open'), 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'));
}
} }

View file

@ -68,9 +68,11 @@ final class PonderQuestionEditController extends PonderController {
->setTransactionType(PonderQuestionTransaction::TYPE_CONTENT) ->setTransactionType(PonderQuestionTransaction::TYPE_CONTENT)
->setNewValue($v_content); ->setNewValue($v_content);
$xactions[] = id(clone $template) if (!$is_new) {
->setTransactionType(PonderQuestionTransaction::TYPE_STATUS) $xactions[] = id(clone $template)
->setNewValue($v_status); ->setTransactionType(PonderQuestionTransaction::TYPE_STATUS)
->setNewValue($v_status);
}
$xactions[] = id(clone $template) $xactions[] = id(clone $template)
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY) ->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)

View file

@ -171,23 +171,26 @@ final class PonderQuestionViewController extends PonderController {
$view->invokeWillRenderEvent(); $view->invokeWillRenderEvent();
$view->addSectionHeader( $details = PhabricatorMarkupEngine::renderOneObject(
$question,
$question->getMarkupField(),
$viewer);
if ($details) {
$view->addSectionHeader(
pht('Details'), pht('Details'),
PHUIPropertyListView::ICON_SUMMARY); PHUIPropertyListView::ICON_SUMMARY);
$view->addTextContent( $view->addTextContent(
array( array(
phutil_tag( phutil_tag(
'div', 'div',
array( array(
'class' => 'phabricator-remarkup', 'class' => 'phabricator-remarkup',
), ),
PhabricatorMarkupEngine::renderOneObject( $details),
$question, ));
$question->getMarkupField(), }
$viewer)),
));
return $view; return $view;
} }