From ada031952061cdd8bfe79c38508cb4464cabfb36 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 31 Dec 2019 19:54:45 +0100 Subject: [PATCH] add todos from github --- Controller/ApiController.php | 17 ++++++++++++++++- Controller/BackendController.php | 4 ++++ Theme/Backend/qa-dashboard.tpl.php | 15 ++++++++++++++- Theme/Backend/qa-question.tpl.php | 23 +++++++++++++++++++++-- Theme/Backend/qa-tag-list.tpl.php | 5 +++++ 5 files changed, 60 insertions(+), 4 deletions(-) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 220bd57..9e01e77 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -17,6 +17,14 @@ namespace Modules\QA\Controller; use Modules\QA\Models\QAQuestionMapper; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; +use phpOMS\Model\Message\FormValidation; +use Modules\QA\Models\QAQuestion; +use phpOMS\Utils\Parser\Markdown\Markdown; +use Modules\QA\Models\QAQuestionStatus; +use Modules\QA\Models\QAAnswer; +use Modules\QA\Models\QAAnswerStatus; +use Modules\QA\Models\QACategoryMapper; +use Modules\QA\Models\QACategory; /** * Task class. @@ -25,6 +33,13 @@ use phpOMS\Message\ResponseAbstract; * @license OMS License 1.0 * @link https://orange-management.org * @since 1.0.0 + * + * @todo Orange-Management/Modules#70 + * There is no voting implemented right now, this needs to be added (visually and model/database) + * + * @todo Orange-Management/Modules#78 + * Edit functionality + * Currently nothing can be edited (change) */ final class ApiController extends Controller { @@ -147,7 +162,7 @@ final class ApiController extends Controller $answer = new QAAnswer(); $answer->setName((string) $request->getData('title')); - $answer->setQuestion((string) $request->getData('plain')); + $answer->setAnswer((string) $request->getData('plain')); $answer->setQuestion((int) $request->getData('question')); $answer->setStatus((int) $request->getData('status')); diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 7bc4ba6..ae38211 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -30,6 +30,10 @@ use phpOMS\Views\View; * @license OMS License 1.0 * @link https://orange-management.org * @since 1.0.0 + * + * @todo Orange-Management/Modules#78 + * Edit functionality + * Currently nothing can be edited (change) */ final class BackendController extends Controller { diff --git a/Theme/Backend/qa-dashboard.tpl.php b/Theme/Backend/qa-dashboard.tpl.php index d782fff..c706dec 100644 --- a/Theme/Backend/qa-dashboard.tpl.php +++ b/Theme/Backend/qa-dashboard.tpl.php @@ -1,4 +1,17 @@ -getData('questions'); echo $this->getData('nav')->render(); ?> diff --git a/Theme/Backend/qa-question.tpl.php b/Theme/Backend/qa-question.tpl.php index eb82c62..303a15a 100644 --- a/Theme/Backend/qa-question.tpl.php +++ b/Theme/Backend/qa-question.tpl.php @@ -1,6 +1,25 @@ -getData('question'); -$answers = $question->getAnswers(); +$answers = $question->getAnswers(); echo $this->getData('nav')->render(); ?> diff --git a/Theme/Backend/qa-tag-list.tpl.php b/Theme/Backend/qa-tag-list.tpl.php index 399c75a..0f9f7ae 100644 --- a/Theme/Backend/qa-tag-list.tpl.php +++ b/Theme/Backend/qa-tag-list.tpl.php @@ -12,6 +12,11 @@ */ declare(strict_types=1); +/** + * @todo Orange-Management/Modules#73 + * Profile pics + * There are no profile pics in questions and answers. Implement! + */ $tags = $this->getData('tags');