@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
fork

Configure Feed

Select the types of activity you want to include in your feed.

Nudge users to close their question if it's been answered

Summary: Adds a notice reminding viewers of their own question to resolve it and mark the correct answer.

Test Plan:
View my own open question, see notice. Resolve question, notice goes away.

{F743481}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D13958

+17 -2
+17 -2
src/applications/ponder/controller/PonderQuestionViewController.php
··· 20 20 return new Aphront404Response(); 21 21 } 22 22 23 - $answers = $this->buildAnswers($question->getAnswers()); 23 + $answers = $this->buildAnswers($question); 24 24 25 25 $answer_add_panel = id(new PonderAddAnswerView()) 26 26 ->setQuestion($question) ··· 80 80 ->setHeader($header) 81 81 ->addPropertyList($properties) 82 82 ->appendChild($footer); 83 + 84 + if ($viewer->getPHID() == $question->getAuthorPHID()) { 85 + $status = $question->getStatus(); 86 + $answers_list = $question->getAnswers(); 87 + if ($answers_list && ($status == PonderQuestionStatus::STATUS_OPEN)) { 88 + $info_view = id(new PHUIInfoView()) 89 + ->setSeverity(PHUIInfoView::SEVERITY_WARNING) 90 + ->appendChild( 91 + pht( 92 + 'If this question has been resolved, please consider closing 93 + the question and marking the answer as helpful.')); 94 + $object_box->setInfoView($info_view); 95 + } 96 + } 83 97 84 98 $crumbs = $this->buildApplicationCrumbs($this->buildSideNavView()); 85 99 $crumbs->addTextCrumb('Q'.$id, '/Q'.$id); ··· 206 220 * TODO - re-factor this to ajax in one answer panel at a time in a more 207 221 * standard fashion. This is necessary to scale this application. 208 222 */ 209 - private function buildAnswers(array $answers) { 223 + private function buildAnswers(PonderQuestion $question) { 210 224 $viewer = $this->getViewer(); 225 + $answers = $question->getAnswers(); 211 226 212 227 $author_phids = mpull($answers, 'getAuthorPHID'); 213 228 $handles = $this->loadViewerHandles($author_phids);