QnA
* show number of answers on question notices * change label on answer submit button to "Answer"
This commit is contained in:
@@ -189,9 +189,11 @@ class QnA_Question extends Managed_DataObject
|
||||
|
||||
function countAnswers()
|
||||
{
|
||||
$a = new QnA_Answer();
|
||||
$a = new QnA_Answer();
|
||||
|
||||
$a->question_id = $this->id;
|
||||
return $a-count();
|
||||
|
||||
return $a->count();
|
||||
}
|
||||
|
||||
static function fromNotice($notice)
|
||||
@@ -221,6 +223,14 @@ class QnA_Question extends Managed_DataObject
|
||||
$out->elementEnd('span');
|
||||
}
|
||||
|
||||
$cnt = $question->countAnswers();
|
||||
|
||||
if (!empty($cnt)) {
|
||||
$out->elementStart('span', 'answer-count');
|
||||
$out->text(sprintf(_m('%s answers'), $cnt));
|
||||
$out->elementEnd('span');
|
||||
}
|
||||
|
||||
if (!empty($question->closed)) {
|
||||
$out->elementStart('span', 'question-closed');
|
||||
$out->text(_m('This question is closed.'));
|
||||
|
Reference in New Issue
Block a user