From a6911e38eb16f89499dbc20f6b06406daa1997d6 Mon Sep 17 00:00:00 2001 From: Alexander Kellner Date: Mon, 26 Feb 2024 12:22:59 +0100 Subject: [PATCH] [FEATURE] Update of Analysis/Search/Detail view --- Classes/Controller/AnalysisController.php | 12 +++++++++--- Classes/Domain/Repository/SearchRepository.php | 2 +- .../Box/Miscellaneous/FilterInformation.html | 11 +++++++++++ .../Private/Templates/Analysis/DetailSearch.html | 3 +++ .../Templates/Analysis/SearchDetailPageAjax.html | 4 ++++ 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Classes/Controller/AnalysisController.php b/Classes/Controller/AnalysisController.php index 52deff93..abd61163 100644 --- a/Classes/Controller/AnalysisController.php +++ b/Classes/Controller/AnalysisController.php @@ -414,11 +414,16 @@ public function detailLinkListenerAction(Linklistener $linkListener): ResponseIn */ public function detailSearchAction(string $searchterm): ResponseInterface { - $filter = ObjectUtility::getFilterDto()->setSearchterm($searchterm); + $filter = BackendUtility::getFilterFromSession( + 'search', + $this->getControllerName(), + ['searchterm' => $searchterm, 'limit' => 100] + ); $this->view->assignMultiple([ + 'filter' => $filter, 'searchterm' => $searchterm, 'searchData' => GeneralUtility::makeInstance(SearchDataProvider::class, $filter), - 'searches' => $this->searchRepository->findBySearchterm($filter), + 'searches' => $this->searchRepository->findByFilter($filter), ]); $this->addDocumentHeaderForCurrentController(); @@ -524,8 +529,9 @@ public function detailSearchAjaxPage(ServerRequestInterface $request): ResponseI ['searchterm' => urldecode($request->getQueryParams()['searchterm']), 'limit' => 10] ); $standaloneView->assignMultiple([ - 'searches' => $this->searchRepository->findBySearchterm($filter), + 'searches' => $this->searchRepository->findByFilter($filter), 'searchterm' => $request->getQueryParams()['searchterm'], + 'searchData' => GeneralUtility::makeInstance(SearchDataProvider::class, $filter), ]); $response = GeneralUtility::makeInstance(JsonResponse::class); /** @var StreamInterface $stream */ diff --git a/Classes/Domain/Repository/SearchRepository.php b/Classes/Domain/Repository/SearchRepository.php index 28f125fc..6f781594 100644 --- a/Classes/Domain/Repository/SearchRepository.php +++ b/Classes/Domain/Repository/SearchRepository.php @@ -46,7 +46,7 @@ public function findCombinedBySearchIdentifier(FilterDto $filter): array return $connection->executeQuery($sql)->fetchAllAssociative(); } - public function findBySearchterm(FilterDto $filter): QueryResultInterface + public function findByFilter(FilterDto $filter): QueryResultInterface { $sql = 'select s.* from ' . Search::TABLE_NAME . ' s' . ' left join ' . Pagevisit::TABLE_NAME . ' pv on s.pagevisit = pv.uid' diff --git a/Resources/Private/Partials/Box/Miscellaneous/FilterInformation.html b/Resources/Private/Partials/Box/Miscellaneous/FilterInformation.html index cbe96340..c209eeb6 100644 --- a/Resources/Private/Partials/Box/Miscellaneous/FilterInformation.html +++ b/Resources/Private/Partials/Box/Miscellaneous/FilterInformation.html @@ -102,3 +102,14 @@

Filter

+ + + + + Searchterm + + + {filter.searchterm} + + + diff --git a/Resources/Private/Templates/Analysis/DetailSearch.html b/Resources/Private/Templates/Analysis/DetailSearch.html index f1b91c22..1188137c 100644 --- a/Resources/Private/Templates/Analysis/DetailSearch.html +++ b/Resources/Private/Templates/Analysis/DetailSearch.html @@ -62,6 +62,9 @@

+ + + diff --git a/Resources/Private/Templates/Analysis/SearchDetailPageAjax.html b/Resources/Private/Templates/Analysis/SearchDetailPageAjax.html index bd1c0c1c..3b76b3e4 100644 --- a/Resources/Private/Templates/Analysis/SearchDetailPageAjax.html +++ b/Resources/Private/Templates/Analysis/SearchDetailPageAjax.html @@ -43,3 +43,7 @@

+ + + +