Skip to content

Commit

Permalink
[FEATURE] Update of Analysis/Search/Detail view
Browse files Browse the repository at this point in the history
  • Loading branch information
einpraegsam committed Feb 26, 2024
1 parent 413418b commit a6911e3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
12 changes: 9 additions & 3 deletions Classes/Controller/AnalysisController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/SearchRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,14 @@ <h3 class="panel-title">Filter</h3>
</td>
</tr>
</f:section>

<f:section name="search">
<tr>
<th>
<f:translate key="LLL:EXT:lux/Resources/Private/Language/locallang_db.xlf:tx_lux_domain_model_search.searchterm">Searchterm</f:translate>
</th>
<td>
{filter.searchterm}
</td>
</tr>
</f:section>
3 changes: 3 additions & 0 deletions Resources/Private/Templates/Analysis/DetailSearch.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ <h3 class="panel-title">
</div>
</div>
<div class="col-md-4">
<f:alias map="{type:'search'}">
<f:render partial="Box/Miscellaneous/FilterInformation" arguments="{_all}"/>
</f:alias>
<f:alias map="{headerPostfix:searchterm}">
<f:render partial="Box/Analysis/Search" arguments="{_all}"/>
</f:alias>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ <h3 class="panel-title">
</f:if>
</div>
</div>

<f:alias map="{headerPostfix:searchterm}">
<f:render partial="Box/Analysis/Search" arguments="{_all}"/>
</f:alias>

0 comments on commit a6911e3

Please sign in to comment.