diff --git a/Build/config/sites/main/config.yaml b/Build/config/sites/main/config.yaml index bfddad0..27c995e 100644 --- a/Build/config/sites/main/config.yaml +++ b/Build/config/sites/main/config.yaml @@ -24,3 +24,5 @@ languages: flag: de rootPageId: 1 websiteTitle: '' +imports: + - { resource: "EXT:sessionplaner/Configuration/Routes/Default.yaml" } diff --git a/Build/php-cs-fixer/config.php b/Build/php-cs-fixer/config.php index 4ab173b..0aa7267 100644 --- a/Build/php-cs-fixer/config.php +++ b/Build/php-cs-fixer/config.php @@ -40,42 +40,100 @@ ->exclude('var') ) ->setRules([ - '@PSR2' => true, - 'header_comment' => [ - 'header' => $header, + '@DoctrineAnnotation' => true, + // @todo: Switch to @PER-CS2x0 once php-cs-fixer's todo list is + // done: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/7247 + '@PER-CS1x0' => true, + 'array_indentation' => true, + 'array_syntax' => ['syntax' => 'short'], + 'cast_spaces' => ['space' => 'none'], + // @todo: Can be dropped once we enable @PER-CS2x0 + 'concat_space' => ['spacing' => 'one'], + 'declare_equal_normalize' => ['space' => 'none'], + 'declare_parentheses' => true, + 'dir_constant' => true, + // @todo: Can be dropped once we enable @PER-CS2x0 + 'function_declaration' => [ + 'closure_fn_spacing' => 'none', ], - 'general_phpdoc_annotation_remove' => [ - 'annotations' => [ - 'author', - ], + 'function_to_constant' => [ + 'functions' => [ + 'get_called_class', + 'get_class', + 'get_class_this', + 'php_sapi_name', + 'phpversion', + 'pi', + ] ], - 'no_leading_import_slash' => true, - 'no_trailing_comma_in_singleline' => true, - 'no_singleline_whitespace_before_semicolons' => true, - 'no_unused_imports' => true, - 'concat_space' => ['spacing' => 'one'], - 'no_whitespace_in_blank_line' => true, - 'ordered_imports' => true, - 'single_quote' => true, - 'no_empty_statement' => true, - 'no_extra_blank_lines' => true, - 'phpdoc_no_package' => true, - 'phpdoc_scalar' => true, - 'no_blank_lines_after_phpdoc' => true, - 'array_syntax' => ['syntax' => 'short'], - 'whitespace_after_comma_in_array' => true, 'type_declaration_spaces' => true, - 'single_line_comment_style' => true, + 'global_namespace_import' => [ + 'import_classes' => false, + 'import_constants' => false, + 'import_functions' => false, + ], + 'list_syntax' => ['syntax' => 'short'], + // @todo: Can be dropped once we enable @PER-CS2x0 + 'method_argument_space' => true, + 'modernize_strpos' => true, + 'modernize_types_casting' => true, + 'native_function_casing' => true, 'no_alias_functions' => true, - 'lowercase_cast' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => true, 'no_leading_namespace_whitespace' => true, - 'native_function_casing' => true, - 'self_accessor' => true, + 'no_null_property_initialization' => true, 'no_short_bool_cast' => true, + 'no_singleline_whitespace_before_semicolons' => true, + 'no_superfluous_elseif' => true, + 'no_trailing_comma_in_singleline' => true, 'no_unneeded_control_parentheses' => true, - 'trailing_comma_in_multiline' => [ - 'elements' => [ - 'arrays', + 'no_unused_imports' => true, + 'no_useless_else' => true, + 'no_useless_nullsafe_operator' => true, + 'nullable_type_declaration' => [ + 'syntax' => 'question_mark', + ], + 'nullable_type_declaration_for_default_null_value' => true, + 'ordered_class_elements' => ['order' => ['use_trait', 'case', 'constant', 'property']], + 'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'], + 'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']], + 'php_unit_mock_short_will_return' => true, + 'php_unit_test_case_static_method_calls' => ['call_type' => 'self', + 'methods' => [ + 'any' => 'this', + 'atLeast' => 'this', + 'atLeastOnce' => 'this', + 'atMost' => 'this', + 'exactly' => 'this', + 'never' => 'this', + 'onConsecutiveCalls' => 'this', + 'once' => 'this', + 'returnArgument' => 'this', + 'returnCallback' => 'this', + 'returnSelf' => 'this', + 'returnValue' => 'this', + 'returnValueMap' => 'this', + 'throwException' => 'this', ], ], + 'phpdoc_no_access' => true, + 'phpdoc_no_empty_return' => true, + 'phpdoc_no_package' => true, + 'phpdoc_scalar' => true, + 'phpdoc_trim' => true, + 'phpdoc_types' => true, + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], + 'protected_to_private' => true, + 'return_type_declaration' => ['space_before' => 'none'], + 'single_quote' => true, + 'single_space_around_construct' => true, + 'single_line_comment_style' => ['comment_types' => ['hash']], + // @todo: Can be dropped once we enable @PER-CS2x0 + 'single_line_empty_body' => true, + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], + 'whitespace_after_comma_in_array' => ['ensure_single_space' => true], + 'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false], ]); diff --git a/Classes/Constants.php b/Classes/Constants.php index f20cf1b..b3c4f2f 100644 --- a/Classes/Constants.php +++ b/Classes/Constants.php @@ -1,5 +1,6 @@ backendUser = $GLOBALS['BE_USER']; - $this->configurationManager = $configurationManager; - $this->sessionRepository = $sessionRepository; - $this->dayRepository = $dayRepository; - $this->roomRepository = $roomRepository; - $this->slotRepository = $slotRepository; - $this->persistenceManager = $persistenceManager; } public function updateSessionAction(ServerRequestInterface $request): ResponseInterface @@ -66,7 +55,10 @@ public function updateSessionAction(ServerRequestInterface $request): ResponseIn } $data = $this->getParameter($request)['session'] ?? []; - $session = $this->sessionRepository->findAnyByUid((int)$data['uid']); + $uid = (int)($data['uid'] ?? 0); + unset($data['uid']); + + $session = $this->sessionRepository->findAnyByUid($uid); if ($session === null) { return $this->renderResponse([ 'status' => 'error', @@ -94,31 +86,24 @@ public function updateSessionAction(ServerRequestInterface $request): ResponseIn ]); } - protected function validateSession(Session $session): Result + private function validateSession(Session $session): Result { - /** @var ValidatorResolver $validationResolver */ - $validationResolver = GeneralUtility::makeInstance(ValidatorResolver::class); - $validator = $validationResolver->getBaseValidatorConjunction(Session::class); - return $validator->validate($session); + return $this->validatorResolver->getBaseValidatorConjunction(Session::class)->validate($session); } - protected function updateSession(Session $session, array $data = []): void + private function updateSession(Session $session, array $data = []): void { - unset($data['uid']); foreach ($data as $field => $value) { switch ($field) { case 'room': - /** @var Room $room */ $room = $this->roomRepository->findByUid((int)$value); $session->setRoom($room); break; case 'slot': - /** @var Slot $slot */ $slot = $this->slotRepository->findByUid((int)$value); $session->setSlot($slot); break; case 'day': - /** @var Day $day */ $day = $this->dayRepository->findByUid((int)$value); $session->setDay($day); break; @@ -132,26 +117,23 @@ protected function updateSession(Session $session, array $data = []): void } } - protected function hasAccess(): bool + private function hasAccess(): bool { - if (!($this->backendUser->isAdmin() || $this->backendUser->check('modules', 'web_SessionplanerSessionplanerMain'))) { - return false; - } - - return true; + return $this->backendUser->isAdmin() + || $this->backendUser->check('modules', 'web_SessionplanerSessionplanerMain'); } - protected function getParameter(ServerRequestInterface $request): array + private function getParameter(ServerRequestInterface $request): array { try { - $payload = json_decode((string) $request->getBody(), true, 512, JSON_THROW_ON_ERROR); + $payload = json_decode((string)$request->getBody(), true, 512, JSON_THROW_ON_ERROR); return is_array($payload) ? $payload : []; - } catch (\JsonException $exception) { + } catch (\JsonException) { return []; } } - protected function renderResponse(array $data): ResponseInterface + private function renderResponse(array $data): ResponseInterface { return new JsonResponse( [ diff --git a/Classes/Controller/BackendModuleController.php b/Classes/Controller/BackendModuleController.php index 9cc46ed..f9b9932 100644 --- a/Classes/Controller/BackendModuleController.php +++ b/Classes/Controller/BackendModuleController.php @@ -31,31 +31,17 @@ class BackendModuleController extends ActionController { - protected int $id = 0; + protected int $pageId = 0; protected ?Day $currentDay = null; - protected DayRepository $dayRepository; - protected SessionRepository $sessionRepository; - protected ModuleTemplateFactory $moduleTemplateFactory; - protected IconFactory $iconFactory; - protected PageRenderer $pageRenderer; - protected BackendUriBuilder $backendUriBuilder; - public function __construct( - DayRepository $dayRepository, - SessionRepository $sessionRepository, - ModuleTemplateFactory $moduleTemplateFactory, - IconFactory $iconFactory, - PageRenderer $pageRenderer, - BackendUriBuilder $backendUriBuilder - ) { - $this->dayRepository = $dayRepository; - $this->sessionRepository = $sessionRepository; - $this->moduleTemplateFactory = $moduleTemplateFactory; - $this->iconFactory = $iconFactory; - $this->pageRenderer = $pageRenderer; - $this->backendUriBuilder = $backendUriBuilder; - } + protected readonly DayRepository $dayRepository, + protected readonly SessionRepository $sessionRepository, + protected readonly ModuleTemplateFactory $moduleTemplateFactory, + protected readonly IconFactory $iconFactory, + protected readonly PageRenderer $pageRenderer, + protected readonly BackendUriBuilder $backendUriBuilder, + ) {} protected function initializeAction(): void { @@ -70,7 +56,7 @@ public function showAction(): ResponseInterface $parsedBody = []; } $queryParams = $this->request->getQueryParams(); - $this->id = (int)($parsedBody['id'] ?? $queryParams['id'] ?? 0); + $this->pageId = (int)($parsedBody['id'] ?? $queryParams['id'] ?? 0); $day = (int)($parsedBody['day'] ?? $queryParams['day'] ?? 0); if ($day !== 0) { @@ -96,7 +82,7 @@ public function showAction(): ResponseInterface } $view->setTitle($title); - $page = BackendUtility::getRecord('pages', $this->id); + $page = BackendUtility::getRecord('pages', $this->pageId); if ($page !== null && isset($page['doktype']) && (int)$page['doktype'] === Constants::STORAGE_FOLDER_TYPE) { $docHeaderComponent = $view->getDocHeaderComponent(); $this->registerMenuDays($docHeaderComponent->getMenuRegistry()); @@ -132,62 +118,41 @@ protected function registerMenuDays(MenuRegistry $menuRegistry): void protected function registerButtonNewSession(ButtonBar $buttonBar): void { - $parameters = [ - 'edit' => ['tx_sessionplaner_domain_model_session' => [$this->id => 'new']], - 'returnUrl' => $this->createModuleUri(), - ]; - $button = $buttonBar->makeLinkButton() - ->setHref((string)$this->backendUriBuilder->buildUriFromRoute('record_edit', $parameters)) - ->setTitle($this->getLanguageService()->sL('LLL:EXT:sessionplaner/Resources/Private/Language/locallang.xlf:session-new')) - ->setShowLabelText(true) - // @phpstan-ignore classConstant.deprecated - ->setIcon($this->iconFactory->getIcon('actions-plus', Icon::SIZE_SMALL)); - $buttonBar->addButton($button, ButtonBar::BUTTON_POSITION_LEFT, 1); + $this->addButtonToButtonBar($buttonBar, 'tx_sessionplaner_domain_model_session', 'session-new', 1); } protected function registerButtonNewSpeaker(ButtonBar $buttonBar): void { - $parameters = [ - 'edit' => ['tx_sessionplaner_domain_model_speaker' => [$this->id => 'new']], - 'returnUrl' => $this->createModuleUri(), - ]; - $button = $buttonBar->makeLinkButton() - ->setHref((string)$this->backendUriBuilder->buildUriFromRoute('record_edit', $parameters)) - ->setTitle($this->getLanguageService()->sL('LLL:EXT:sessionplaner/Resources/Private/Language/locallang.xlf:speaker-new')) - ->setShowLabelText(true) - // @phpstan-ignore classConstant.deprecated - ->setIcon($this->iconFactory->getIcon('actions-plus', Icon::SIZE_SMALL)); - $buttonBar->addButton($button, ButtonBar::BUTTON_POSITION_LEFT, 2); + $this->addButtonToButtonBar($buttonBar, 'tx_sessionplaner_domain_model_speaker', 'speaker-new', 2); } protected function registerButtonNewRoom(ButtonBar $buttonBar): void { - $parameters = [ - 'edit' => ['tx_sessionplaner_domain_model_room' => [$this->id => 'new']], - 'returnUrl' => $this->createModuleUri(), - ]; - $button = $buttonBar->makeLinkButton() - ->setHref((string)$this->backendUriBuilder->buildUriFromRoute('record_edit', $parameters)) - ->setTitle($this->getLanguageService()->sL('LLL:EXT:sessionplaner/Resources/Private/Language/locallang.xlf:room-new')) - ->setShowLabelText(true) - // @phpstan-ignore classConstant.deprecated - ->setIcon($this->iconFactory->getIcon('actions-plus', Icon::SIZE_SMALL)); - $buttonBar->addButton($button, ButtonBar::BUTTON_POSITION_LEFT, 3); + $this->addButtonToButtonBar($buttonBar, 'tx_sessionplaner_domain_model_room', 'room-new', 3); } protected function registerButtonNewDay(ButtonBar $buttonBar): void { + $this->addButtonToButtonBar($buttonBar, 'tx_sessionplaner_domain_model_day', 'day-new', 4); + } + + protected function addButtonToButtonBar( + ButtonBar $buttonBar, + string $table, + string $labelKey, + int $buttonGroup + ): void { $parameters = [ - 'edit' => ['tx_sessionplaner_domain_model_day' => [$this->id => 'new']], + 'edit' => [$table => [$this->pageId => 'new']], 'returnUrl' => $this->createModuleUri(), ]; $button = $buttonBar->makeLinkButton() ->setHref((string)$this->backendUriBuilder->buildUriFromRoute('record_edit', $parameters)) - ->setTitle($this->getLanguageService()->sL('LLL:EXT:sessionplaner/Resources/Private/Language/locallang.xlf:day-new')) + ->setTitle($this->getLanguageService()->sL('LLL:EXT:sessionplaner/Resources/Private/Language/locallang.xlf:' . $labelKey)) ->setShowLabelText(true) // @phpstan-ignore classConstant.deprecated ->setIcon($this->iconFactory->getIcon('actions-plus', Icon::SIZE_SMALL)); - $buttonBar->addButton($button, ButtonBar::BUTTON_POSITION_LEFT, 4); + $buttonBar->addButton($button, ButtonBar::BUTTON_POSITION_LEFT, $buttonGroup); } public function createModuleUri(array $params = []): string @@ -199,12 +164,12 @@ public function createModuleUri(array $params = []): string } $baseParams = [ - 'id' => (string)$this->id, - 'day' => $this->currentDay !== null ? (string)$this->currentDay->getUid() : '', + 'id' => (string)$this->pageId, + 'day' => (string)$this->currentDay?->getUid(), ]; $params = array_replace_recursive($baseParams, $params); - $params = array_filter($params, static fn ($value) => $value !== null && trim((string)$value) !== ''); + $params = array_filter($params, static fn($value) => $value !== null && trim((string)$value) !== ''); return (string)$this->backendUriBuilder->buildUriFromRoute($route->getOption('_identifier'), $params); } diff --git a/Classes/Controller/SessionController.php b/Classes/Controller/SessionController.php index b5d7c64..6e94ed4 100644 --- a/Classes/Controller/SessionController.php +++ b/Classes/Controller/SessionController.php @@ -14,7 +14,7 @@ use Evoweb\Sessionplaner\Domain\Model\Session; use Evoweb\Sessionplaner\Domain\Repository\DayRepository; use Evoweb\Sessionplaner\Domain\Repository\SessionRepository; -use Evoweb\Sessionplaner\TitleTagProvider\EventTitleTagProvider; +use Evoweb\Sessionplaner\TitleTagProvider\SessionTitleTagProvider; use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Core\Http\HtmlResponse; use TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry; @@ -24,15 +24,10 @@ class SessionController extends ActionController { - protected DayRepository $dayRepository; - - protected SessionRepository $sessionRepository; - - public function __construct(DayRepository $dayRepository, SessionRepository $sessionRepository) - { - $this->dayRepository = $dayRepository; - $this->sessionRepository = $sessionRepository; - } + public function __construct( + protected readonly DayRepository $dayRepository, + protected readonly SessionRepository $sessionRepository, + ) {} public function listAction(?Session $session = null): ResponseInterface { @@ -60,17 +55,19 @@ public function showAction(?Session $session = null): ResponseInterface if ($session === null) { $response = new ForwardResponse('list'); } else { - /** @var EventTitleTagProvider $provider */ - $provider = GeneralUtility::makeInstance(EventTitleTagProvider::class); + /** @var SessionTitleTagProvider $provider */ + $provider = GeneralUtility::makeInstance(SessionTitleTagProvider::class); $provider->setTitle($session->getTopic()); /** @var MetaTagManagerRegistry $metaTagRegistry */ $metaTagRegistry = GeneralUtility::makeInstance(MetaTagManagerRegistry::class); $ogMetaTagManager = $metaTagRegistry->getManagerForProperty('og:title'); + // @extensionScannerIgnoreLine $ogMetaTagManager->addProperty('og:title', $session->getTopic()); $twitterMetaTagManager = $metaTagRegistry->getManagerForProperty('twitter:title'); + // @extensionScannerIgnoreLine $twitterMetaTagManager->addProperty('twitter:title', $session->getTopic()); $this->view->assign('session', $session); diff --git a/Classes/Controller/SessionplanController.php b/Classes/Controller/SessionplanController.php index fdb01f3..a4f5f2b 100644 --- a/Classes/Controller/SessionplanController.php +++ b/Classes/Controller/SessionplanController.php @@ -18,18 +18,12 @@ class SessionplanController extends ActionController { - protected DayRepository $dayRepository; - - public function __construct(DayRepository $dayRepository) - { - $this->dayRepository = $dayRepository; - } + public function __construct(protected readonly DayRepository $dayRepository) {} public function displayAction(): ResponseInterface { $day = $this->dayRepository->findByUid($this->settings['day']); $this->view->assign('day', $day); - return new HtmlResponse($this->view->render()); } } diff --git a/Classes/Controller/SpeakerController.php b/Classes/Controller/SpeakerController.php index 8358275..98868d1 100644 --- a/Classes/Controller/SpeakerController.php +++ b/Classes/Controller/SpeakerController.php @@ -18,6 +18,7 @@ use TYPO3\CMS\Core\Exception\Page\PageNotFoundException; use TYPO3\CMS\Core\Http\HtmlResponse; use TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry; +use TYPO3\CMS\Core\Routing\PageArguments; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Persistence\QueryResultInterface; @@ -25,18 +26,14 @@ class SpeakerController extends ActionController { - protected SpeakerRepository $speakerRepository; - - public function __construct(SpeakerRepository $speakerRepository) - { - $this->speakerRepository = $speakerRepository; - } + public function __construct(protected readonly SpeakerRepository $speakerRepository) {} protected function initializeAction(): void { - if (!isset($this->settings['speakerSinglePid']) || $this->settings['speakerSinglePid'] === '') { - // @phpstan-ignore property.deprecatedClass - $this->settings['speakerSinglePid'] = (string) ($this->getTypoScriptFrontendController()->id ?? ''); + if (($this->settings['speakerSinglePid'] ?? '') === '') { + /** @var PageArguments $pageArguments */ + $pageArguments = $this->request->getAttribute('routing'); + $this->settings['speakerSinglePid'] = (string)$pageArguments->getPageId(); } } @@ -74,19 +71,15 @@ public function showAction(Speaker $speaker): ResponseInterface $metaTagRegistry = GeneralUtility::makeInstance(MetaTagManagerRegistry::class); $ogMetaTagManager = $metaTagRegistry->getManagerForProperty('og:title'); + // @extensionScannerIgnoreLine $ogMetaTagManager->addProperty('og:title', $speaker->getName()); $twitterMetaTagManager = $metaTagRegistry->getManagerForProperty('twitter:title'); + // @extensionScannerIgnoreLine $twitterMetaTagManager->addProperty('twitter:title', $speaker->getName()); $this->view->assign('speaker', $speaker); return new HtmlResponse($this->view->render()); } - - // @phpstan-ignore return.deprecatedClass - protected function getTypoScriptFrontendController(): TypoScriptFrontendController - { - return $GLOBALS['TSFE']; - } } diff --git a/Classes/Controller/TagController.php b/Classes/Controller/TagController.php index c9cf124..a1235fa 100644 --- a/Classes/Controller/TagController.php +++ b/Classes/Controller/TagController.php @@ -36,9 +36,11 @@ public function showAction(?Tag $tag = null): ResponseInterface $metaTagRegistry = GeneralUtility::makeInstance(MetaTagManagerRegistry::class); $ogMetaTagManager = $metaTagRegistry->getManagerForProperty('og:title'); + // @extensionScannerIgnoreLine $ogMetaTagManager->addProperty('og:title', $tag->getLabel()); $twitterMetaTagManager = $metaTagRegistry->getManagerForProperty('twitter:title'); + // @extensionScannerIgnoreLine $twitterMetaTagManager->addProperty('twitter:title', $tag->getLabel()); $this->view->assign('tag', $tag); diff --git a/Classes/DataProcessing/SpeakerProcessor.php b/Classes/DataProcessing/SpeakerProcessor.php index 5332f4a..3982e15 100644 --- a/Classes/DataProcessing/SpeakerProcessor.php +++ b/Classes/DataProcessing/SpeakerProcessor.php @@ -13,17 +13,14 @@ use Evoweb\Sessionplaner\Domain\Model\Speaker; use Evoweb\Sessionplaner\Domain\Repository\SpeakerRepository; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface; +#[Autoconfigure(public: true)] class SpeakerProcessor implements DataProcessorInterface { - protected SpeakerRepository $speakerRepository; - - public function __construct(SpeakerRepository $speakerRepository) - { - $this->speakerRepository = $speakerRepository; - } + public function __construct(protected SpeakerRepository $speakerRepository) {} /** * Add this data processor if you want to have the Speaker object available @@ -34,28 +31,18 @@ public function __construct(SpeakerRepository $speakerRepository) * 1559226337 { * as = speaker * } - * - * @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $cObj - * @param array $contentObjectConfiguration - * @param array $processorConfiguration - * @param array $processedData - * @return array */ public function process( ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData - ) { + ): array { $speaker = $this->speakerRepository->findByDetailPage((int)$processedData['data']['uid']); if ($speaker instanceof Speaker) { - $targetVariableName = (string) $cObj->stdWrapValue('as', $processorConfiguration); - if ($targetVariableName !== '') { - $processedData[$targetVariableName] = $speaker; - } else { - $processedData['speaker'] = $speaker; - } + $targetVariableName = (string)$cObj->stdWrapValue('as', $processorConfiguration, 'speaker'); + $processedData[$targetVariableName] = $speaker; } return $processedData; diff --git a/Classes/Domain/Factory/SuggestFormFactory.php b/Classes/Domain/Factory/SuggestFormFactory.php index 89f5267..51cc5b3 100644 --- a/Classes/Domain/Factory/SuggestFormFactory.php +++ b/Classes/Domain/Factory/SuggestFormFactory.php @@ -17,40 +17,36 @@ use Evoweb\Sessionplaner\Enum\SessionRequestTypeEnum; use Evoweb\Sessionplaner\Enum\SessionTypeEnum; use Psr\Http\Message\ServerRequestInterface; -use TYPO3\CMS\Core\Information\Typo3Version; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Utility\LocalizationUtility; use TYPO3\CMS\Extbase\Validation\Validator\EmailAddressValidator; use TYPO3\CMS\Extbase\Validation\Validator\NotEmptyValidator; use TYPO3\CMS\Extbase\Validation\Validator\StringLengthValidator; +use TYPO3\CMS\Extbase\Validation\ValidatorResolver; use TYPO3\CMS\Form\Domain\Configuration\ConfigurationService; use TYPO3\CMS\Form\Domain\Factory\AbstractFormFactory; use TYPO3\CMS\Form\Domain\Model\FormDefinition; use TYPO3\CMS\Form\Domain\Model\FormElements\GenericFormElement; use TYPO3\CMS\Form\Domain\Model\FormElements\Section; -use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; +#[Autoconfigure(public: true)] class SuggestFormFactory extends AbstractFormFactory { - protected ConfigurationService $formConfigurationService; - - protected ConfigurationManagerInterface $configurationManager; - - protected TagRepository $tagRepository; - public function __construct( - ConfigurationManagerInterface $configurationManager, - ConfigurationService $formConfigurationService, - TagRepository $tagRepository - ) { - $this->configurationManager = $configurationManager; - $this->formConfigurationService = $formConfigurationService; - $this->tagRepository = $tagRepository; - } - - public function build(array $configuration, ?string $prototypeName = null, ?ServerRequestInterface $request = null): FormDefinition - { + protected ConfigurationManagerInterface $configurationManager, + protected ConfigurationService $formConfigurationService, + protected ValidatorResolver $validatorResolver, + protected TagRepository $tagRepository, + protected SuggestFormFinisher $suggestFormFinisher, + ) {} + + public function build( + array $configuration, + ?string $prototypeName = null, + ?ServerRequestInterface $request = null + ): FormDefinition { $prototypeName = 'standard'; $prototypeConfiguration = $this->formConfigurationService->getPrototypeConfiguration($prototypeName); @@ -78,7 +74,9 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv 'elementDescription', $this->getLocalizedLabel($settings['suggest']['fields']['fullname']['description']) ); - $fullnameField->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class)); + /** @var NotEmptyValidator $fullnameValidator */ + $fullnameValidator = $this->validatorResolver->createValidator(NotEmptyValidator::class); + $fullnameField->addValidator($fullnameValidator); /** @var GenericFormElement $emailField */ $emailField = $personalInformation->createElement('email', 'Text'); @@ -87,10 +85,14 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv 'elementDescription', $this->getLocalizedLabel($settings['suggest']['fields']['email']['description']) ); - $emailField->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class)); - $emailField->addValidator(GeneralUtility::makeInstance(EmailAddressValidator::class)); - - if (isset($settings['suggest']['fields']['twitter']['enable']) && (bool)$settings['suggest']['fields']['twitter']['enable'] === true) { + /** @var NotEmptyValidator $emailValidator */ + $emailValidator = $this->validatorResolver->createValidator(NotEmptyValidator::class); + $emailField->addValidator($emailValidator); + /** @var EmailAddressValidator $emailAddressValidator */ + $emailAddressValidator = $this->validatorResolver->createValidator(EmailAddressValidator::class); + $emailField->addValidator($emailAddressValidator); + + if ((bool)($settings['suggest']['fields']['twitter']['enable'] ?? false) === true) { /** @var GenericFormElement $twitterField */ $twitterField = $personalInformation->createElement('twitter', 'Text'); $twitterField->setLabel($this->getLocalizedLabel($settings['suggest']['fields']['twitter']['label'])); @@ -105,28 +107,30 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv $sessionInformation = $page->createElement('sessioninformation', 'Fieldset'); $sessionInformation->setLabel($this->getLocalizedLabel($settings['suggest']['form']['sessioninformation'])); - if (isset($settings['suggest']['fields']['requesttype']['enable']) && (bool)$settings['suggest']['fields']['requesttype']['enable'] === true) { - /** @var GenericFormElement $requesttypeField */ - $requesttypeField = $sessionInformation->createElement('requesttype', 'SingleSelect'); - $requesttypeField->setLabel($this->getLocalizedLabel($settings['suggest']['fields']['requesttype']['label'])); - $requesttypeField->setProperty( + if ((bool)($settings['suggest']['fields']['requesttype']['enable'] ?? false) === true) { + /** @var GenericFormElement $requestTypeField */ + $requestTypeField = $sessionInformation->createElement('requesttype', 'SingleSelect'); + $requestTypeField->setLabel($this->getLocalizedLabel($settings['suggest']['fields']['requesttype']['label'])); + $requestTypeField->setProperty( 'elementDescription', $this->getLocalizedLabel($settings['suggest']['fields']['requesttype']['description']) ); - $requesttypeField->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class)); - $requesttypeFieldOptions = SessionRequestTypeEnum::getOptions(); - foreach ($requesttypeFieldOptions as $requesttypeFieldOptionKey => $requesttypeFieldOptionValue) { - $requesttypeFieldOptions[$requesttypeFieldOptionKey] = LocalizationUtility::translate($requesttypeFieldOptionValue); + /** @var NotEmptyValidator $requestTypeValidator */ + $requestTypeValidator = $this->validatorResolver->createValidator(NotEmptyValidator::class); + $requestTypeField->addValidator($requestTypeValidator); + $requestTypeFieldOptions = SessionRequestTypeEnum::getOptions(); + foreach ($requestTypeFieldOptions as $requestTypeFieldOptionKey => $requestTypeFieldOptionValue) { + $requestTypeFieldOptions[$requestTypeFieldOptionKey] = LocalizationUtility::translate($requestTypeFieldOptionValue); } $prependOptionLabel = ' '; - if (isset($settings['suggest']['fields']['requesttype']['prependOptionLabel']) && $settings['suggest']['fields']['requesttype']['prependOptionLabel'] !== '') { + if (($settings['suggest']['fields']['requesttype']['prependOptionLabel'] ?? '') !== '') { $prependOptionLabel = $this->getLocalizedLabel($settings['suggest']['fields']['requesttype']['prependOptionLabel']); } - $requesttypeField->setProperty('prependOptionLabel', $prependOptionLabel); - $requesttypeField->setProperty('options', $requesttypeFieldOptions); + $requestTypeField->setProperty('prependOptionLabel', $prependOptionLabel); + $requestTypeField->setProperty('options', $requestTypeFieldOptions); } - if (isset($settings['suggest']['fields']['type']['enable']) && (bool)$settings['suggest']['fields']['type']['enable'] === true) { + if ((bool)($settings['suggest']['fields']['type']['enable'] ?? false) === true) { /** @var GenericFormElement $typeField */ $typeField = $sessionInformation->createElement('type', 'SingleSelect'); $typeField->setLabel($this->getLocalizedLabel($settings['suggest']['fields']['type']['label'])); @@ -134,20 +138,22 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv 'elementDescription', $this->getLocalizedLabel($settings['suggest']['fields']['type']['description']) ); - $typeField->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class)); + /** @var NotEmptyValidator $typeValidator */ + $typeValidator = $this->validatorResolver->createValidator(NotEmptyValidator::class); + $typeField->addValidator($typeValidator); $typeFieldOptions = SessionTypeEnum::getOptions(); foreach ($typeFieldOptions as $typeFieldOptionKey => $typeFieldOptionValue) { $typeFieldOptions[$typeFieldOptionKey] = LocalizationUtility::translate($typeFieldOptionValue); } $prependOptionLabel = ' '; - if (isset($settings['suggest']['fields']['type']['prependOptionLabel']) && $settings['suggest']['fields']['type']['prependOptionLabel'] !== '') { + if (($settings['suggest']['fields']['type']['prependOptionLabel'] ?? '') !== '') { $prependOptionLabel = $this->getLocalizedLabel($settings['suggest']['fields']['type']['prependOptionLabel']); } $typeField->setProperty('prependOptionLabel', $prependOptionLabel); $typeField->setProperty('options', $typeFieldOptions); } - if (isset($settings['suggest']['fields']['tag']['enable']) && (bool)$settings['suggest']['fields']['tag']['enable'] === true) { + if ((bool)($settings['suggest']['fields']['tag']['enable'] ?? false) === true) { $tags = $this->tagRepository->findBy(['suggestFormOption' => true]); if ($tags->current() !== false && $tags->current() !== null) { /** @var GenericFormElement $tagField */ @@ -157,13 +163,15 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv 'elementDescription', $this->getLocalizedLabel($settings['suggest']['fields']['tag']['description']) ); - $tagField->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class)); + /** @var NotEmptyValidator $tagValidator */ + $tagValidator = $this->validatorResolver->createValidator(NotEmptyValidator::class); + $tagField->addValidator($tagValidator); $tagFieldOptions = []; foreach ($tags as $tag) { $tagFieldOptions[(int)$tag->getUid()] = $tag->getLabel(); } $prependOptionLabel = ' '; - if (isset($settings['suggest']['fields']['tag']['prependOptionLabel']) && $settings['suggest']['fields']['tag']['prependOptionLabel'] !== '') { + if (($settings['suggest']['fields']['tag']['prependOptionLabel'] ?? '') !== '') { $prependOptionLabel = $this->getLocalizedLabel($settings['suggest']['fields']['tag']['prependOptionLabel']); } $tagField->setProperty('prependOptionLabel', $prependOptionLabel); @@ -178,7 +186,9 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv 'elementDescription', $this->getLocalizedLabel($settings['suggest']['fields']['title']['description']) ); - $titleField->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class)); + /** @var NotEmptyValidator $titleValidator */ + $titleValidator = $this->validatorResolver->createValidator(NotEmptyValidator::class); + $titleField->addValidator($titleValidator); /** @var GenericFormElement $descriptionField */ $descriptionField = $sessionInformation->createElement('description', 'Textarea'); @@ -187,17 +197,18 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv 'elementDescription', $this->getLocalizedLabel($settings['suggest']['fields']['description']['description']) ); - $descriptionField->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class)); - - if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() < 12) { - $stringLengthValidator = GeneralUtility::makeInstance(StringLengthValidator::class, ['minimum' => 5]); - } else { - $stringLengthValidator = GeneralUtility::makeInstance(StringLengthValidator::class); - $stringLengthValidator->setOptions(['minimum' => 5]); - } + /** @var NotEmptyValidator $descriptionValidator */ + $descriptionValidator = $this->validatorResolver->createValidator(NotEmptyValidator::class); + $descriptionField->addValidator($descriptionValidator); + + /** @var StringLengthValidator $stringLengthValidator */ + $stringLengthValidator = $this->validatorResolver->createValidator( + StringLengthValidator::class, + ['minimum' => 5] + ); $descriptionField->addValidator($stringLengthValidator); - if (isset($settings['suggest']['fields']['length']['enable']) && (bool)$settings['suggest']['fields']['length']['enable'] === true) { + if ((bool)($settings['suggest']['fields']['length']['enable'] ?? false) === true) { /** @var GenericFormElement $lengthField */ $lengthField = $sessionInformation->createElement('estimatedlength', 'SingleSelect'); $lengthField->setLabel($this->getLocalizedLabel($settings['suggest']['fields']['length']['label'])); @@ -211,7 +222,7 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv ]); } - if (isset($settings['suggest']['fields']['level']['enable']) && (bool)$settings['suggest']['fields']['level']['enable'] === true) { + if ((bool)($settings['suggest']['fields']['level']['enable'] ?? false) === true) { /** @var GenericFormElement $levelField */ $levelField = $sessionInformation->createElement('level', 'SingleSelect'); $levelField->setLabel($this->getLocalizedLabel($settings['suggest']['fields']['level']['label'])); @@ -219,20 +230,22 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv 'elementDescription', $this->getLocalizedLabel($settings['suggest']['fields']['level']['description']) ); - $levelField->addValidator(GeneralUtility::makeInstance(NotEmptyValidator::class)); + /** @var NotEmptyValidator $levelValidator */ + $levelValidator = $this->validatorResolver->createValidator(NotEmptyValidator::class); + $levelField->addValidator($levelValidator); $levelFieldOptions = SessionLevelEnum::getOptions(); foreach ($levelFieldOptions as $levelFieldOptionKey => $levelFieldOptionValue) { $levelFieldOptions[$levelFieldOptionKey] = LocalizationUtility::translate($levelFieldOptionValue); } $prependOptionLabel = ' '; - if (isset($settings['suggest']['fields']['level']['prependOptionLabel']) && $settings['suggest']['fields']['level']['prependOptionLabel'] !== '') { + if (($settings['suggest']['fields']['level']['prependOptionLabel'] ?? '') !== '') { $prependOptionLabel = $this->getLocalizedLabel($settings['suggest']['fields']['level']['prependOptionLabel']); } $levelField->setProperty('prependOptionLabel', $prependOptionLabel); $levelField->setProperty('options', $levelFieldOptions); } - if (isset($settings['suggest']['fields']['norecording']['enable']) && (bool)$settings['suggest']['fields']['norecording']['enable'] === true) { + if ((bool)($settings['suggest']['fields']['norecording']['enable'] ?? false) === true) { /** @var GenericFormElement $noRecordingField */ $noRecordingField = $sessionInformation->createElement('norecording', 'Checkbox'); $noRecordingField->setLabel($this->getLocalizedLabel($settings['suggest']['fields']['norecording']['label'])); @@ -255,33 +268,16 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv . ' ' . $this->getLocalizedLabel($settings['suggest']['form']['requiredFieldExplanation']) ); - /** @var SuggestFormFinisher $commentFinisher */ - $commentFinisher = GeneralUtility::makeInstance(SuggestFormFinisher::class); - $form->addFinisher($commentFinisher); + $form->addFinisher($this->suggestFormFinisher); - if ( - isset( - $settings['suggest']['notification']['enable'], - $settings['suggest']['notification']['subject'], - $settings['suggest']['notification']['recipientAddress'], - $settings['suggest']['notification']['recipientName'], - $settings['suggest']['notification']['senderAddress'], - $settings['suggest']['notification']['senderName'] - ) - && (bool)$settings['suggest']['notification']['enable'] === true - && $settings['suggest']['notification']['subject'] !== '' - && $settings['suggest']['notification']['recipientAddress'] !== '' - && $settings['suggest']['notification']['recipientName'] !== '' - && $settings['suggest']['notification']['senderAddress'] !== '' - && $settings['suggest']['notification']['senderName'] !== '' - ) { + if ($this->sendingNotificationAllowed($settings)) { $form->createFinisher('EmailToReceiver', [ - 'subject' => $settings['suggest']['notification']['subject'] ?? '', + 'subject' => $settings['suggest']['notification']['subject'], 'recipients' => [ $settings['suggest']['notification']['recipientAddress'] => $settings['suggest']['notification']['recipientName'], ], - 'senderAddress' => $settings['suggest']['notification']['senderAddress'] ?? '', - 'senderName' => $settings['suggest']['notification']['senderName'] ?? '', + 'senderAddress' => $settings['suggest']['notification']['senderAddress'], + 'senderName' => $settings['suggest']['notification']['senderName'], 'carbonCopyAddress' => $settings['suggest']['notification']['carbonCopyAddress'] ?? '', 'blindCarbonCopyAddress' => $settings['suggest']['notification']['blindCarbonCopyAddress'] ?? '', 'replyToRecipients' => [ @@ -291,7 +287,7 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv ]); } - if (isset($settings['suggest']['confirmation']['pageUid']) && $settings['suggest']['confirmation']['pageUid'] !== '') { + if (($settings['suggest']['confirmation']['pageUid'] ?? '') !== '') { $form->createFinisher('Redirect', [ 'pageUid' => (int)$settings['suggest']['confirmation']['pageUid'], ]); @@ -307,10 +303,22 @@ public function build(array $configuration, ?string $prototypeName = null, ?Serv return $form; } - // @phpstan-ignore return.deprecatedClass - protected function getTypoScriptFrontendController(): ?TypoScriptFrontendController + protected function sendingNotificationAllowed(array $settings): bool { - return $GLOBALS['TSFE']; + return isset( + $settings['suggest']['notification']['enable'], + $settings['suggest']['notification']['subject'], + $settings['suggest']['notification']['recipientAddress'], + $settings['suggest']['notification']['recipientName'], + $settings['suggest']['notification']['senderAddress'], + $settings['suggest']['notification']['senderName'] + ) + && (bool)$settings['suggest']['notification']['enable'] === true + && $settings['suggest']['notification']['subject'] !== '' + && $settings['suggest']['notification']['recipientAddress'] !== '' + && $settings['suggest']['notification']['recipientName'] !== '' + && $settings['suggest']['notification']['senderAddress'] !== '' + && $settings['suggest']['notification']['senderName'] !== ''; } protected function getLocalizedLabel(string $label): string diff --git a/Classes/Domain/Finisher/SuggestFormFinisher.php b/Classes/Domain/Finisher/SuggestFormFinisher.php index af1de2b..8182f44 100644 --- a/Classes/Domain/Finisher/SuggestFormFinisher.php +++ b/Classes/Domain/Finisher/SuggestFormFinisher.php @@ -16,59 +16,25 @@ use Evoweb\Sessionplaner\Domain\Repository\SessionRepository; use Evoweb\Sessionplaner\Domain\Repository\SpeakerRepository; use Evoweb\Sessionplaner\Domain\Repository\TagRepository; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; use TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface; use TYPO3\CMS\Form\Domain\Finishers\AbstractFinisher; +#[Autoconfigure(public: true)] class SuggestFormFinisher extends AbstractFinisher { - protected ?ConfigurationManagerInterface $configurationManager = null; - - protected ?SpeakerRepository $speakerRepository = null; - - protected ?SessionRepository $sessionRepository = null; - - protected ?TagRepository $tagRepository = null; - - protected ?PersistenceManagerInterface $persistenceManager = null; - - public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager): void - { - $this->configurationManager = $configurationManager; - } - - public function injectSpeakerRepository(SpeakerRepository $speakerRepository): void - { - $this->speakerRepository = $speakerRepository; - } - - public function injectSessionRepository(SessionRepository $sessionRepository): void - { - $this->sessionRepository = $sessionRepository; - } - - public function injectTagRepository(TagRepository $tagRepository): void - { - $this->tagRepository = $tagRepository; - } - - public function injectPersistenceManager(PersistenceManagerInterface $persistenceManager): void - { - $this->persistenceManager = $persistenceManager; - } + public function __construct( + protected readonly ConfigurationManagerInterface $configurationManager, + protected readonly SpeakerRepository $speakerRepository, + protected readonly SessionRepository $sessionRepository, + protected readonly TagRepository $tagRepository, + protected readonly PersistenceManagerInterface $persistenceManager, + ) {} protected function executeInternal() { - if ($this->configurationManager === null - || $this->speakerRepository === null - || $this->sessionRepository === null - || $this->tagRepository === null - || $this->persistenceManager === null - ) { - return null; - } - $settings = $this->configurationManager->getConfiguration( ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'sessionplaner' @@ -77,7 +43,7 @@ protected function executeInternal() $storagePid = 0; if (isset($settings['persistence']['storagePid'])) { $exploded = GeneralUtility::intExplode(',', (string)$settings['persistence']['storagePid']); - $storagePid = max(0, (int)($exploded[0] ?? 0)); + $storagePid = max(0, ($exploded[0] ?? 0)); } $data = $this->finisherContext->getFormValues(); @@ -86,7 +52,6 @@ protected function executeInternal() if ($speaker === null) { $speaker = new Speaker(); - $speaker->initializeObject(); $speaker->setPid($storagePid); $speaker->setName((string)($data['fullname'] ?? '')); $speaker->setEmail((string)($data['email'] ?? '')); @@ -96,7 +61,6 @@ protected function executeInternal() } $session = new Session(); - $session->initializeObject(); $session->setPid($storagePid); $session->setHidden(true); $session->setSuggestion(true); diff --git a/Classes/Domain/Model/Day.php b/Classes/Domain/Model/Day.php index 0c9a535..5aa9509 100644 --- a/Classes/Domain/Model/Day.php +++ b/Classes/Domain/Model/Day.php @@ -12,6 +12,7 @@ namespace Evoweb\Sessionplaner\Domain\Model; use Evoweb\Sessionplaner\Utility\ObjectStorageUtility; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -23,14 +24,14 @@ class Day extends AbstractEntity /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] public ObjectStorage $rooms; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] public ObjectStorage $slots; public function __construct() diff --git a/Classes/Domain/Model/Room.php b/Classes/Domain/Model/Room.php index 93e3735..b8279fe 100644 --- a/Classes/Domain/Model/Room.php +++ b/Classes/Domain/Model/Room.php @@ -12,6 +12,7 @@ namespace Evoweb\Sessionplaner\Domain\Model; use Evoweb\Sessionplaner\Utility\ObjectStorageUtility; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\Domain\Model\FileReference; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -28,20 +29,20 @@ class Room extends AbstractEntity /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $days; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $slots; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $sessions; public function __construct() diff --git a/Classes/Domain/Model/Session.php b/Classes/Domain/Model/Session.php index 6e2da84..badc9a0 100644 --- a/Classes/Domain/Model/Session.php +++ b/Classes/Domain/Model/Session.php @@ -12,6 +12,7 @@ namespace Evoweb\Sessionplaner\Domain\Model; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\Domain\Model\FileReference; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -60,26 +61,26 @@ class Session extends AbstractSlugEntity /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $speakers; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $documents; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $tags; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $links; public function __construct() @@ -346,7 +347,7 @@ public function toArray(): array $properties = $this->_getProperties(); foreach ($properties as $key => $value) { $field = GeneralUtility::camelCaseToLowerCaseUnderscored($key); - $value = \is_object($value) && \method_exists($value, 'getUid') ? $value->getUid() : $value; + $value = \is_object($value) && \method_exists($value, 'getUid') ? $value->getUid() : $value; $data[$field] = $value; } diff --git a/Classes/Domain/Model/Slot.php b/Classes/Domain/Model/Slot.php index f2627a5..46f6e66 100644 --- a/Classes/Domain/Model/Slot.php +++ b/Classes/Domain/Model/Slot.php @@ -11,6 +11,7 @@ namespace Evoweb\Sessionplaner\Domain\Model; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -24,21 +25,18 @@ class Slot extends AbstractEntity protected ?string $description = ''; - /** - * @var ?Day - */ - protected $day = null; + protected ?Day $day = null; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $rooms; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $sessions; public function __construct() diff --git a/Classes/Domain/Model/Speaker.php b/Classes/Domain/Model/Speaker.php index 87295ef..d640c01 100644 --- a/Classes/Domain/Model/Speaker.php +++ b/Classes/Domain/Model/Speaker.php @@ -11,6 +11,7 @@ namespace Evoweb\Sessionplaner\Domain\Model; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\Domain\Model\FileReference; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; @@ -33,8 +34,8 @@ class Speaker extends AbstractSlugEntity /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $sessions; public function __construct() diff --git a/Classes/Domain/Model/Tag.php b/Classes/Domain/Model/Tag.php index b453469..601147c 100644 --- a/Classes/Domain/Model/Tag.php +++ b/Classes/Domain/Model/Tag.php @@ -11,40 +11,26 @@ namespace Evoweb\Sessionplaner\Domain\Model; +use TYPO3\CMS\Extbase\Annotation as Extbase; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; class Tag extends AbstractEntity { - /** - * @var string - */ protected string $label = ''; - /** - * @var string - */ protected string $color = ''; - /** - * @var string - */ protected string $description = ''; - /** - * @var string - */ protected string $slug = ''; - /** - * @var bool - */ protected bool $suggestFormOption = false; /** * @var ObjectStorage - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy */ + #[Extbase\ORM\Lazy] protected ObjectStorage $sessions; public function __construct() diff --git a/Classes/Domain/Repository/DayRepository.php b/Classes/Domain/Repository/DayRepository.php index 434a9d7..09f093b 100644 --- a/Classes/Domain/Repository/DayRepository.php +++ b/Classes/Domain/Repository/DayRepository.php @@ -40,10 +40,7 @@ public function findByUidList(string $uidList): QueryResultInterface } $query = $this->createQuery(); - return $query->matching( - $query->logicalAnd( - $query->in('uid', $uids) - ) - )->execute(); + $query->matching($query->in('uid', $uids)); + return $query->execute(); } } diff --git a/Classes/Domain/Repository/SessionRepository.php b/Classes/Domain/Repository/SessionRepository.php index e1b2eb6..7bb8087 100644 --- a/Classes/Domain/Repository/SessionRepository.php +++ b/Classes/Domain/Repository/SessionRepository.php @@ -37,11 +37,7 @@ public function findAnyByUid(int $uid): ?Session $query->getQuerySettings()->setIncludeDeleted(true); $query->getQuerySettings()->setRespectStoragePage(false); $query->matching($query->equals('uid', $uid)); - - /** @var Session|null $result */ - $result = $query->execute()->getFirst(); - - return $result; + return $query->execute()->getFirst(); } /** @@ -50,11 +46,7 @@ public function findAnyByUid(int $uid): ?Session public function findSuggested(): QueryResultInterface { $query = $this->createQuery(); - $query->matching( - $query->logicalAnd( - $query->equals('suggestion', 1) - ) - ); + $query->matching($query->equals('suggestion', 1)); return $query->execute(); } @@ -80,11 +72,9 @@ public function findUnassignedSessions(): QueryResultInterface { $query = $this->createQuery(); $query->matching( - $query->logicalAnd( - $query->logicalOr( - $query->equals('slot', 0), - $query->equals('slot', null) - ) + $query->logicalOr( + $query->equals('slot', 0), + $query->equals('slot', null) ) ); return $query->execute(); @@ -100,12 +90,13 @@ public function findByDayAndHasSlotHasRoom(string $days): QueryResultInterface $days = [-1]; } $query = $this->createQuery(); - return $query->matching( + $query->matching( $query->logicalAnd( $query->in('day', $days), $query->logicalNot($query->equals('slot', 0)), $query->logicalNot($query->equals('room', 0)) ) - )->execute(); + ); + return $query->execute(); } } diff --git a/Classes/Domain/Repository/SpeakerRepository.php b/Classes/Domain/Repository/SpeakerRepository.php index 5f4a81f..16141c1 100644 --- a/Classes/Domain/Repository/SpeakerRepository.php +++ b/Classes/Domain/Repository/SpeakerRepository.php @@ -29,9 +29,7 @@ public function findByDetailPage(int $pageId): ?Speaker $query = $this->createQuery(); $query->getQuerySettings()->setRespectStoragePage(false); $query->matching($query->equals('detailPage', $pageId)); - /** @var Speaker $result */ - $result = $query->execute()->getFirst(); - return $result; + return $query->execute()->getFirst(); } public function findOneByEmailIncludeHidden(string $email): ?Speaker @@ -39,9 +37,6 @@ public function findOneByEmailIncludeHidden(string $email): ?Speaker $query = $this->createQuery(); $query->getQuerySettings()->setIgnoreEnableFields(true); $query->matching($query->equals('email', trim($email))); - - /** @var Speaker $speaker */ - $speaker = $query->execute()->getFirst(); - return $speaker; + return $query->execute()->getFirst(); } } diff --git a/Classes/Enum/SessionLevelEnum.php b/Classes/Enum/SessionLevelEnum.php index ba9ed9d..c8a2c3b 100644 --- a/Classes/Enum/SessionLevelEnum.php +++ b/Classes/Enum/SessionLevelEnum.php @@ -46,10 +46,18 @@ public static function getOptions(): array public static function getTcaOptions(): array { - $data = []; + $data = [ + [ + 'label' => 'LLL:EXT:sessionplaner/Resources/Private/Language/locallang.xlf:option.none', + 'value' => 0, + ] + ]; $options = self::getAvailableOptions(); foreach ($options as $option) { - $data[] = [self::getLabel($option), $option]; + $data[] = [ + 'label' => self::getLabel($option), + 'value' => $option, + ]; } return $data; diff --git a/Classes/Enum/SessionRequestTypeEnum.php b/Classes/Enum/SessionRequestTypeEnum.php index a8200f7..abaf376 100644 --- a/Classes/Enum/SessionRequestTypeEnum.php +++ b/Classes/Enum/SessionRequestTypeEnum.php @@ -43,10 +43,18 @@ public static function getOptions(): array public static function getTcaOptions(): array { - $data = []; + $data = [ + [ + 'label' => 'LLL:EXT:sessionplaner/Resources/Private/Language/locallang.xlf:option.none', + 'value' => 0, + ] + ]; $options = self::getAvailableOptions(); foreach ($options as $option) { - $data[] = [self::getLabel($option), $option]; + $data[] = [ + 'label' => self::getLabel($option), + 'value' => $option, + ]; } return $data; } diff --git a/Classes/Enum/SessionTypeEnum.php b/Classes/Enum/SessionTypeEnum.php index ee2efcb..44d88c6 100644 --- a/Classes/Enum/SessionTypeEnum.php +++ b/Classes/Enum/SessionTypeEnum.php @@ -49,10 +49,18 @@ public static function getOptions(): array public static function getTcaOptions(): array { - $data = []; + $data = [ + [ + 'label' => 'LLL:EXT:sessionplaner/Resources/Private/Language/locallang.xlf:option.none', + 'value' => 0, + ] + ]; $options = self::getAvailableOptions(); foreach ($options as $option) { - $data[] = [self::getLabel($option), $option]; + $data[] = [ + 'label' => self::getLabel($option), + 'value' => $option, + ]; } return $data; } diff --git a/Classes/TitleTagProvider/EventTitleTagProvider.php b/Classes/TitleTagProvider/SessionTitleTagProvider.php similarity index 87% rename from Classes/TitleTagProvider/EventTitleTagProvider.php rename to Classes/TitleTagProvider/SessionTitleTagProvider.php index 1a26c1b..1a52088 100644 --- a/Classes/TitleTagProvider/EventTitleTagProvider.php +++ b/Classes/TitleTagProvider/SessionTitleTagProvider.php @@ -13,7 +13,7 @@ use TYPO3\CMS\Core\PageTitle\AbstractPageTitleProvider; -class EventTitleTagProvider extends AbstractPageTitleProvider +class SessionTitleTagProvider extends AbstractPageTitleProvider { public function setTitle(string $title): void { diff --git a/Classes/Userfuncs/Tca.php b/Classes/Userfuncs/Tca.php index 92f7c92..0737080 100644 --- a/Classes/Userfuncs/Tca.php +++ b/Classes/Userfuncs/Tca.php @@ -16,9 +16,12 @@ class Tca { + /** + * @param array{table: string, row: array} $parameters + */ public function slotLabel(array &$parameters): void { - $record = BackendUtility::getRecord($parameters['table'], $parameters['row']['uid']); + $record = BackendUtility::getRecord($parameters['table'], $parameters['row']['uid'] ?? -1); if ($record === null) { return; } diff --git a/Classes/Utility/ObjectStorageUtility.php b/Classes/Utility/ObjectStorageUtility.php index 5619f31..fa0fae1 100644 --- a/Classes/Utility/ObjectStorageUtility.php +++ b/Classes/Utility/ObjectStorageUtility.php @@ -12,6 +12,7 @@ namespace Evoweb\Sessionplaner\Utility; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; /** @@ -38,7 +39,7 @@ public static function sort( $inventory = []; foreach ($objectStorage as $item) { - if (!method_exists($item, '_getProperty')) { + if (!method_exists($item, '_getProperty') || !property_exists($item, $property)) { continue; } diff --git a/Classes/Utility/TimeFormatUtility.php b/Classes/Utility/TimeFormatUtility.php index ebbe259..1f618b5 100644 --- a/Classes/Utility/TimeFormatUtility.php +++ b/Classes/Utility/TimeFormatUtility.php @@ -18,6 +18,8 @@ public static function getFormattedTime(int $value): string $hours = (string)floor($value / 3600); $minutes = (string)floor((int)($value / 60) % 60); - return str_pad($hours, 2, '0', STR_PAD_LEFT) . ':' . str_pad($minutes, 2, '0', STR_PAD_LEFT); + return str_pad($hours, 2, '0', STR_PAD_LEFT) + . ':' + . str_pad($minutes, 2, '0', STR_PAD_LEFT); } } diff --git a/Classes/ViewHelpers/GravatarViewHelper.php b/Classes/ViewHelpers/GravatarViewHelper.php index 02e7391..03f6dc8 100644 --- a/Classes/ViewHelpers/GravatarViewHelper.php +++ b/Classes/ViewHelpers/GravatarViewHelper.php @@ -24,20 +24,17 @@ public function initializeArguments(): void { parent::initializeArguments(); $this->registerArgument('email', 'string', 'Email address', true); - $this->registerArgument('size', 'int', '[ 1 - 2048 ]'); - $this->registerArgument('default', 'string', '[ 404 | mm | identicon | monsterid | wavatar ]'); - $this->registerArgument('rating', 'string', '[ g | pg | r | x ]'); + $this->registerArgument('size', 'int', '[ 1 - 2048 ]', false, 80); + $this->registerArgument('default', 'string', '[ 404 | mm | identicon | monsterid | wavatar ]', false, 'mm'); + $this->registerArgument('rating', 'string', '[ g | pg | r | x ]', false, 'g'); } public function render(): string { - $defaultSize = 80; - $defaultDefault = 'mm'; - $defaultRating = 'g'; $email = $this->arguments['email']; - $size = $this->arguments['size'] ?? $defaultSize; - $default = $this->arguments['default'] ?? $defaultDefault; - $rating = $this->arguments['rating'] ?? $defaultRating; + $size = $this->arguments['size']; + $default = $this->arguments['default']; + $rating = $this->arguments['rating']; $avatarUrl = 'https://www.gravatar.com/avatar/' . md5($email) . '?s=' . $size diff --git a/Classes/ViewHelpers/Link/Be/DayViewHelper.php b/Classes/ViewHelpers/Link/Be/DayViewHelper.php deleted file mode 100644 index a53b5c5..0000000 --- a/Classes/ViewHelpers/Link/Be/DayViewHelper.php +++ /dev/null @@ -1,67 +0,0 @@ -registerArgument('day', Day::class, 'The day to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.day needs a request implementing ServerRequestInterface.', - 1684305290 - ); - } - - /** @var Day $day */ - $day = $this->arguments['day']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_day' => [(int)$day->getUid() => 'edit']], - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $day->getName(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Classes/ViewHelpers/Link/Be/RoomViewHelper.php b/Classes/ViewHelpers/Link/Be/RoomViewHelper.php deleted file mode 100644 index 1afc5fd..0000000 --- a/Classes/ViewHelpers/Link/Be/RoomViewHelper.php +++ /dev/null @@ -1,67 +0,0 @@ -registerArgument('room', Room::class, 'The room to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.room needs a request implementing ServerRequestInterface.', - 1684305290 - ); - } - - /** @var Room $room */ - $room = $this->arguments['room']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_room' => [(int)$room->getUid() => 'edit']], - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $room->getName(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Classes/ViewHelpers/Link/Be/SessionViewHelper.php b/Classes/ViewHelpers/Link/Be/SessionViewHelper.php deleted file mode 100644 index 841a8c5..0000000 --- a/Classes/ViewHelpers/Link/Be/SessionViewHelper.php +++ /dev/null @@ -1,67 +0,0 @@ -registerArgument('session', Session::class, 'The session to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.session needs a request implementing ServerRequestInterface.', - 1684305290 - ); - } - - /** @var Session $session */ - $session = $this->arguments['session']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_session' => [(int)$session->getUid() => 'edit']], - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $session->getTopic(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Classes/ViewHelpers/Link/Be/SlotViewHelper.php b/Classes/ViewHelpers/Link/Be/SlotViewHelper.php deleted file mode 100644 index 14d2fd0..0000000 --- a/Classes/ViewHelpers/Link/Be/SlotViewHelper.php +++ /dev/null @@ -1,67 +0,0 @@ -registerArgument('slot', Slot::class, 'The slot to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.slot needs a request implementing ServerRequestInterface.', - 1684305290 - ); - } - - /** @var Slot $slot */ - $slot = $this->arguments['slot']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_slot' => [(int)$slot->getUid() => 'edit']], - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $slot->getUid(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php b/Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php deleted file mode 100644 index ecf5fc0..0000000 --- a/Classes/ViewHelpers/Link/Be/SpeakerViewHelper.php +++ /dev/null @@ -1,67 +0,0 @@ -registerArgument('speaker', Speaker::class, 'The speaker to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.speaker needs a request implementing ServerRequestInterface.', - 1684305290 - ); - } - - /** @var Speaker $speaker */ - $speaker = $this->arguments['speaker']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_speaker' => [(int)$speaker->getUid() => 'edit']], - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $speaker->getName(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Classes/ViewHelpers/Link/Be/TagViewHelper.php b/Classes/ViewHelpers/Link/Be/TagViewHelper.php deleted file mode 100644 index 5954a75..0000000 --- a/Classes/ViewHelpers/Link/Be/TagViewHelper.php +++ /dev/null @@ -1,67 +0,0 @@ -registerArgument('tag', Tag::class, 'The tag to link to', true); - $this->registerArgument('returnUri', 'bool', 'return only uri', false, false); - } - - public function render(): string - { - $request = $this->getRequest(); - if (!$request instanceof ServerRequestInterface) { - throw new \RuntimeException( - 'ViewHelper sessionplanervh:link.be.tag needs a request implementing ServerRequestInterface.', - 1735916444 - ); - } - - /** @var Tag $tag */ - $tag = $this->arguments['tag']; - $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); - - $params = [ - 'edit' => ['tx_sessionplaner_domain_model_tag' => [(int)$tag->getUid() => 'edit']], - 'returnUrl' => $request->getAttribute('normalizedParams')->getRequestUri(), - ]; - $uri = (string)$uriBuilder->buildUriFromRoute('record_edit', $params); - if (isset($this->arguments['returnUri']) && $this->arguments['returnUri'] === true) { - return htmlspecialchars($uri, ENT_QUOTES | ENT_HTML5); - } - - $linkText = $this->renderChildren() ?? $tag->getLabel(); - $this->tag->addAttribute('href', $uri); - $this->tag->setContent($linkText); - - return $this->tag->render(); - } - - protected function getRequest(): ?ServerRequestInterface - { - return $GLOBALS['TYPO3_REQUEST'] ?? null; - } -} diff --git a/Configuration/FlexForms/Edit.xml b/Configuration/FlexForms/Edit.xml deleted file mode 100644 index 720fe9d..0000000 --- a/Configuration/FlexForms/Edit.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 1 - - - - - LLL:EXT:sessionplaner/Resources/Private/Language/locallang_be.xlf:display_flexform.sheet_general - array - - - - - - select - selectSingle - - - LLL:EXT:sessionplaner/Resources/Private/Language/locallang_be.xlf:edit_flexform.switchableControllerAction.suggest - Edit->suggestForm;Edit->suggestSave - - - - - - - - - - diff --git a/Configuration/FlexForms/Sessionplan.xml b/Configuration/FlexForms/Sessionplan.xml index f67c2c1..159fb5f 100644 --- a/Configuration/FlexForms/Sessionplan.xml +++ b/Configuration/FlexForms/Sessionplan.xml @@ -45,6 +45,18 @@ + + + + group + db + pages + 1 + 0 + 1 + + + diff --git a/Configuration/Routes/Default.yaml b/Configuration/Routes/Default.yaml index 1567090..c964732 100644 --- a/Configuration/Routes/Default.yaml +++ b/Configuration/Routes/Default.yaml @@ -1,4 +1,4 @@ imports: - - { resource: "EXT:sessionplaner/Configuration/Routes/Speaker.yaml" } - - { resource: "EXT:sessionplaner/Configuration/Routes/Session.yaml" } - - { resource: "EXT:sessionplaner/Configuration/Routes/Tag.yaml" } + - { resource: "EXT:sessionplaner/Configuration/Routes/Speaker.yaml" } + - { resource: "EXT:sessionplaner/Configuration/Routes/Session.yaml" } + - { resource: "EXT:sessionplaner/Configuration/Routes/Tag.yaml" } diff --git a/Configuration/Routes/Session.yaml b/Configuration/Routes/Session.yaml index 05b17fa..1d3e690 100644 --- a/Configuration/Routes/Session.yaml +++ b/Configuration/Routes/Session.yaml @@ -1,15 +1,15 @@ routeEnhancers: - SessionplanerSession: - type: Extbase - extension: Sessionplaner - plugin: Session - defaultController: 'Session::list' - routes: - - { routePath: '/', _controller: 'Session::list' } - - { routePath: '/{session}', _controller: 'Session::show', _arguments: {'session': 'session'} } - aspects: - session: - type: PersistedPatternMapper - tableName: 'tx_sessionplaner_domain_model_session' - routeFieldPattern: '^(?P.+)-(?P\d+)$' - routeFieldResult: '{path_segment}-{uid}' + SessionplanerSession: + type: Extbase + extension: Sessionplaner + plugin: Session + defaultController: 'Session::list' + routes: + - { routePath: '/', _controller: 'Session::list' } + - { routePath: '/{session}', _controller: 'Session::show', _arguments: { 'session': 'session' } } + aspects: + session: + type: PersistedPatternMapper + tableName: 'tx_sessionplaner_domain_model_session' + routeFieldPattern: '^(?P.+)-(?P\d+)$' + routeFieldResult: '{path_segment}-{uid}' diff --git a/Configuration/Routes/Speaker.yaml b/Configuration/Routes/Speaker.yaml index 8fb6cc7..718e9c9 100644 --- a/Configuration/Routes/Speaker.yaml +++ b/Configuration/Routes/Speaker.yaml @@ -1,14 +1,14 @@ routeEnhancers: - SessionplanerSpeaker: - type: Extbase - extension: Sessionplaner - plugin: Speaker - defaultController: 'Speaker::list' - routes: - - { routePath: '/{speaker}', _controller: 'Speaker::show', _arguments: {'speaker': 'speaker'} } - aspects: - speaker: - type: PersistedPatternMapper - tableName: 'tx_sessionplaner_domain_model_speaker' - routeFieldPattern: '^(?P.+)-(?P\d+)$' - routeFieldResult: '{path_segment}-{uid}' + SessionplanerSpeaker: + type: Extbase + extension: Sessionplaner + plugin: Speaker + defaultController: 'Speaker::list' + routes: + - { routePath: '/{speaker}', _controller: 'Speaker::show', _arguments: { 'speaker': 'speaker' } } + aspects: + speaker: + type: PersistedPatternMapper + tableName: 'tx_sessionplaner_domain_model_speaker' + routeFieldPattern: '^(?P.+)-(?P\d+)$' + routeFieldResult: '{path_segment}-{uid}' diff --git a/Configuration/Routes/Tag.yaml b/Configuration/Routes/Tag.yaml index 0050031..e8d8db7 100644 --- a/Configuration/Routes/Tag.yaml +++ b/Configuration/Routes/Tag.yaml @@ -1,14 +1,14 @@ routeEnhancers: - SessionplanerTag: - type: Extbase - extension: Sessionplaner - plugin: Tag - defaultController: 'Tag::show' - routes: - - { routePath: '/{tag}', _controller: 'Tag::show', _arguments: {'tag': 'tag'} } - aspects: - tag: - type: PersistedPatternMapper - tableName: 'tx_sessionplaner_domain_model_tag' - routeFieldPattern: '^(?P.+)-(?P\d+)$' - routeFieldResult: '{path_segment}-{uid}' + SessionplanerTag: + type: Extbase + extension: Sessionplaner + plugin: Tag + defaultController: 'Tag::show' + routes: + - { routePath: '/{tag}', _controller: 'Tag::show', _arguments: { 'tag': 'tag' } } + aspects: + tag: + type: PersistedPatternMapper + tableName: 'tx_sessionplaner_domain_model_tag' + routeFieldPattern: '^(?P.+)-(?P\d+)$' + routeFieldResult: '{path_segment}-{uid}' diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index a3587ce..919d336 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -6,12 +6,3 @@ services: Evoweb\Sessionplaner\: resource: '../Classes/*' - - Evoweb\Sessionplaner\Controller\AjaxController: - public: true - - Evoweb\Sessionplaner\Domain\Factory\SuggestFormFactory: - public: true - - Evoweb\Sessionplaner\Domain\Finisher\SuggestFormFinisher: - public: true diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index b394579..5f4f5e8 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -1,5 +1,7 @@ [ 'type' => 'input', 'size' => 20, - 'eval' => 'trim,required', + 'eval' => 'trim', + 'required' => true, 'max' => 256, ], ], @@ -44,10 +45,9 @@ 'exclude' => false, 'label' => $languageFile . 'tx_sessionplaner_domain_model_day-date', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', + 'format' => 'date', 'size' => 20, - 'eval' => 'date', ], ], 'rooms' => [ @@ -82,10 +82,11 @@ 'types' => [ '0' => [ 'showitem' => ' - name, - date, - rooms, - slots + --div--;General, + name, + date, + rooms, + slots ', ], ], diff --git a/Configuration/TCA/tx_sessionplaner_domain_model_link.php b/Configuration/TCA/tx_sessionplaner_domain_model_link.php index 83fa4ad..fa7de46 100644 --- a/Configuration/TCA/tx_sessionplaner_domain_model_link.php +++ b/Configuration/TCA/tx_sessionplaner_domain_model_link.php @@ -35,21 +35,19 @@ 'config' => [ 'type' => 'input', 'max' => 255, - 'eval' => 'trim,required', + 'eval' => 'trim', + 'required' => true, ], ], 'link' => [ 'exclude' => false, 'label' => $languageFile . 'tx_sessionplaner_domain_model_link-link', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputLink', - 'eval' => 'required', + 'type' => 'link', + 'required' => true, ], ], ], - 'palettes' => [ - ], 'types' => [ '0' => [ 'showitem' => ' diff --git a/Configuration/TCA/tx_sessionplaner_domain_model_room.php b/Configuration/TCA/tx_sessionplaner_domain_model_room.php index bf46fb7..baaa34a 100644 --- a/Configuration/TCA/tx_sessionplaner_domain_model_room.php +++ b/Configuration/TCA/tx_sessionplaner_domain_model_room.php @@ -35,9 +35,9 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['', ''], - [$languageFile . 'tx_sessionplaner_domain_model_room-type-main', 'main'], - [$languageFile . 'tx_sessionplaner_domain_model_room-type-side', 'side'], + ['label' => '', 'value' => ''], + ['label' => $languageFile . 'tx_sessionplaner_domain_model_room-type-main', 'value' => 'main'], + ['label' => $languageFile . 'tx_sessionplaner_domain_model_room-type-side', 'value' => 'side'], ], ], ], @@ -47,7 +47,8 @@ 'config' => [ 'type' => 'input', 'size' => 20, - 'eval' => 'trim,required', + 'eval' => 'trim', + 'required' => true, 'max' => 256, ], ], @@ -65,9 +66,8 @@ 'exclude' => false, 'label' => $languageFile . 'tx_sessionplaner_domain_model_room-seats', 'config' => [ - 'type' => 'input', + 'type' => 'number', 'size' => 20, - 'eval' => 'int', 'max' => 256, ], ], @@ -117,12 +117,13 @@ 'types' => [ '0' => [ 'showitem' => ' - type, - name, - logo, - seats, - days, - slots, + --div--;General, + type, + name, + logo, + seats, + days, + slots, ', ], ], diff --git a/Configuration/TCA/tx_sessionplaner_domain_model_session.php b/Configuration/TCA/tx_sessionplaner_domain_model_session.php index 5dff7f3..132eaff 100644 --- a/Configuration/TCA/tx_sessionplaner_domain_model_session.php +++ b/Configuration/TCA/tx_sessionplaner_domain_model_session.php @@ -7,6 +7,10 @@ * LICENSE file that was distributed with this source code. */ +use Evoweb\Sessionplaner\Enum\SessionLevelEnum; +use Evoweb\Sessionplaner\Enum\SessionRequestTypeEnum; +use Evoweb\Sessionplaner\Enum\SessionTypeEnum; + $languageFile = 'LLL:EXT:sessionplaner/Resources/Private/Language/locallang_tca.xlf:'; return [ @@ -63,7 +67,8 @@ 'config' => [ 'type' => 'input', 'size' => 40, - 'eval' => 'trim,required', + 'eval' => 'trim', + 'required' => true, 'max' => 256, ], ], @@ -134,9 +139,8 @@ 'exclude' => false, 'label' => $languageFile . 'tx_sessionplaner_domain_model_session-attendees', 'config' => [ - 'type' => 'input', + 'type' => 'number', 'size' => 20, - 'eval' => 'int', 'max' => 256, ], ], @@ -168,7 +172,7 @@ 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', - 'items' => array_merge([['', 0]], \Evoweb\Sessionplaner\Enum\SessionTypeEnum::getTcaOptions()), + 'items' => SessionTypeEnum::getTcaOptions(), 'minitems' => 0, 'maxitems' => 1, ], @@ -179,7 +183,7 @@ 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', - 'items' => array_merge([['', 0]], \Evoweb\Sessionplaner\Enum\SessionLevelEnum::getTcaOptions()), + 'items' => SessionLevelEnum::getTcaOptions(), 'minitems' => 0, 'maxitems' => 1, 'default' => 0, @@ -194,8 +198,8 @@ 'renderType' => 'selectSingle', 'items' => [ [ - $languageFile . 'notassigned', - 0, + 'label' => $languageFile . 'notassigned', + 'value' => 0, ], ], 'foreign_table' => 'tx_sessionplaner_domain_model_day', @@ -214,8 +218,8 @@ 'renderType' => 'selectSingle', 'items' => [ [ - $languageFile . 'notassigned', - 0, + 'label' => $languageFile . 'notassigned', + 'value' => 0, ], ], 'foreign_table' => 'tx_sessionplaner_domain_model_room', @@ -233,8 +237,8 @@ 'renderType' => 'selectSingle', 'items' => [ [ - $languageFile . 'notassigned', - 0, + 'label' => $languageFile . 'notassigned', + 'value' => 0, ], ], 'foreign_table' => 'tx_sessionplaner_domain_model_slot', @@ -300,7 +304,7 @@ 'config' => [ 'type' => 'select', 'renderType' => 'selectSingle', - 'items' => array_merge([['', 0]], \Evoweb\Sessionplaner\Enum\SessionRequestTypeEnum::getTcaOptions()), + 'items' => SessionRequestTypeEnum::getTcaOptions(), 'minitems' => 0, 'maxitems' => 1, ], diff --git a/Configuration/TCA/tx_sessionplaner_domain_model_slot.php b/Configuration/TCA/tx_sessionplaner_domain_model_slot.php index eb133fe..1acb695 100644 --- a/Configuration/TCA/tx_sessionplaner_domain_model_slot.php +++ b/Configuration/TCA/tx_sessionplaner_domain_model_slot.php @@ -46,18 +46,18 @@ 'exclude' => false, 'label' => $languageFile . 'tx_sessionplaner_domain_model_slot-start', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', - 'eval' => 'time,required', + 'type' => 'datetime', + 'format' => 'time', + 'required' => true, ], ], 'duration' => [ 'exclude' => false, 'label' => $languageFile . 'tx_sessionplaner_domain_model_slot-duration', 'config' => [ - 'type' => 'input', + 'type' => 'number', 'size' => 20, - 'eval' => 'int,trim,required', + 'required' => true, 'default' => 45, 'max' => 256, ], @@ -102,12 +102,13 @@ 'types' => [ '0' => [ 'showitem' => ' - day, - start, - duration, - break, - description, - rooms, + --div--;General, + day, + start, + duration, + break, + description, + rooms, ', ], ], diff --git a/Configuration/TCA/tx_sessionplaner_domain_model_speaker.php b/Configuration/TCA/tx_sessionplaner_domain_model_speaker.php index 86feaf3..fc03dfc 100644 --- a/Configuration/TCA/tx_sessionplaner_domain_model_speaker.php +++ b/Configuration/TCA/tx_sessionplaner_domain_model_speaker.php @@ -41,7 +41,8 @@ 'config' => [ 'type' => 'input', 'size' => 20, - 'eval' => 'trim,required', + 'eval' => 'trim', + 'required' => true, 'max' => 256, ], ], @@ -160,12 +161,11 @@ 'label' => $languageFile . 'tx_sessionplaner_domain_model_speaker-detail_page', 'config' => [ 'type' => 'group', + 'allowed' => 'pages', 'size' => 1, 'default' => 0, 'minitems' => 0, 'maxitems' => 1, - 'internal_type' => 'db', - 'allowed' => 'pages', ], ], 'bio' => [ @@ -184,19 +184,20 @@ 'types' => [ '0' => [ 'showitem' => ' - hidden, - name, - path_segment, - company, - bio, - picture, - website, - twitter, - linkedin, - xing, - email, - detail_page, - sessions, + --div--;General, + hidden, + name, + path_segment, + company, + bio, + picture, + website, + twitter, + linkedin, + xing, + email, + detail_page, + sessions, ', ], ], diff --git a/Configuration/TCA/tx_sessionplaner_domain_model_tag.php b/Configuration/TCA/tx_sessionplaner_domain_model_tag.php index f67b1da..356dc99 100644 --- a/Configuration/TCA/tx_sessionplaner_domain_model_tag.php +++ b/Configuration/TCA/tx_sessionplaner_domain_model_tag.php @@ -34,7 +34,8 @@ 'config' => [ 'type' => 'input', 'size' => 20, - 'eval' => 'trim,required', + 'eval' => 'trim', + 'required' => true, 'max' => 256, ], ], @@ -45,27 +46,27 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['', ''], - ['TYPO3', 'typo3'], - ['RED', 'red'], - ['PINK', 'pink'], - ['PURPLE', 'purple'], - ['DEEP PURPLE', 'deeppurple'], - ['INDIGO', 'indigo'], - ['BLUE', 'blue'], - ['LIGHT BLUE', 'lightblue'], - ['CYAN', 'cyan'], - ['TEAL', 'teal'], - ['GREEN', 'green'], - ['LIGHT GREEN', 'lightgreen'], - ['LIME', 'lime'], - ['YELLOW', 'yellow'], - ['AMBER', 'amber'], - ['ORANGE', 'orange'], - ['DEEP ORANGE', 'deeporange'], - ['BROWN', 'brown'], - ['GREY', 'grey'], - ['BLUE GREY', 'bluegrey'], + ['label' => '', 'value' => ''], + ['label' => 'TYPO3', 'value' => 'typo3'], + ['label' => 'RED', 'value' => 'red'], + ['label' => 'PINK', 'value' => 'pink'], + ['label' => 'PURPLE', 'value' => 'purple'], + ['label' => 'DEEP PURPLE', 'value' => 'deeppurple'], + ['label' => 'INDIGO', 'value' => 'indigo'], + ['label' => 'BLUE', 'value' => 'blue'], + ['label' => 'LIGHT BLUE', 'value' => 'lightblue'], + ['label' => 'CYAN', 'value' => 'cyan'], + ['label' => 'TEAL', 'value' => 'teal'], + ['label' => 'GREEN', 'value' => 'green'], + ['label' => 'LIGHT GREEN', 'value' => 'lightgreen'], + ['label' => 'LIME', 'value' => 'lime'], + ['label' => 'YELLOW', 'value' => 'yellow'], + ['label' => 'AMBER', 'value' => 'amber'], + ['label' => 'ORANGE', 'value' => 'orange'], + ['label' => 'DEEP ORANGE', 'value' => 'deeporange'], + ['label' => 'BROWN', 'value' => 'brown'], + ['label' => 'GREY', 'value' => 'grey'], + ['label' => 'BLUE GREY', 'value' => 'bluegrey'], ], 'minitems' => 0, 'maxitems' => 1, @@ -131,12 +132,13 @@ 'types' => [ '0' => [ 'showitem' => ' - label, - path_segment, - color, - description, - suggest_form_option, - sessions + --div--;General, + label, + path_segment, + color, + description, + suggest_form_option, + sessions ', ], ], diff --git a/Makefile b/Makefile index 1cc4c4a..8bf9552 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,8 @@ _ARGS := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS)) # ...and turn them into do-nothing targets $(eval $(_ARGS):;@:) +PHP_VERSION := "8.1" + ##@ Docs .PHONY: docs @@ -22,6 +24,20 @@ test-docs: ##@ Test the documentation rendering mkdir -p Documentation-GENERATED-temp docker run --rm --pull always -v "$(shell pwd)":/project -t ghcr.io/typo3-documentation/render-guides:latest --config=Documentation --no-progress --minimal-test +##@ Tests + +.PHONY: phpstan +phpstan: ##@ Static code analysis with php-cs-fixer + echo "Checking with phpstan started" + Build/Scripts//runTests.sh -p ${PHP_VERSION} -s phpstan + echo "Checking with phpstan finished" + +.PHONY: cgl +cgl: ##@ Coding guideline check with + echo "Coding guideline check with phpstan started" + Build/Scripts//runTests.sh -p ${PHP_VERSION} -s cgl -n + echo "Coding guideline check with phpstan finished" + ##@ Release .PHONY: changelog @@ -56,13 +72,13 @@ switch-core: ##@ Require core version. Needs version number given as argument. [ .PHONY: composer-install composer-install: ##@ Install composer packages echo "Composer install started" - Build/Scripts/runTests.sh -s composer install + Build/Scripts/runTests.sh -p ${PHP_VERSION} -s composer install echo "Composer install finished" .PHONY: composer-update composer-update: ##@ Update composer packages echo "Composer update started" - Build/Scripts/runTests.sh -s composer update + Build/Scripts/runTests.sh -p ${PHP_VERSION} -s composer update echo "Composer update finished" .PHONY: npm-install diff --git a/README.md b/README.md index f9d29e8..fd8d273 100644 --- a/README.md +++ b/README.md @@ -19,3 +19,9 @@ Download and install the extension with the extension manager module or directly [TER](https://extensions.typo3.org/extension/sessionplaner/). See full documentation at https://extensions.typo3.org/extension/sessionplaner + +## Contribution guidelines + +- we use PER-CS-1 as coding standard. +- supported PHP versions are 8.1 to 8.4 +- the Makefile needs to be changed if a different PHP version should be used for development. Default is 8.1. diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 3477065..f163f33 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -141,6 +141,9 @@ Unknown Option + + None selected + Talk diff --git a/Resources/Private/Language/locallang_be.xlf b/Resources/Private/Language/locallang_be.xlf index c87c5b5..7ffaeab 100644 --- a/Resources/Private/Language/locallang_be.xlf +++ b/Resources/Private/Language/locallang_be.xlf @@ -6,6 +6,9 @@ Session Planer + + Session Planer + Sessionplan display diff --git a/Resources/Private/Layouts/Backend.html b/Resources/Private/Layouts/Backend.html index aa69b7c..5a3cb6c 100644 --- a/Resources/Private/Layouts/Backend.html +++ b/Resources/Private/Layouts/Backend.html @@ -1,2 +1,4 @@ + + diff --git a/Resources/Private/Layouts/Frontend.html b/Resources/Private/Layouts/Frontend.html index c9f2d36..a67c1c6 100644 --- a/Resources/Private/Layouts/Frontend.html +++ b/Resources/Private/Layouts/Frontend.html @@ -1,3 +1,5 @@ +
+ diff --git a/Resources/Private/Partials/BackendModule/Grid.html b/Resources/Private/Partials/BackendModule/Grid.html index 6ce125c..9c8b6bf 100644 --- a/Resources/Private/Partials/BackendModule/Grid.html +++ b/Resources/Private/Partials/BackendModule/Grid.html @@ -1,3 +1,7 @@ +
@@ -7,20 +11,20 @@ data-sessionplaner-room-uid="{room.uid}" data-sessionplaner-room-type="{room.type}" > - + {room.name} ({room.seats}) - +
- +

{slot.duration} -
+
@@ -61,3 +65,4 @@
+ diff --git a/Resources/Private/Partials/BackendModule/SessionCard.html b/Resources/Private/Partials/BackendModule/SessionCard.html index 5813f99..fc59cd6 100644 --- a/Resources/Private/Partials/BackendModule/SessionCard.html +++ b/Resources/Private/Partials/BackendModule/SessionCard.html @@ -1,3 +1,7 @@ +
- - {session.topic} - + {session.topic}
- {speaker.name} + {speaker.name} @@ -69,28 +71,30 @@
- {f:translate(id: 'type-talk')} - {f:translate(id: 'type-tutorial')} - {f:translate(id: 'type-workshop')} - {f:translate(id: 'type-discussion')} + + + + - {f:translate(id: 'level-starter')} - {f:translate(id: 'level-advanced')} - {f:translate(id: 'level-pro')} + + + - {tag.label} - +
+ diff --git a/Resources/Private/Partials/Disqus/Index.html b/Resources/Private/Partials/Disqus/Index.html index 4bf311e..0824cd4 100644 --- a/Resources/Private/Partials/Disqus/Index.html +++ b/Resources/Private/Partials/Disqus/Index.html @@ -1,3 +1,4 @@ +
@@ -9,7 +10,8 @@ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); - - comments powered by Disqus + + comments powered by Disqus
+ diff --git a/Resources/Private/Partials/FieldError.html b/Resources/Private/Partials/FieldError.html index a94bffb..05a4047 100644 --- a/Resources/Private/Partials/FieldError.html +++ b/Resources/Private/Partials/FieldError.html @@ -1,3 +1,4 @@ + @@ -5,11 +6,10 @@
- + {f:translate(id: 'field_{propertyError.code}') -> f:format.printf(arguments: {field: '{f:translate(id: \'{propertyPath}\')}'})} + - {f:translate(id: 'field_{propertyError.code}') -> f:format.printf(arguments: - {field: - '{f:translate(id: \'{propertyPath}\')}'})} + {translatedError} {propertyError.message} @@ -22,3 +22,4 @@ + diff --git a/Resources/Private/Partials/FormErrors.html b/Resources/Private/Partials/FormErrors.html index 93d7581..8beadb1 100644 --- a/Resources/Private/Partials/FormErrors.html +++ b/Resources/Private/Partials/FormErrors.html @@ -1,3 +1,4 @@ + @@ -5,9 +6,10 @@
- + {f:translate(id: 'field_{propertyError.code}') -> f:format.printf(arguments: {field: '{f:translate(id: \'{propertyPath}\')}'})} + - {f:translate(id: 'field_{propertyError.code}') -> f:format.printf(arguments:{field:'{f:translate(id: \'{propertyPath}\')}'})} + {translatedError} {propertyError.message} @@ -20,3 +22,4 @@ + diff --git a/Resources/Private/Partials/General/Sessions.html b/Resources/Private/Partials/General/Sessions.html index 2beaea8..51aa5e1 100644 --- a/Resources/Private/Partials/General/Sessions.html +++ b/Resources/Private/Partials/General/Sessions.html @@ -1,3 +1,4 @@ +
@@ -40,3 +41,4 @@

Session

+ diff --git a/Resources/Private/Partials/General/SocialIcons.html b/Resources/Private/Partials/General/SocialIcons.html index d6908a5..d1ac236 100644 --- a/Resources/Private/Partials/General/SocialIcons.html +++ b/Resources/Private/Partials/General/SocialIcons.html @@ -1,3 +1,4 @@ + @@ -10,3 +11,4 @@ + diff --git a/Resources/Private/Partials/Session/Box.html b/Resources/Private/Partials/Session/Box.html index 12eb68d..b1f9d63 100644 --- a/Resources/Private/Partials/Session/Box.html +++ b/Resources/Private/Partials/Session/Box.html @@ -1,3 +1,6 @@ +
@@ -24,19 +27,19 @@ - {f:translate(id: 'type-talk')} - {f:translate(id: 'type-tutorial')} - {f:translate(id: 'type-workshop')} - {f:translate(id: 'type-discussion')} + + + + - {f:translate(id: 'level-starter')} - {f:translate(id: 'level-advanced')} - {f:translate(id: 'level-pro')} + + + @@ -70,3 +73,4 @@
+ diff --git a/Resources/Private/Partials/Session/Info.html b/Resources/Private/Partials/Session/Info.html index 8e6c40b..a67f342 100644 --- a/Resources/Private/Partials/Session/Info.html +++ b/Resources/Private/Partials/Session/Info.html @@ -1,3 +1,4 @@ +
@@ -25,3 +26,4 @@
+ diff --git a/Resources/Private/Partials/Speaker/Card.html b/Resources/Private/Partials/Speaker/Card.html index 545de3c..93dfcaa 100644 --- a/Resources/Private/Partials/Speaker/Card.html +++ b/Resources/Private/Partials/Speaker/Card.html @@ -1,3 +1,4 @@ +
@@ -17,3 +18,4 @@

{speaker.company}

+ diff --git a/Resources/Private/Partials/Speaker/Connect.html b/Resources/Private/Partials/Speaker/Connect.html index 3ccf91b..7084320 100644 --- a/Resources/Private/Partials/Speaker/Connect.html +++ b/Resources/Private/Partials/Speaker/Connect.html @@ -1,3 +1,4 @@ +

Connect

@@ -25,3 +26,4 @@

Connect

+ diff --git a/Resources/Private/Partials/Speaker/Image.html b/Resources/Private/Partials/Speaker/Image.html index 0b582fd..efa4620 100644 --- a/Resources/Private/Partials/Speaker/Image.html +++ b/Resources/Private/Partials/Speaker/Image.html @@ -1,3 +1,6 @@ + @@ -16,3 +19,4 @@ + diff --git a/Resources/Private/Partials/Speaker/LinkWrap.html b/Resources/Private/Partials/Speaker/LinkWrap.html index 187e35c..27a8a51 100644 --- a/Resources/Private/Partials/Speaker/LinkWrap.html +++ b/Resources/Private/Partials/Speaker/LinkWrap.html @@ -1,3 +1,4 @@ + @@ -17,3 +18,4 @@
+ diff --git a/Resources/Private/Partials/Speaker/MiniCard.html b/Resources/Private/Partials/Speaker/MiniCard.html index fe459dd..1a8c5e6 100644 --- a/Resources/Private/Partials/Speaker/MiniCard.html +++ b/Resources/Private/Partials/Speaker/MiniCard.html @@ -1,3 +1,4 @@ +
@@ -14,3 +15,4 @@

+ diff --git a/Resources/Private/Templates/BackendModule/Show.html b/Resources/Private/Templates/BackendModule/Show.html index c824610..e4e1b74 100644 --- a/Resources/Private/Templates/BackendModule/Show.html +++ b/Resources/Private/Templates/BackendModule/Show.html @@ -1,3 +1,6 @@ + @@ -7,10 +10,10 @@

- + {currentDay.date -> f:format.date(format:'d.m.y')} - {currentDay.name} - +

+ diff --git a/Resources/Private/Templates/Session/List.html b/Resources/Private/Templates/Session/List.html index e3d54cb..3b3c160 100644 --- a/Resources/Private/Templates/Session/List.html +++ b/Resources/Private/Templates/Session/List.html @@ -1,3 +1,4 @@ + @@ -8,7 +9,7 @@

{settings.listViewHeadline}

{settings.listViewText} -

{f:translate(id: 'warning-nosessionsfound')}

+

@@ -52,3 +53,4 @@

+ diff --git a/Resources/Private/Templates/Session/Show.html b/Resources/Private/Templates/Session/Show.html index 1dd0ba8..fa714dc 100644 --- a/Resources/Private/Templates/Session/Show.html +++ b/Resources/Private/Templates/Session/Show.html @@ -1,3 +1,4 @@ + @@ -32,7 +33,7 @@

{session.topic}