diff --git a/Classes/Controller/AnalysisController.php b/Classes/Controller/AnalysisController.php index 50158241..4698cabe 100644 --- a/Classes/Controller/AnalysisController.php +++ b/Classes/Controller/AnalysisController.php @@ -3,12 +3,10 @@ declare(strict_types=1); namespace In2code\Lux\Controller; -use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver; use Doctrine\DBAL\Exception as ExceptionDbal; use Exception; use In2code\Lux\Domain\DataProvider\AllLinkclickDataProvider; -use In2code\Lux\Domain\DataProvider\DomainDataProvider; use In2code\Lux\Domain\DataProvider\DomainNewsDataProvider; use In2code\Lux\Domain\DataProvider\DownloadsDataProvider; use In2code\Lux\Domain\DataProvider\LanguagesDataProvider; @@ -16,7 +14,9 @@ use In2code\Lux\Domain\DataProvider\LinkclickDataProvider; use In2code\Lux\Domain\DataProvider\NewsvisistsDataProvider; use In2code\Lux\Domain\DataProvider\PagevisistsDataProvider; +use In2code\Lux\Domain\DataProvider\ReferrerAmountDataProvider; use In2code\Lux\Domain\DataProvider\SearchDataProvider; +use In2code\Lux\Domain\DataProvider\SocialMediaDataProvider; use In2code\Lux\Domain\DataProvider\UtmCampaignDataProvider; use In2code\Lux\Domain\DataProvider\UtmDataProvider; use In2code\Lux\Domain\DataProvider\UtmMediaDataProvider; @@ -36,7 +36,6 @@ use TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException; use TYPO3\CMS\Extbase\Http\ForwardResponse; use TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException; -use TYPO3\CMS\Extbase\Object\Exception as ExceptionExtbaseObject; use TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException; use TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException; @@ -88,8 +87,6 @@ public function initializeContentAction(): void * @throws ExceptionDbal * @throws ExceptionDbalDriver * @throws InvalidQueryException - * @throws DBALException - * @throws ExceptionExtbaseObject */ public function contentAction(FilterDto $filter, string $export = ''): ResponseInterface { @@ -105,7 +102,8 @@ public function contentAction(FilterDto $filter, string $export = ''): ResponseI 'pages' => $this->pagevisitsRepository->findCombinedByPageIdentifier($filter), 'downloads' => $this->downloadRepository->findCombinedByHref($filter), 'languageData' => GeneralUtility::makeInstance(LanguagesDataProvider::class, $filter), - 'domainData' => GeneralUtility::makeInstance(DomainDataProvider::class, $filter), + 'referrerAmountData' => GeneralUtility::makeInstance(ReferrerAmountDataProvider::class, $filter), + 'socialMediaData' => GeneralUtility::makeInstance(SocialMediaDataProvider::class, $filter), ]); $this->addDocumentHeaderForCurrentController(); @@ -118,7 +116,6 @@ public function contentAction(FilterDto $filter, string $export = ''): ResponseI * @throws ExceptionDbal * @throws InvalidQueryException * @throws ExceptionDbalDriver - * @throws ExceptionExtbaseObject */ public function contentCsvAction(FilterDto $filter): ResponseInterface { @@ -170,7 +167,6 @@ public function newsAction(FilterDto $filter, string $export = ''): ResponseInte * @return ResponseInterface * @throws ExceptionDbal * @throws ExceptionDbalDriver - * @throws DBALException */ public function newsCsvAction(FilterDto $filter): ResponseInterface { @@ -196,7 +192,6 @@ public function initializeUtmAction(): void * @throws ExceptionDbalDriver * @throws InvalidQueryException * @throws ExceptionDbal - * @throws DBALException */ public function utmAction(FilterDto $filter, string $export = ''): ResponseInterface { @@ -326,7 +321,6 @@ public function deleteLinkListenerAction(LinkListener $linkListener): ResponseIn * @return ResponseInterface * @throws ExceptionDbal * @throws ExceptionDbalDriver - * @throws DBALException */ public function detailPageAction(Page $page): ResponseInterface { @@ -345,7 +339,6 @@ public function detailPageAction(Page $page): ResponseInterface * @return ResponseInterface * @throws ExceptionDbalDriver * @throws ExceptionDbal - * @throws DBALException */ public function detailNewsAction(News $news): ResponseInterface { @@ -423,7 +416,6 @@ public function detailSearchAction(string $searchterm): ResponseInterface * @return ResponseInterface * @noinspection PhpUnused * @throws ExceptionDbalDriver - * @throws DBALException */ public function detailAjaxPage(ServerRequestInterface $request): ResponseInterface { @@ -453,7 +445,6 @@ public function detailAjaxPage(ServerRequestInterface $request): ResponseInterfa * @return ResponseInterface * @noinspection PhpUnused * @throws ExceptionDbalDriver - * @throws DBALException */ public function detailNewsAjaxPage(ServerRequestInterface $request): ResponseInterface { diff --git a/Classes/Domain/Model/Transfer/FilterDto.php b/Classes/Domain/Model/Transfer/FilterDto.php index 60f08fc4..17d5db1b 100644 --- a/Classes/Domain/Model/Transfer/FilterDto.php +++ b/Classes/Domain/Model/Transfer/FilterDto.php @@ -11,6 +11,7 @@ use In2code\Lux\Domain\Repository\CategoryRepository; use In2code\Lux\Domain\Service\SiteService; use In2code\Lux\Utility\DateUtility; +use In2code\Lux\Utility\StringUtility; use Throwable; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -792,7 +793,7 @@ public function getAllowedSites(): array public function getSitesForFilter(): array { if ($this->isSiteSet()) { - return [$this->getSite()]; + return [StringUtility::cleanString($this->getSite())]; } return array_merge(array_keys($this->getAllowedSites()), ['']); } diff --git a/Classes/Domain/Repository/PagevisitRepository.php b/Classes/Domain/Repository/PagevisitRepository.php index da964df3..3910f977 100644 --- a/Classes/Domain/Repository/PagevisitRepository.php +++ b/Classes/Domain/Repository/PagevisitRepository.php @@ -4,7 +4,6 @@ namespace In2code\Lux\Domain\Repository; use DateTime; -use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver; use Doctrine\DBAL\Exception as ExceptionDbal; use Exception; @@ -196,8 +195,7 @@ public function findLastByVisitorAndTime(Visitor $visitor, DateTime $time): ?Pag * @param Page $page * @param int $limit * @return array - * @throws DBALException - * @throws ExceptionDbalDriver + * @throws ExceptionDbal */ public function findByPage(Page $page, int $limit = 100): array { @@ -213,7 +211,6 @@ public function findByPage(Page $page, int $limit = 100): array * @param Visitor $visitor * @return DateTime|null * @throws ExceptionDbal - * @throws ExceptionDbalDriver */ public function findLatestDateByVisitor(Visitor $visitor): ?DateTime { @@ -233,7 +230,6 @@ public function findLatestDateByVisitor(Visitor $visitor): ?DateTime * @param int $pageIdentifier * @return DateTime|null * @throws ExceptionDbal - * @throws ExceptionDbalDriver */ public function findLatestDateByVisitorAndPageIdentifier(Visitor $visitor, int $pageIdentifier): ?DateTime { @@ -250,8 +246,7 @@ public function findLatestDateByVisitorAndPageIdentifier(Visitor $visitor, int $ /** * @return int - * @throws DBALException - * @throws ExceptionDbalDriver + * @throws ExceptionDbal */ public function findAllAmount(): int { @@ -263,9 +258,7 @@ public function findAllAmount(): int * @param int $pageIdentifier * @param FilterDto $filter * @return int - * @throws DBALException * @throws Exception - * @throws ExceptionDbalDriver */ public function findAmountPerPage(int $pageIdentifier, FilterDto $filter): int { @@ -281,7 +274,6 @@ public function findAmountPerPage(int $pageIdentifier, FilterDto $filter): int * @param Visitor $visitor * @return int * @throws ExceptionDbal - * @throws ExceptionDbalDriver */ public function findAmountPerPageAndVisitor(int $pageIdentifier, Visitor $visitor): int { @@ -304,7 +296,6 @@ public function findAmountPerPageAndVisitor(int $pageIdentifier, Visitor $visito * @return array * @throws Exception * @throws ExceptionDbal - * @throws ExceptionDbalDriver */ public function getAmountOfReferrers(FilterDto $filter, int $limit = 100): array { @@ -314,6 +305,7 @@ public function getAmountOfReferrers(FilterDto $filter, int $limit = 100): array . ' where referrer != ""' . ' and referrer not like ' . $connection->quote('%' . $domainLike . '%') . $this->extendWhereClauseWithFilterTime($filter) + . $this->extendWhereClauseWithFilterSite($filter) . ' group by referrer having (count > 1) order by count desc limit ' . $limit; $records = (array)$connection->executeQuery($sql)->fetchAllAssociative(); $result = []; @@ -375,9 +367,7 @@ protected function getAmountOfSocialMediaReferrersFromShorteners(array $result, /** * @param FilterDto $filter * @return array - * @throws DBALException * @throws Exception - * @throws ExceptionDbalDriver */ public function getDomainsWithAmountOfVisits(FilterDto $filter): array { @@ -401,9 +391,7 @@ public function getDomainsWithAmountOfVisits(FilterDto $filter): array * * @param FilterDto $filter * @return array - * @throws DBALException * @throws Exception - * @throws ExceptionDbalDriver */ public function getAllDomains(FilterDto $filter): array { @@ -421,9 +409,7 @@ public function getAllDomains(FilterDto $filter): array /** * @param FilterDto $filter * @return array - * @throws DBALException * @throws Exception - * @throws ExceptionDbalDriver */ public function getAllLanguages(FilterDto $filter): array { @@ -443,9 +429,7 @@ public function getAllLanguages(FilterDto $filter): array * @param int $pageIdentifier * @param FilterDto $filter * @return int - * @throws DBALException * @throws Exception - * @throws ExceptionDbalDriver */ public function findAbandonsForPage(int $pageIdentifier, FilterDto $filter): int { @@ -501,8 +485,7 @@ protected function findOneByCompany(Company $company, string $orderings = 'asc') * @param FilterDto $filter1 * @param FilterDto $filter2 * @return int positive if more visitors in filter1 period then in filter2, negative for the opposite situation - * @throws DBALException - * @throws ExceptionDbalDriver + * @throws Exception */ public function compareAmountPerPage(int $pageIdentifier, FilterDto $filter1, FilterDto $filter2): int { diff --git a/Resources/Private/Partials/Filter/Analysis/Content.html b/Resources/Private/Partials/Filter/Analysis/Content.html index 87d2a5bb..6f40961d 100644 --- a/Resources/Private/Partials/Filter/Analysis/Content.html +++ b/Resources/Private/Partials/Filter/Analysis/Content.html @@ -21,30 +21,34 @@
- -
-
Scoring
+
Zeit
-
@@ -62,7 +66,19 @@
-
Category
+
Scoring
+ +
+ + +
- -
- - -
diff --git a/Resources/Private/Templates/Analysis/Content.html b/Resources/Private/Templates/Analysis/Content.html index eba5d138..219d0d5e 100644 --- a/Resources/Private/Templates/Analysis/Content.html +++ b/Resources/Private/Templates/Analysis/Content.html @@ -23,7 +23,8 @@
- + +