From 5375ae450a4676affe42bde0bdef723211393e63 Mon Sep 17 00:00:00 2001 From: Kurt Gusbeth Date: Thu, 21 Nov 2024 17:00:25 +0100 Subject: [PATCH] Version 5.2.0 --- Classes/Controller/ParticipantController.php | 24 +++----- Classes/Controller/QuestionController.php | 14 ++--- Classes/Controller/QuizController.php | 58 +++++++++---------- Classes/Domain/Model/Participant.php | 2 +- Classes/Domain/Model/Question.php | 2 +- .../Domain/Repository/QuestionRepository.php | 2 +- Classes/Domain/Repository/QuizRepository.php | 23 ++------ .../Domain/Repository/SelectedRepository.php | 4 +- .../Task/CsvExportAdditionalFieldProvider.php | 2 +- Classes/Task/CsvExportTask.php | 4 +- ...leteParticipantAdditionalFieldProvider.php | 2 +- Classes/Task/DeleteParticipantTask.php | 25 ++++---- .../Provider/ParticipantsDataProvider.php | 2 +- Configuration/TypoScript/constants.typoscript | 4 +- Configuration/TypoScript/setup.typoscript | 1 + Configuration/page.tsconfig | 1 + Documentation/ChangeLog/Index.rst | 8 ++- README.md | 7 ++- .../Private/Backend/Layouts/Default.html | 2 +- .../Backend/Templates/Answer/List.html | 27 --------- .../Backend/Templates/Answer/Show.html | 11 ---- .../Backend/Templates/Participant/Detail.html | 3 +- .../Backend/Templates/Participant/List.html | 4 +- .../Backend/Templates/Question/Move.html | 5 +- .../Backend/Templates/Quiz/Charts.html | 5 +- .../Backend/Templates/Quiz/Detail.html | 5 +- .../Private/Backend/Templates/Quiz/Index.html | 3 +- .../Backend/Templates/Selected/List.html | 27 --------- Resources/Private/Templates/Answer/List.html | 40 ------------- Resources/Private/Templates/Answer/Show.html | 23 -------- .../Private/Templates/Participant/List.html | 42 -------------- .../Private/Templates/Question/List.html | 46 --------------- .../Private/Templates/Question/Show.html | 23 -------- .../Private/Templates/Selected/List.html | 40 ------------- Resources/Private/Templates/Tag/List.html | 40 ------------- Resources/Public/Css/Backend.css | 3 - ext_emconf.php | 2 +- 37 files changed, 97 insertions(+), 439 deletions(-) create mode 100644 Configuration/page.tsconfig delete mode 100644 Resources/Private/Backend/Templates/Answer/List.html delete mode 100644 Resources/Private/Backend/Templates/Answer/Show.html delete mode 100644 Resources/Private/Backend/Templates/Selected/List.html delete mode 100644 Resources/Private/Templates/Answer/List.html delete mode 100644 Resources/Private/Templates/Answer/Show.html delete mode 100644 Resources/Private/Templates/Participant/List.html delete mode 100644 Resources/Private/Templates/Question/List.html delete mode 100644 Resources/Private/Templates/Question/Show.html delete mode 100644 Resources/Private/Templates/Selected/List.html delete mode 100644 Resources/Private/Templates/Tag/List.html diff --git a/Classes/Controller/ParticipantController.php b/Classes/Controller/ParticipantController.php index c2eb4b2..21b19a7 100644 --- a/Classes/Controller/ParticipantController.php +++ b/Classes/Controller/ParticipantController.php @@ -77,14 +77,14 @@ public function listAction(int $currentPage = 1): ResponseInterface $participantPaginator = new ArrayPaginator($participantArray, $currentPage, $this->settings['pagebrowser']['itemsPerPage']); $participantPagination = new SimplePagination($participantPaginator); - $this->view->assign('pid', $pid); - $this->view->assign('qid', $qid); - $this->view->assign('participants', $participants); - $this->view->assign('paginator', $participantPaginator); - $this->view->assign('pagination', $participantPagination); - $this->view->assign('pages', range(1, $participantPagination->getLastPageNumber())); + $this->moduleTemplate->assign('pid', $pid); + $this->moduleTemplate->assign('qid', $qid); + $this->moduleTemplate->assign('participants', $participants); + $this->moduleTemplate->assign('paginator', $participantPaginator); + $this->moduleTemplate->assign('pagination', $participantPagination); + $this->moduleTemplate->assign('pages', range(1, $participantPagination->getLastPageNumber())); $this->addDocHeaderDropDown('list'); - return $this->defaultRendering(); + return $this->moduleTemplate->renderResponse('Participant/List'); } /** @@ -110,9 +110,9 @@ public function detailAction(Participant $participant): ResponseInterface } } - $this->view->assign('participant', $participant); + $this->moduleTemplate->assign('participant', $participant); $this->addDocHeaderDropDown('list'); - return $this->defaultRendering(); + return $this->moduleTemplate->renderResponse('Participant/Detail'); } /** @@ -137,12 +137,6 @@ protected function getLanguageService(): LanguageService return $GLOBALS['LANG']; } - protected function defaultRendering(): ResponseInterface - { - $this->moduleTemplate->setContent($this->view->render()); - return $this->htmlResponse($this->moduleTemplate->renderContent()); - } - protected function addDocHeaderDropDown(string $currentAction): void { $languageService = $this->getLanguageService(); diff --git a/Classes/Controller/QuestionController.php b/Classes/Controller/QuestionController.php index 9259cb0..a96a20c 100644 --- a/Classes/Controller/QuestionController.php +++ b/Classes/Controller/QuestionController.php @@ -68,11 +68,11 @@ public function moveAction(Quiz $quiz, Question $question = NULL): ResponseInter } $questions = $this->questionRepository->findOtherThan($pid, $quiz->getUid()); - $this->view->assign('question', $question); - $this->view->assign('questions', $questions); - $this->view->assign('quiz', $quiz); + $this->moduleTemplate->assign('question', $question); + $this->moduleTemplate->assign('questions', $questions); + $this->moduleTemplate->assign('quiz', $quiz); $this->addDocHeaderDropDown('index'); - return $this->defaultRendering(); + return $this->moduleTemplate->renderResponse('Question/Move'); } /* @@ -83,12 +83,6 @@ protected function getLanguageService(): LanguageService return $GLOBALS['LANG']; } - protected function defaultRendering(): ResponseInterface - { - $this->moduleTemplate->setContent($this->view->render()); - return $this->htmlResponse($this->moduleTemplate->renderContent()); - } - protected function addDocHeaderDropDown(string $currentAction): void { $languageService = $this->getLanguageService(); diff --git a/Classes/Controller/QuizController.php b/Classes/Controller/QuizController.php index fe2f36a..9e79a7f 100644 --- a/Classes/Controller/QuizController.php +++ b/Classes/Controller/QuizController.php @@ -2,9 +2,6 @@ namespace Fixpunkt\FpMasterquiz\Controller; -use TYPO3\CMS\Fluid\View\StandaloneView; -use TYPO3\CMS\Core\Mail\MailMessage; -use Symfony\Component\Mime\Address; use Fixpunkt\FpMasterquiz\Domain\Repository\QuizRepository; use Fixpunkt\FpMasterquiz\Domain\Repository\AnswerRepository; use Fixpunkt\FpMasterquiz\Domain\Repository\ParticipantRepository; @@ -25,10 +22,13 @@ use TYPO3\CMS\Extbase\Utility\LocalizationUtility; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Pagination\ArrayPaginator; -use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Backend\Template\ModuleTemplate; use TYPO3\CMS\Backend\Template\ModuleTemplateFactory; +use TYPO3\CMS\Fluid\View\StandaloneView; +use TYPO3\CMS\Core\Mail\MailMessage; +use Symfony\Component\Mime\Address; +use Psr\Http\Message\ResponseInterface; use Psr\Log\LoggerInterface; /*** @@ -1229,7 +1229,7 @@ protected function evaluateInputTextAnswerResult(int $i_quid, } // for security reasons check the input from the frontend - $answerText = filter_var($answerText, FILTER_SANITIZE_STRING); + $answerText = htmlspecialchars($answerText); //filter_var($answerText, FILTER_SANITIZE_STRING); // store the answer of the participant in the selected dataset $c_selected->setEntered($answerText); @@ -1239,7 +1239,7 @@ protected function evaluateInputTextAnswerResult(int $i_quid, $c_selected->addAnswer($answer); if ($i_question->getQmode() == 3) { - // sum the the points of the current answer to the max. possible point until the current question + // sum the points of the current answer to the max. possible point until the current question $maximum1 += $answer->getPoints(); // if the answer is right @@ -1294,7 +1294,7 @@ public function getFeUser(int $userid): array $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('fe_users'); $queryBuilder = $connection->createQueryBuilder(); $statement = $queryBuilder->select('*')->from('fe_users')->where( - $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($userid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($userid, \TYPO3\CMS\Core\Database\Connection::PARAM_INT)) )->setMaxResults(1)->executeQuery(); while ($row = $statement->fetch()) { return $row; @@ -2123,11 +2123,11 @@ public function indexAction(): ResponseInterface $otherLangs[] = $this->quizRepository->findFormUidAndPidOtherLanguages($quiz->getUid()); } - $this->view->assign('pid', $pid); - $this->view->assign('quizzes', $quizzes); - $this->view->assign('otherQuizzes', $otherLangs); + $this->moduleTemplate->assign('pid', $pid); + $this->moduleTemplate->assign('quizzes', $quizzes); + $this->moduleTemplate->assign('otherQuizzes', $otherLangs); $this->addDocHeaderDropDown('index'); - return $this->defaultRendering(); + return $this->moduleTemplate->renderResponse('Quiz/Index'); } /** @@ -2162,30 +2162,30 @@ public function detailAction(Quiz $quiz): ResponseInterface $lostArray[$question->getUid()] = $question->getTitle(); } - $this->view->assign('quiz', $quiz); - $this->view->assign('lostArray', $lostArray); - $this->view->assign('lost', count($lostArray)); - $this->view->assign('updated', $updated); + $this->moduleTemplate->assign('quiz', $quiz); + $this->moduleTemplate->assign('lostArray', $lostArray); + $this->moduleTemplate->assign('lost', count($lostArray)); + $this->moduleTemplate->assign('updated', $updated); if ($this->request->hasArgument('prop')) { - $this->view->assign('prop', $this->request->getArgument('prop')); + $this->moduleTemplate->assign('prop', $this->request->getArgument('prop')); } else { - $this->view->assign('prop', 0); + $this->moduleTemplate->assign('prop', 0); } if ($this->request->hasArgument('user')) { - $this->view->assign('user', $this->request->getArgument('user')); + $this->moduleTemplate->assign('user', $this->request->getArgument('user')); } else { - $this->view->assign('user', 0); + $this->moduleTemplate->assign('user', 0); } if ($this->request->hasArgument('chart')) { - $this->view->assign('chart', $this->request->getArgument('chart')); + $this->moduleTemplate->assign('chart', $this->request->getArgument('chart')); } else { - $this->view->assign('chart', 0); + $this->moduleTemplate->assign('chart', 0); } $this->addDocHeaderDropDown('index'); - return $this->defaultRendering(); + return $this->moduleTemplate->renderResponse('Quiz/Detail'); } /** @@ -2197,11 +2197,11 @@ public function chartsAction(Quiz $quiz): ResponseInterface $pid = $be ? $this->id : (int)$GLOBALS['TSFE']->id; $debug = $this->setAllUserAnswers($quiz, $pid, $be); - $this->view->assign('debug', $debug); - $this->view->assign('pid', $pid); - $this->view->assign('quiz', $quiz); + $this->moduleTemplate->assign('debug', $debug); + $this->moduleTemplate->assign('pid', $pid); + $this->moduleTemplate->assign('quiz', $quiz); $this->addDocHeaderDropDown('index'); - return $this->defaultRendering(); + return $this->moduleTemplate->renderResponse('Quiz/Charts'); } /** @@ -2268,12 +2268,6 @@ protected function getLanguageService(): LanguageService return $GLOBALS['LANG']; } - protected function defaultRendering(): ResponseInterface - { - $this->moduleTemplate->setContent($this->view->render()); - return $this->htmlResponse($this->moduleTemplate->renderContent()); - } - protected function addDocHeaderDropDown(string $currentAction): void { $languageService = $this->getLanguageService(); diff --git a/Classes/Domain/Model/Participant.php b/Classes/Domain/Model/Participant.php index 9642618..2a455ad 100644 --- a/Classes/Domain/Model/Participant.php +++ b/Classes/Domain/Model/Participant.php @@ -314,7 +314,7 @@ public function getUsername() ->select('username') ->from('fe_users') ->where( - $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($this->user, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter(intval($this->user), \TYPO3\CMS\Core\Database\Connection::PARAM_INT)) ) ->setMaxResults(1) ->executeQuery(); diff --git a/Classes/Domain/Model/Question.php b/Classes/Domain/Model/Question.php index b61fc0a..c37854d 100644 --- a/Classes/Domain/Model/Question.php +++ b/Classes/Domain/Model/Question.php @@ -689,7 +689,7 @@ public function getSortedCategoriesArray() { $queryBuilder->expr()->eq('mm.uid_local', $queryBuilder->quoteIdentifier('sys_category.uid')) ) ->where( - $queryBuilder->expr()->eq('mm.uid_foreign', $queryBuilder->createNamedParameter($this->uid, \PDO::PARAM_INT)), + $queryBuilder->expr()->eq('mm.uid_foreign', $queryBuilder->createNamedParameter(intval($this->uid), \TYPO3\CMS\Core\Database\Connection::PARAM_INT)), $queryBuilder->expr()->eq('mm.tablenames', $queryBuilder->createNamedParameter('tx_fpmasterquiz_domain_model_question')) ) ->orderBy('sys_category.sorting') diff --git a/Classes/Domain/Repository/QuestionRepository.php b/Classes/Domain/Repository/QuestionRepository.php index b4f906c..4af9b72 100644 --- a/Classes/Domain/Repository/QuestionRepository.php +++ b/Classes/Domain/Repository/QuestionRepository.php @@ -80,7 +80,7 @@ public function moveToQuiz($questionID, $quizID) $queryBuilder ->update($table) ->where( - $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($questionID, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter(intval($questionID), \TYPO3\CMS\Core\Database\Connection::PARAM_INT)) ) ->set('quiz', intval($quizID)) ->executeStatement(); diff --git a/Classes/Domain/Repository/QuizRepository.php b/Classes/Domain/Repository/QuizRepository.php index f9a1182..0f61096 100644 --- a/Classes/Domain/Repository/QuizRepository.php +++ b/Classes/Domain/Repository/QuizRepository.php @@ -4,6 +4,7 @@ use TYPO3\CMS\Extbase\Persistence\Repository; use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Persistence\QueryInterface; use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; @@ -53,32 +54,16 @@ public function initializeObject() */ public function getMyLocalizedUid(int $defaultQuizUid, int $sys_language_uid) { - /* - $query = $this->createQuery(); - //$query->getQuerySettings()->setReturnRawQueryResult(TRUE); // funktioniert leider nicht - $query->matching( - $query->logicalAnd( - $query->equals('l10n_parent', $defaultQuizUid), - $query->equals('sys_language_uid', $sys_language_uid) - ) - ); - $result = $query->execute()->getFirst(); - if ($result) { - return $result->getUid(); - } else { - return 0; - } - */ $uid = 0; $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_fpmasterquiz_domain_model_quiz'); $statement = $queryBuilder ->select('uid') ->from('tx_fpmasterquiz_domain_model_quiz') ->where( - $queryBuilder->expr()->eq('l10n_parent', $queryBuilder->createNamedParameter($defaultQuizUid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('l10n_parent', $queryBuilder->createNamedParameter($defaultQuizUid, Connection::PARAM_INT)) ) ->andWhere( - $queryBuilder->expr()->eq('sys_language_uid', $queryBuilder->createNamedParameter($sys_language_uid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('sys_language_uid', $queryBuilder->createNamedParameter($sys_language_uid, Connection::PARAM_INT)) ) ->setMaxResults(1) ->executeQuery(); @@ -117,7 +102,7 @@ public function findFormUidAndPidOtherLanguages(int $uid) ->select('*') ->from('tx_fpmasterquiz_domain_model_quiz') ->where( - $queryBuilder->expr()->eq('l10n_parent', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('l10n_parent', $queryBuilder->createNamedParameter($uid, Connection::PARAM_INT)) ) ->executeQuery(); return $statement->fetchAllAssociative(); diff --git a/Classes/Domain/Repository/SelectedRepository.php b/Classes/Domain/Repository/SelectedRepository.php index c057480..e0bd20a 100644 --- a/Classes/Domain/Repository/SelectedRepository.php +++ b/Classes/Domain/Repository/SelectedRepository.php @@ -127,8 +127,8 @@ public function deleteByParticipantAndQuestion($participantId, $questionId) ->from($table) ->where( $queryBuilder->expr()->and( - $queryBuilder->expr()->eq('participant', $queryBuilder->createNamedParameter($participantId, \PDO::PARAM_INT)), - $queryBuilder->expr()->eq('question', $queryBuilder->createNamedParameter($questionId, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('participant', $queryBuilder->createNamedParameter(intval($participantId), \TYPO3\CMS\Core\Database\Connection::PARAM_INT)), + $queryBuilder->expr()->eq('question', $queryBuilder->createNamedParameter(intval($questionId), \TYPO3\CMS\Core\Database\Connection::PARAM_INT)) ) ) ->executeQuery() diff --git a/Classes/Task/CsvExportAdditionalFieldProvider.php b/Classes/Task/CsvExportAdditionalFieldProvider.php index c1ceb2c..a053bf2 100644 --- a/Classes/Task/CsvExportAdditionalFieldProvider.php +++ b/Classes/Task/CsvExportAdditionalFieldProvider.php @@ -124,7 +124,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC ->count('uid') ->from('pages') ->where( - $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter((int)$submittedData['fpmasterquiz']['page'], \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter((int)$submittedData['fpmasterquiz']['page'], \TYPO3\CMS\Core\Database\Connection::PARAM_INT)) ) ->executeQuery() ->fetchOne(); diff --git a/Classes/Task/CsvExportTask.php b/Classes/Task/CsvExportTask.php index 62788b9..fc7878f 100644 --- a/Classes/Task/CsvExportTask.php +++ b/Classes/Task/CsvExportTask.php @@ -214,7 +214,7 @@ public function execute() { $queryBuilder->expr()->eq('mm.uid_foreign', $queryBuilder->quoteIdentifier('tx_fpmasterquiz_domain_model_answer.uid')) ) ->where( - $queryBuilder->expr()->eq('tx_fpmasterquiz_domain_model_answer.pid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('tx_fpmasterquiz_domain_model_answer.pid', $queryBuilder->createNamedParameter($uid, \TYPO3\CMS\Core\Database\Connection::PARAM_INT)) ) ->orderBy('mm.sorting', 'ASC') ->executeQuery(); @@ -252,7 +252,7 @@ public function execute() { $queryBuilder->expr()->eq('question.uid', $queryBuilder->quoteIdentifier('tx_fpmasterquiz_domain_model_selected.question')) ) ->where( - $queryBuilder->expr()->eq('tx_fpmasterquiz_domain_model_selected.pid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('tx_fpmasterquiz_domain_model_selected.pid', $queryBuilder->createNamedParameter($uid, \TYPO3\CMS\Core\Database\Connection::PARAM_INT)) ) ->orderBy('part.uid', 'DESC') ->addOrderBy('suid', 'ASC') diff --git a/Classes/Task/DeleteParticipantAdditionalFieldProvider.php b/Classes/Task/DeleteParticipantAdditionalFieldProvider.php index 700c1a8..ca4d0b7 100644 --- a/Classes/Task/DeleteParticipantAdditionalFieldProvider.php +++ b/Classes/Task/DeleteParticipantAdditionalFieldProvider.php @@ -84,7 +84,7 @@ public function validateAdditionalFields(array &$submittedData, SchedulerModuleC ->count('uid') ->from('pages') ->where( - $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter((int)$submittedData['fp_masterquiz']['page'], \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter((int)$submittedData['fp_masterquiz']['page'], \TYPO3\CMS\Core\Database\Connection::PARAM_INT)) ) ->executeQuery() ->fetchOne(); diff --git a/Classes/Task/DeleteParticipantTask.php b/Classes/Task/DeleteParticipantTask.php index 05f639f..c41ccbf 100644 --- a/Classes/Task/DeleteParticipantTask.php +++ b/Classes/Task/DeleteParticipantTask.php @@ -4,6 +4,7 @@ use TYPO3\CMS\Scheduler\Task\AbstractTask; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\Database\Connection; class DeleteParticipantTask extends AbstractTask { @@ -105,14 +106,14 @@ public function execute() { ->select('uid') ->from('tx_fpmasterquiz_domain_model_participant') ->where( - $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($pid, Connection::PARAM_INT)) ) ->andWhere( - $queryBuilder->expr()->lt('crdate', $queryBuilder->createNamedParameter($past, \PDO::PARAM_INT)) + $queryBuilder->expr()->lt('crdate', $queryBuilder->createNamedParameter($past, Connection::PARAM_INT)) ) ->executeQuery(); while ($row = $statement->fetch()) { - $participantArray[] = $row['uid']; + $participantArray[] = intval($row['uid']); } foreach ($participantArray as $participantUid) { @@ -120,7 +121,7 @@ public function execute() { $queryBuilder ->update('tx_fpmasterquiz_domain_model_selected') ->where( - $queryBuilder->expr()->eq('participant', $queryBuilder->createNamedParameter($participantUid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('participant', $queryBuilder->createNamedParameter($participantUid, Connection::PARAM_INT)) ) ->set('deleted', '1') ->set('tstamp', $now) @@ -129,7 +130,7 @@ public function execute() { $queryBuilder ->update('tx_fpmasterquiz_domain_model_participant') ->where( - $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($participantUid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($participantUid, Connection::PARAM_INT)) ) ->set('deleted', '1') ->set('tstamp', $now) @@ -141,14 +142,14 @@ public function execute() { ->select('uid') ->from('tx_fpmasterquiz_domain_model_selected') ->where( - $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($pid, Connection::PARAM_INT)) ) ->andWhere( - $queryBuilder->expr()->lt('crdate', $queryBuilder->createNamedParameter($past, \PDO::PARAM_INT)) + $queryBuilder->expr()->lt('crdate', $queryBuilder->createNamedParameter($past, Connection::PARAM_INT)) ) ->executeQuery(); while ($row = $statement->fetch()) { - $selectedArray[] = $row['uid']; + $selectedArray[] = intval($row['uid']); } $table = 'tx_fpmasterquiz_selected_answer_mm'; @@ -157,7 +158,7 @@ public function execute() { $queryBuilder ->delete($table) ->where( - $queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter($selectedUid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('uid_local', $queryBuilder->createNamedParameter($selectedUid, Connection::PARAM_INT)) ) ->executeStatement(); } @@ -168,7 +169,7 @@ public function execute() { $queryBuilder ->delete($table) ->where( - $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($selectedUid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($selectedUid, Connection::PARAM_INT)) ) ->executeStatement(); } @@ -178,10 +179,10 @@ public function execute() { $queryBuilder ->delete($table) ->where( - $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($pid, \PDO::PARAM_INT)) + $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($pid, Connection::PARAM_INT)) ) ->andWhere( - $queryBuilder->expr()->lt('crdate', $queryBuilder->createNamedParameter($past, \PDO::PARAM_INT)) + $queryBuilder->expr()->lt('crdate', $queryBuilder->createNamedParameter($past, Connection::PARAM_INT)) ) ->executeStatement(); } diff --git a/Classes/Widgets/Provider/ParticipantsDataProvider.php b/Classes/Widgets/Provider/ParticipantsDataProvider.php index 9ba83e5..a7cdd32 100644 --- a/Classes/Widgets/Provider/ParticipantsDataProvider.php +++ b/Classes/Widgets/Provider/ParticipantsDataProvider.php @@ -123,7 +123,7 @@ public function getRecentParticipants(): array $answerArray = $queryBuilder ->select('participant', 'answertable.title AS answertitle', 'questiontable.title AS questiontitle') ->from('tx_fpmasterquiz_domain_model_selected') - ->where($queryBuilder->expr()->eq('participant', $queryBuilder->createNamedParameter($result['partid'], \PDO::PARAM_INT))) + ->where($queryBuilder->expr()->eq('participant', $queryBuilder->createNamedParameter((int) $result['partid'], \TYPO3\CMS\Core\Database\Connection::PARAM_INT))) ->join( 'tx_fpmasterquiz_domain_model_selected', 'tx_fpmasterquiz_selected_answer_mm', diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript index e45a565..0c252d1 100644 --- a/Configuration/TypoScript/constants.typoscript +++ b/Configuration/TypoScript/constants.typoscript @@ -21,11 +21,9 @@ plugin.tx_fpmasterquiz { module.tx_fpmasterquiz_mod1 { view { - # cat=module.tx_fpmasterquiz_mod1/file; type=string; label=Path to template root (BE) + # no longer in use! templateRootPath = EXT:fp_masterquiz/Resources/Private/Backend/Templates/ - # cat=module.tx_fpmasterquiz_mod1/file; type=string; label=Path to template partials (BE) partialRootPath = EXT:fp_masterquiz/Resources/Private/Backend/Partials/ - # cat=module.tx_fpmasterquiz_mod1/file; type=string; label=Path to template layouts (BE) layoutRootPath = EXT:fp_masterquiz/Resources/Private/Backend/Layouts/ } persistence { diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index ab8d558..b9dbf86 100644 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -120,6 +120,7 @@ module.tx_fpmasterquiz { storagePid = {$module.tx_fpmasterquiz_mod1.persistence.storagePid} } view { + # no longer in use! templateRootPaths.0 = EXT:fp_masterquiz/Resources/Private/Backend/Templates/ templateRootPaths.1 = {$module.tx_fpmasterquiz_mod1.view.templateRootPath} partialRootPaths.0 = EXT:fp_masterquiz/Resources/Private/Backend/Partials/ diff --git a/Configuration/page.tsconfig b/Configuration/page.tsconfig new file mode 100644 index 0000000..ecfbb98 --- /dev/null +++ b/Configuration/page.tsconfig @@ -0,0 +1 @@ +templates.fixpunkt/fp-masterquiz.1 = fixpunkt/fp-masterquiz:Resources/Private/Backend/ \ No newline at end of file diff --git a/Documentation/ChangeLog/Index.rst b/Documentation/ChangeLog/Index.rst index 1e8d78d..732272f 100644 --- a/Documentation/ChangeLog/Index.rst +++ b/Documentation/ChangeLog/Index.rst @@ -241,5 +241,9 @@ ChangeLog 5.1.9: Bugfix: points calculation for modes 3 and 4. -Changes in 5.1.10/1: - Bugfix: allow backend-module for users. \ No newline at end of file +5.1.10/1: + Bugfix: allow backend-module for users. + +5.2.0: + Refactoring with the rector-project. + Preparations for TYPO3 13. Attention: the path to the backend templates is now defined in Configuration/page.tsconfig. \ No newline at end of file diff --git a/README.md b/README.md index 02f14f9..01dd653 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # fp_masterquiz -version 5.1.12 +version 5.2.0 TYPO3 extension to create a quiz, poll or test. The participant result will be saved in the DB too and can be deleted automatically via Scheduler. @@ -53,5 +53,6 @@ Changes in 5.1.9: Changes in 5.1.11: - Bugfix: allow backend-module for users. -Changes in 5.1.12: -- Refactoring with the rector-project. \ No newline at end of file +Changes in 5.2.0: +- Refactoring with the rector-project. +- Preparations for TYPO3 13. Attention: the path to the backend templates is now defined in Configuration/page.tsconfig. \ No newline at end of file diff --git a/Resources/Private/Backend/Layouts/Default.html b/Resources/Private/Backend/Layouts/Default.html index 9eadf0e..fc5e456 100644 --- a/Resources/Private/Backend/Layouts/Default.html +++ b/Resources/Private/Backend/Layouts/Default.html @@ -1,7 +1,7 @@ - +
diff --git a/Resources/Private/Backend/Templates/Answer/List.html b/Resources/Private/Backend/Templates/Answer/List.html deleted file mode 100644 index f451f36..0000000 --- a/Resources/Private/Backend/Templates/Answer/List.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - -

Listing for Answer

- - - - - - - - - - - - - - - - - -
{answer.title} {answer.points}EditDelete
- -New Answer -
- \ No newline at end of file diff --git a/Resources/Private/Backend/Templates/Answer/Show.html b/Resources/Private/Backend/Templates/Answer/Show.html deleted file mode 100644 index 574f67f..0000000 --- a/Resources/Private/Backend/Templates/Answer/Show.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - -

Single View for Answer

- - - Back to list
- New Answer -
- \ No newline at end of file diff --git a/Resources/Private/Backend/Templates/Participant/Detail.html b/Resources/Private/Backend/Templates/Participant/Detail.html index 151ef14..392dafc 100644 --- a/Resources/Private/Backend/Templates/Participant/Detail.html +++ b/Resources/Private/Backend/Templates/Participant/Detail.html @@ -1,6 +1,7 @@ - + +

{participant.name}

: {participant.quiz.name}

:

diff --git a/Resources/Private/Backend/Templates/Participant/List.html b/Resources/Private/Backend/Templates/Participant/List.html index e63b637..c1a89e5 100644 --- a/Resources/Private/Backend/Templates/Participant/List.html +++ b/Resources/Private/Backend/Templates/Participant/List.html @@ -1,8 +1,10 @@ - + +

{pid}

+ diff --git a/Resources/Private/Backend/Templates/Question/Move.html b/Resources/Private/Backend/Templates/Question/Move.html index 184e046..510444e 100644 --- a/Resources/Private/Backend/Templates/Question/Move.html +++ b/Resources/Private/Backend/Templates/Question/Move.html @@ -1,6 +1,7 @@ - - + + +

Quiz: {quiz.name}

diff --git a/Resources/Private/Backend/Templates/Quiz/Charts.html b/Resources/Private/Backend/Templates/Quiz/Charts.html index 386675f..a941899 100644 --- a/Resources/Private/Backend/Templates/Quiz/Charts.html +++ b/Resources/Private/Backend/Templates/Quiz/Charts.html @@ -1,9 +1,10 @@ - + + + Multi-Chart from https://speckyboy.com/code-snippets-css3-bar-graphs/ -