diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index 5d4630ca..31fa1ec9 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -26,7 +26,6 @@ use In2code\Lux\Domain\Service\RenderingTimeService; use In2code\Lux\Utility\BackendUtility; use In2code\Lux\Utility\ConfigurationUtility; -use In2code\Lux\Utility\ObjectUtility; use In2code\Lux\Utility\StringUtility; use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Backend\Module\ExtbaseModule; @@ -160,30 +159,6 @@ protected function setFilter(int $timePeriod = FilterDto::PERIOD_DEFAULT): void $this->request = $this->request->withArgument('filter', $filter); } - protected function getFilterFromSessionForAjaxRequests(string $action, string $searchterm = ''): FilterDto - { - // Todo: Remove - die(__CLASS__ . ':' . __LINE__); - $filterValues = BackendUtility::getSessionValue('filter', $action, $this->getControllerName()); - $filter = ObjectUtility::getFilterDto(); - if (!empty($searchterm)) { - $filter->setSearchterm($searchterm); - } - if (!empty($filterValues['timeFrom'])) { - $filter->setTimeFrom((string)$filterValues['timeFrom']); - } - if (!empty($filterValues['timeTo'])) { - $filter->setTimeTo((string)$filterValues['timeTo']); - } - if (!empty($filterValues['scoring'])) { - $filter->setScoring((int)$filterValues['scoring']); - } - if (!empty($filterValues['categoryscoring'])) { - $filter->setCategoryScoring((int)$filterValues['categoryscoring']); - } - return $filter; - } - public function resetFilterAction(string $redirectAction): ResponseInterface { BackendUtility::saveValueToSession('filter', $redirectAction, $this->getControllerName(), []); diff --git a/Classes/Controller/AnalysisController.php b/Classes/Controller/AnalysisController.php index abd61163..41efbaef 100644 --- a/Classes/Controller/AnalysisController.php +++ b/Classes/Controller/AnalysisController.php @@ -57,7 +57,6 @@ public function initializeDashboardAction(): void * @throws ExceptionDbal * @throws InvalidConfigurationTypeException * @throws InvalidQueryException - * @throws ExceptionDbalDriver */ public function dashboardAction(FilterDto $filter): ResponseInterface { @@ -141,7 +140,6 @@ public function initializeNewsAction(): void * @param string $export * @return ResponseInterface * @throws Exception - * @throws ExceptionDbalDriver */ public function newsAction(FilterDto $filter, string $export = ''): ResponseInterface { @@ -188,7 +186,6 @@ public function initializeUtmAction(): void * @param FilterDto $filter * @param string $export * @return ResponseInterface - * @throws ExceptionDbalDriver * @throws InvalidQueryException * @throws ExceptionDbal */ @@ -243,7 +240,6 @@ public function initializeLinkListenerAction(): void * @param string $export * @return ResponseInterface * @throws ExceptionDbal - * @throws ExceptionDbalDriver * @throws InvalidQueryException */ public function linkListenerAction(FilterDto $filter, string $export = ''): ResponseInterface @@ -290,7 +286,6 @@ public function initializeSearchAction(): void * @param FilterDto $filter * @return ResponseInterface * @throws ExceptionDbal - * @throws ExceptionDbalDriver */ public function searchAction(FilterDto $filter): ResponseInterface { @@ -320,7 +315,6 @@ public function deleteLinkListenerAction(LinkListener $linkListener): ResponseIn * @param Page $page * @return ResponseInterface * @throws ExceptionDbal - * @throws ExceptionDbalDriver * @throws ArgumentsException */ public function detailPageAction(Page $page): ResponseInterface @@ -343,8 +337,8 @@ public function detailPageAction(Page $page): ResponseInterface /** * @param News $news * @return ResponseInterface - * @throws ExceptionDbalDriver * @throws ExceptionDbal + * @throws ArgumentsException */ public function detailNewsAction(News $news): ResponseInterface { @@ -368,7 +362,6 @@ public function detailNewsAction(News $news): ResponseInterface * @param string $href * @return ResponseInterface * @throws ExceptionDbal - * @throws ExceptionDbalDriver * @throws InvalidQueryException */ public function detailDownloadAction(string $href): ResponseInterface @@ -392,14 +385,19 @@ public function detailDownloadAction(string $href): ResponseInterface * @param Linklistener $linkListener * @return ResponseInterface * @throws ExceptionDbal - * @throws ExceptionDbalDriver + * @throws InvalidQueryException */ public function detailLinkListenerAction(Linklistener $linkListener): ResponseInterface { - $filter = $this->getFilterFromSessionForAjaxRequests('linkListener', (string)$linkListener->getUid()); + $filter = BackendUtility::getFilterFromSession( + 'linkClick', + $this->getControllerName(), + ['searchterm' => (string)$linkListener->getUid(), 'limit' => 100] + ); $this->view->assignMultiple([ - 'linkListener' => $linkListener, - 'allLinkclickData' => GeneralUtility::makeInstance(AllLinkclickDataProvider::class, $filter), + 'filter' => $filter, + 'linkclicks' => $this->linkclickRepository->findByFilter($filter), +// 'allLinkclickData' => GeneralUtility::makeInstance(AllLinkclickDataProvider::class, $filter), ]); $this->addDocumentHeaderForCurrentController(); @@ -410,7 +408,6 @@ public function detailLinkListenerAction(Linklistener $linkListener): ResponseIn * @param string $searchterm * @return ResponseInterface * @throws ExceptionDbal - * @throws ExceptionDbalDriver */ public function detailSearchAction(string $searchterm): ResponseInterface { @@ -469,6 +466,7 @@ public function detailAjaxPage(ServerRequestInterface $request): ResponseInterfa * @return ResponseInterface * @noinspection PhpUnused * @throws ExceptionDbal + * @throws ArgumentsException */ public function detailNewsAjaxPage(ServerRequestInterface $request): ResponseInterface { @@ -553,10 +551,7 @@ public function detailAjaxDownload(ServerRequestInterface $request): ResponseInt $filter = BackendUtility::getFilterFromSession( 'content', 'Analysis', - [ - 'href' => (string)$request->getQueryParams()['download'], - 'limit' => 10, - ] + ['href' => (string)$request->getQueryParams()['download'], 'limit' => 10] ); $standaloneView = ObjectUtility::getStandaloneView(); $standaloneView->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName( @@ -578,22 +573,22 @@ public function detailAjaxDownload(ServerRequestInterface $request): ResponseInt * @param ServerRequestInterface $request * @return ResponseInterface * @noinspection PhpUnused + * @throws InvalidQueryException */ public function detailAjaxLinklistener(ServerRequestInterface $request): ResponseInterface { - /** @var Linklistener $linkListener */ - $linkListener = $this->linklistenerRepository->findByIdentifier( - (int)$request->getQueryParams()['linkListener'] + $filter = BackendUtility::getFilterFromSession( + 'linkListener', + 'Analysis', + ['searchterm' => (string)$request->getQueryParams()['linkListener'], 'limit' => 10] ); - $filter = $this->getFilterFromSessionForAjaxRequests('linkListener', (string)$linkListener->getUid()); $standaloneView = ObjectUtility::getStandaloneView(); $standaloneView->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName( 'EXT:lux/Resources/Private/Templates/Analysis/LinkListenerAjax.html' )); $standaloneView->setPartialRootPaths(['EXT:lux/Resources/Private/Partials/']); $standaloneView->assignMultiple([ - 'linkListener' => $linkListener, - 'linkclicks' => $this->linkclickRepository->findByLinklistenerIdentifier($linkListener->getUid(), 10), + 'linkclicks' => $this->linkclickRepository->findByFilter($filter), 'allLinkclickData' => GeneralUtility::makeInstance(AllLinkclickDataProvider::class, $filter), ]); $response = GeneralUtility::makeInstance(JsonResponse::class); @@ -606,7 +601,6 @@ public function detailAjaxLinklistener(ServerRequestInterface $request): Respons /** * @return void * @throws ExceptionDbal - * @throws ExceptionDbalDriver */ protected function addDocumentHeaderForCurrentController(): void { diff --git a/Classes/Domain/DataProvider/AllLinkclickDataProvider.php b/Classes/Domain/DataProvider/AllLinkclickDataProvider.php index 3a8c7f76..e2edc3c5 100644 --- a/Classes/Domain/DataProvider/AllLinkclickDataProvider.php +++ b/Classes/Domain/DataProvider/AllLinkclickDataProvider.php @@ -49,7 +49,7 @@ public function __construct(FilterDto $filter = null) public function prepareData(): void { $intervals = $this->filter->getIntervals(); - $frequency = $intervals['frequency']; + $frequency = (string)$intervals['frequency']; $pageList = $this->getRelatedPageListToLinkclicks($intervals['intervals']); foreach ($intervals['intervals'] as $interval) { $clicks = $this->linkclickRepository->findByTimeFrame( diff --git a/Classes/Domain/Repository/LinkclickRepository.php b/Classes/Domain/Repository/LinkclickRepository.php index f71bc906..6779ac7e 100644 --- a/Classes/Domain/Repository/LinkclickRepository.php +++ b/Classes/Domain/Repository/LinkclickRepository.php @@ -11,6 +11,7 @@ use In2code\Lux\Domain\Model\Transfer\FilterDto; use In2code\Lux\Utility\DatabaseUtility; use In2code\Lux\Utility\DateUtility; +use TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException; use TYPO3\CMS\Extbase\Persistence\QueryInterface; use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; @@ -167,15 +168,20 @@ public function findLastDateByLinklistenerAndPage(int $linklistener, int $page): } /** - * @param int $linklistenerIdentifier - * @param int $limit + * @param FilterDto $filter * @return QueryResultInterface + * @throws InvalidQueryException */ - public function findByLinklistenerIdentifier(int $linklistenerIdentifier, int $limit): QueryResultInterface + public function findByFilter(FilterDto $filter): QueryResultInterface { $query = $this->createQuery(); - $query->matching($query->equals('linklistener', $linklistenerIdentifier)); - $query->setLimit($limit); + $logicalAnd = [ + $query->equals('linklistener', (int)$filter->getSearchterm()), + ]; + $logicalAnd = $this->extendLogicalAndWithFilterConstraintsForCrdate($filter, $query, $logicalAnd); + $logicalAnd = $this->extendLogicalAndWithFilterConstraintsForSite($filter, $query, $logicalAnd); + $query->matching($query->logicalAnd(...$logicalAnd)); + $query->setLimit($filter->getLimit()); $query->setOrderings(['crdate' => QueryInterface::ORDER_DESCENDING]); return $query->execute(); } diff --git a/Resources/Private/Partials/Box/Miscellaneous/FilterInformation.html b/Resources/Private/Partials/Box/Miscellaneous/FilterInformation.html index c209eeb6..a2afb0fb 100644 --- a/Resources/Private/Partials/Box/Miscellaneous/FilterInformation.html +++ b/Resources/Private/Partials/Box/Miscellaneous/FilterInformation.html @@ -113,3 +113,14 @@

Filter

+ + + + + Link Listener UID + + + {filter.searchterm} + + + diff --git a/Resources/Private/Partials/Filter/Lead/Dashboard.html b/Resources/Private/Partials/Filter/Lead/Dashboard.html index 37b3b226..671599c8 100644 --- a/Resources/Private/Partials/Filter/Lead/Dashboard.html +++ b/Resources/Private/Partials/Filter/Lead/Dashboard.html @@ -2,7 +2,25 @@
-
+
+
+
+ + +
+
- - + + @@ -25,26 +25,20 @@

- + - + - - + + @@ -61,7 +55,10 @@

- + + + +
diff --git a/Resources/Private/Templates/Analysis/LinkListenerAjax.html b/Resources/Private/Templates/Analysis/LinkListenerAjax.html index 54905161..0c03316a 100644 --- a/Resources/Private/Templates/Analysis/LinkListenerAjax.html +++ b/Resources/Private/Templates/Analysis/LinkListenerAjax.html @@ -6,7 +6,7 @@

- +

{linkListener.title}{linkclick.linkListener.title} - {linkClick.visitor.fullName} - {linkClick.visitor.scoring} - - {linkClick.visitor.hottestCategoryscoring.scoring} - {linkClick.visitor.company}{linkClick.visitor.location} - {linkClick.visitor.latestFingerprint.value} - - {linkClick.crdate} + + {linkclick.crdate}
@@ -20,7 +20,7 @@

- + @@ -35,7 +35,7 @@

{linkListener.title}{linkclick.linkListener.title} {linkclick.visitor.fullName}
- + @@ -44,6 +44,6 @@

- +