From bd2351dc28ef8d513b90907b480cc3d7fe2dc4d4 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 17 Jul 2017 19:48:42 +0200 Subject: [PATCH] Fixes #72 --- Models/QAQuestion.php | 11 +++++++++++ Theme/Backend/qa-dashboard.tpl.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Models/QAQuestion.php b/Models/QAQuestion.php index 363293b..f4fd956 100644 --- a/Models/QAQuestion.php +++ b/Models/QAQuestion.php @@ -59,6 +59,17 @@ class QAQuestion implements \JsonSerializable return $this->id; } + public function hasAccepted() : bool + { + foreach($this->answers as $answer) { + if($answer->isAccepted()) { + return true; + } + } + + return false; + } + public function getLanguage() : string { return $this->language; diff --git a/Theme/Backend/qa-dashboard.tpl.php b/Theme/Backend/qa-dashboard.tpl.php index 144b704..008c245 100644 --- a/Theme/Backend/qa-dashboard.tpl.php +++ b/Theme/Backend/qa-dashboard.tpl.php @@ -9,7 +9,7 @@ echo $this->getData('nav')->render(); ?>
- getAnswers()); ?> + getAnswers()); ?>