From 6954cb35082737f3da87f3b8eadab8e91d1e6d4c Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 5 Apr 2011 09:12:54 -0700 Subject: [PATCH] QnA - Add ToSelector to new question --- plugins/QnA/actions/qnanewquestion.php | 9 ++++++++- plugins/QnA/lib/qnanewquestionform.php | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/QnA/actions/qnanewquestion.php b/plugins/QnA/actions/qnanewquestion.php index 561b11575a..3399c5eda8 100644 --- a/plugins/QnA/actions/qnanewquestion.php +++ b/plugins/QnA/actions/qnanewquestion.php @@ -130,10 +130,17 @@ class QnanewquestionAction extends Action throw new ClientException(_m('Question must have a title.')); } + // Notice options + $options = array(); + + // Does the heavy-lifting for getting "To:" information + ToSelector::fillOptions($this, $options); + $saved = QnA_Question::saveNew( $this->user->getProfile(), $this->title, - $this->description + $this->description, + $options ); } catch (ClientException $ce) { $this->error = $ce->getMessage(); diff --git a/plugins/QnA/lib/qnanewquestionform.php b/plugins/QnA/lib/qnanewquestionform.php index 114e6199a1..1def13a8c4 100644 --- a/plugins/QnA/lib/qnanewquestionform.php +++ b/plugins/QnA/lib/qnanewquestionform.php @@ -121,6 +121,12 @@ class QnanewquestionForm extends Form $this->unli(); $this->out->elementEnd('ul'); + $toWidget = new ToSelector( + $this->out, + common_current_user(), + null + ); + $toWidget->show(); $this->out->elementEnd('fieldset'); }