Skip to content

Commit

Permalink
Merge branch 'release/35.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
einpraegsam committed Mar 26, 2024
2 parents ea78705 + 253557d commit 959af2b
Show file tree
Hide file tree
Showing 178 changed files with 4,911 additions and 1,854 deletions.
5 changes: 1 addition & 4 deletions Classes/Backend/Units/AbstractUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ protected function initializeFilter(): void
{
$filter = ObjectUtility::getFilterDto();
if ($this->filterClass !== '' && $this->filterFunction !== '') {
$filterFromSession = BackendUtility::getSessionValue('filter', $this->filterFunction, $this->filterClass);
if (is_a($filterFromSession, FilterDto::class)) {
$filter = $filterFromSession;
}
$filter = BackendUtility::getFilterFromSession($this->filterFunction, $this->filterClass);
}
$this->filter = $filter;
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Backend/Units/Analysis/Dashboard/Pagevisits.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function assignAdditionalVariables(): array
return [];
}
return [
'numberOfVisitorsData' => GeneralUtility::makeInstance(PagevisistsDataProvider::class),
'numberOfVisitorsData' => GeneralUtility::makeInstance(PagevisistsDataProvider::class, $this->filter),
];
}
}
2 changes: 1 addition & 1 deletion Classes/Backend/Units/Lead/Dashboard/Hottest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function assignAdditionalVariables(): array
}
$visitorRepository = GeneralUtility::makeInstance(VisitorRepository::class);
return [
'hottestVisitors' => $visitorRepository->findByHottestScorings($this->filter),
'hottestVisitors' => $visitorRepository->findByHottestScorings($this->filter->setLimit(10)),
];
}
}
14 changes: 13 additions & 1 deletion Classes/Backend/Units/Lead/Dashboard/Identifiedpermonth.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,20 @@ protected function assignAdditionalVariables(): array
return [];
}
$logRepository = GeneralUtility::makeInstance(LogRepository::class);
$identifiedLogsFromMonths = $logRepository->findIdentifiedLogsFromMonths($this->filter->setLimit(6));
return [
'identifiedPerMonth' => $logRepository->findIdentifiedLogsFromMonths(),
'identifiedPerMonth' => $identifiedLogsFromMonths,
'dataAvailable' => $this->isDataAvailable($identifiedLogsFromMonths),
];
}

protected function isDataAvailable(array $data): bool
{
foreach ($data as $item) {
if ($item !== []) {
return true;
}
}
return false;
}
}
2 changes: 2 additions & 0 deletions Classes/Command/LuxAnonymizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver;
use Doctrine\DBAL\Exception as ExceptionDbal;
use In2code\Lux\Domain\Service\AnonymizeService;
use In2code\Lux\Exception\ConfigurationException;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -31,6 +32,7 @@ public function configure()
* @return int
* @throws ExceptionDbalDriver
* @throws ExceptionDbal
* @throws ConfigurationException
*/
public function execute(InputInterface $input, OutputInterface $output): int
{
Expand Down
11 changes: 0 additions & 11 deletions Classes/Command/LuxCacheWarmupCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
declare(strict_types=1);
namespace In2code\Lux\Command;

use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver;
use Doctrine\DBAL\Exception as ExceptionDbal;
use In2code\Lux\Domain\Cache\CacheLayer;
use In2code\Lux\Domain\Cache\CacheWarmup;
use In2code\Lux\Domain\Repository\PageRepository;
use In2code\Lux\Exception\ConfigurationException;
use In2code\Lux\Exception\ContextException;
use In2code\Lux\Exception\UnexpectedValueException;
use In2code\Lux\Utility\CacheLayerUtility;
use In2code\Lux\Utility\ConfigurationUtility;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException;
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException;
use TYPO3\CMS\Core\Core\Environment;
Expand Down Expand Up @@ -50,10 +47,7 @@ public function configure()
* @throws ExceptionDbalDriver
* @throws ExtensionConfigurationExtensionNotConfiguredException
* @throws ExtensionConfigurationPathDoesNotExistException
* @throws RouteNotFoundException
* @throws UnexpectedValueException
* @throws ExceptionDbal
* @throws DBALException
*/
public function execute(InputInterface $input, OutputInterface $output): int
{
Expand Down Expand Up @@ -83,8 +77,6 @@ public function execute(InputInterface $input, OutputInterface $output): int
* @param string $route
* @param array $configuration
* @return void
* @throws RouteNotFoundException
* @throws UnexpectedValueException
* @throws ConfigurationException
*/
protected function warmupSingleLayer(string $route, array $configuration): void
Expand All @@ -97,11 +89,8 @@ protected function warmupSingleLayer(string $route, array $configuration): void
* @param array $configuration
* @return void
* @throws ExceptionDbalDriver
* @throws RouteNotFoundException
* @throws UnexpectedValueException
* @throws ConfigurationException
* @throws ExceptionDbal
* @throws DBALException
*/
protected function warmupMultipleLayers(string $route, array $configuration): void
{
Expand Down
2 changes: 2 additions & 0 deletions Classes/Command/LuxCleanupUnknownVisitorsByAgeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
declare(strict_types=1);
namespace In2code\Lux\Command;

use Doctrine\DBAL\Exception as ExceptionDbal;
use In2code\Lux\Domain\Model\Visitor;
use In2code\Lux\Domain\Repository\VisitorRepository;
use Symfony\Component\Console\Command\Command;
Expand Down Expand Up @@ -33,6 +34,7 @@ public function configure()
* @param OutputInterface $output
* @return int
* @throws InvalidQueryException
* @throws ExceptionDbal
*/
public function execute(InputInterface $input, OutputInterface $output): int
{
Expand Down
2 changes: 2 additions & 0 deletions Classes/Command/LuxCleanupVisitorByUidCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
declare(strict_types=1);
namespace In2code\Lux\Command;

use Doctrine\DBAL\Exception as ExceptionDbal;
use In2code\Lux\Domain\Model\Visitor;
use In2code\Lux\Domain\Repository\VisitorRepository;
use Symfony\Component\Console\Command\Command;
Expand Down Expand Up @@ -30,6 +31,7 @@ public function configure()
* @param InputInterface $input
* @param OutputInterface $output
* @return int
* @throws ExceptionDbal
*/
public function execute(InputInterface $input, OutputInterface $output): int
{
Expand Down
2 changes: 2 additions & 0 deletions Classes/Command/LuxCleanupVisitorsByAgeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
declare(strict_types=1);
namespace In2code\Lux\Command;

use Doctrine\DBAL\Exception as ExceptionDbal;
use In2code\Lux\Domain\Model\Visitor;
use In2code\Lux\Domain\Repository\VisitorRepository;
use Symfony\Component\Console\Command\Command;
Expand Down Expand Up @@ -33,6 +34,7 @@ public function configure()
* @param OutputInterface $output
* @return int
* @throws InvalidQueryException
* @throws ExceptionDbal
*/
public function execute(InputInterface $input, OutputInterface $output): int
{
Expand Down
2 changes: 2 additions & 0 deletions Classes/Command/LuxCleanupVisitorsByPropertyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
declare(strict_types=1);
namespace In2code\Lux\Command;

use Doctrine\DBAL\Exception as ExceptionDbal;
use In2code\Lux\Domain\Model\Visitor;
use In2code\Lux\Domain\Repository\VisitorRepository;
use Symfony\Component\Console\Command\Command;
Expand Down Expand Up @@ -35,6 +36,7 @@ public function configure()
* @param OutputInterface $output
* @return int
* @throws InvalidQueryException
* @throws ExceptionDbal
*/
public function execute(InputInterface $input, OutputInterface $output): int
{
Expand Down
3 changes: 2 additions & 1 deletion Classes/Command/LuxLeadSendSummaryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public function execute(InputInterface $input, OutputInterface $output): int
$filter
->setTimeFrame((int)$input->getArgument('timeframe'))
->setScoring((int)$input->getArgument('minimumScoring'))
->setIdentified((int)$input->getArgument('identified'));
->setIdentified((int)$input->getArgument('identified'))
->setLimit(750);
$visitors = $visitorRepository->findAllWithIdentifiedFirst($filter);

if (count($visitors) > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public function execute(InputInterface $input, OutputInterface $output): int
$filter
->setTimeFrame((int)$input->getArgument('timeframe'))
->setScoring((int)$input->getArgument('minimumScoring'))
->setCategoryScoring((int)$input->getArgument('luxCategory'));
->setCategoryScoring((int)$input->getArgument('luxCategory'))
->setLimit(750);
$visitors = $visitorRepository->findAllWithKnownCompanies($filter);

if (count($visitors) > 0) {
Expand Down
3 changes: 2 additions & 1 deletion Classes/Command/LuxLeadSendSummaryOfLuxCategoryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public function execute(InputInterface $input, OutputInterface $output): int
$filter
->setTimeFrame((int)$input->getArgument('timeframe'))
->setIdentified((int)$input->getArgument('identified'))
->setCategoryScoring((int)$input->getArgument('luxCategory'));
->setCategoryScoring((int)$input->getArgument('luxCategory'))
->setLimit(750);
$visitors = $visitorRepository->findAllWithIdentifiedFirst($filter);

if (count($visitors) > 0) {
Expand Down
39 changes: 5 additions & 34 deletions Classes/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -136,7 +135,7 @@ public function initializeAction()
* Always set a default FilterDto even if there are no filter params. In addition, remove categoryScoring with 0 to
* avoid propertymapping exceptions
*
* @param int $timePeriod
* @param int $timePeriod if anything else then default (0) is given, $filter->isPeriodSet() will be true
* @return void
* @throws NoSuchArgumentException
*/
Expand All @@ -148,49 +147,21 @@ protected function setFilter(int $timePeriod = FilterDto::PERIOD_DEFAULT): void

// Save to session
if ($this->request->hasArgument('filter') === false) {
$filter = BackendUtility::getSessionValue('filter', $this->getActionName(), $this->getControllerName());
$filter = array_merge(['timePeriod' => $timePeriod], $filter);
$filter = BackendUtility::getFilterArrayFromSession($this->getActionName(), $this->getControllerName());
if ($filter === []) {
$filter['timePeriodDefault'] = $timePeriod;
}
} else {
$filter = (array)$this->request->getArgument('filter');
BackendUtility::saveValueToSession('filter', $this->getActionName(), $this->getControllerName(), $filter);
}

if (array_key_exists('categoryScoring', $filter)
&& (is_array($filter['categoryScoring']) || $filter['categoryScoring'] === '')) {
$filter['categoryScoring'] = 0;
}
if (array_key_exists('branchCode', $filter)
&& (is_array($filter['branchCode']) || $filter['branchCode'] === '')) {
$filter['branchCode'] = 0;
}
if (isset($filter['identified']) && $filter['identified'] === '') {
$filter['identified'] = FilterDto::IDENTIFIED_ALL;
}
$this->request = $this->request->withArgument('filter', $filter);
}

protected function getFilterFromSessionForAjaxRequests(string $action, string $searchterm = ''): FilterDto
{
$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(), []);
Expand Down
Loading

0 comments on commit 959af2b

Please sign in to comment.