diff --git a/Build/FunctionalTests.xml b/Build/FunctionalTests.xml index b735522..83cb69f 100644 --- a/Build/FunctionalTests.xml +++ b/Build/FunctionalTests.xml @@ -1,26 +1,13 @@ - - - - ../Tests/Functional/ - - - - - ../Classes/ - - + + + + ../Tests/Functional/ + + + + + ../Classes/ + + diff --git a/Build/UnitTests.xml b/Build/UnitTests.xml index 47bf26a..14b4f5b 100644 --- a/Build/UnitTests.xml +++ b/Build/UnitTests.xml @@ -1,27 +1,13 @@ - - - - ../Tests/Unit/ - - - - - ../Classes/ - - - \ No newline at end of file + + + + ../Tests/Unit/ + + + + + ../Classes/ + + + diff --git a/Classes/Command/GeocodeCommand.php b/Classes/Command/GeocodeCommand.php index 70ef22d..2c4ec49 100644 --- a/Classes/Command/GeocodeCommand.php +++ b/Classes/Command/GeocodeCommand.php @@ -9,6 +9,7 @@ * LICENSE file that was distributed with this source code. */ +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Input\InputInterface; @@ -17,17 +18,11 @@ use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility; +#[AsCommand('contacts:geocode', 'Geocode addresses of contact extension')] class GeocodeCommand extends Command { - /** - * @var string - */ - protected $tableName = 'tx_contacts_domain_model_address'; - - /** - * @var string - */ - protected $googleMapsApiKey = ''; + protected string $tableName = 'tx_contacts_domain_model_address'; + protected string $googleMapsApiKey = ''; protected function configure(): void { @@ -45,14 +40,14 @@ protected function initialize(InputInterface $input, OutputInterface $output): v $this->googleMapsApiKey = $contactsConfiguration['googleMapsApiKey']; } - protected function execute(InputInterface $input, OutputInterface $output): void + protected function execute(InputInterface $input, OutputInterface $output): int { $output->writeln(''); if (empty($this->googleMapsApiKey)) { $output->writeln('ApiKey is missing!'); $output->writeln(''); - return; + return Command::FAILURE; } $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) @@ -64,21 +59,21 @@ protected function execute(InputInterface $input, OutputInterface $output): void ->where( $queryBuilder->expr()->eq('deleted', 0) ) - ->execute() - ->fetchColumn(0); + ->executeQuery() + ->fetchOne(); $addresses = $queryBuilder ->select('uid', 'lat', 'lon', 'street', 'street_number', 'zip', 'city') ->from($this->tableName) ->where( - $queryBuilder->expr()->andX( + $queryBuilder->expr()->and( $queryBuilder->expr()->eq('deleted', 0), $queryBuilder->expr()->eq('lat', 0), $queryBuilder->expr()->eq('lon', 0) ) ) - ->execute() - ->fetchAll(); + ->executeQuery() + ->fetchAllAssociative(); $cntAddressesToProcess = count($addresses); $addressesProcessed = $addressCountAll - $cntAddressesToProcess; @@ -86,11 +81,10 @@ protected function execute(InputInterface $input, OutputInterface $output): void if ($cntAddressesToProcess === 0) { $output->writeln('Nothing to do here.'); $output->writeln(''); - return; + return Command::SUCCESS; } $progress = new ProgressBar($output, $addressCountAll); - $progress->start(); $progress->advance($addressesProcessed); @@ -116,7 +110,8 @@ protected function execute(InputInterface $input, OutputInterface $output): void ) ->set('lat', $lat) ->set('lon', $lng) - ->execute(); + ->executeStatement(); + $posResult++; } else { $negResult++; @@ -130,6 +125,8 @@ protected function execute(InputInterface $input, OutputInterface $output): void $output->writeln(''); $progress->finish(); + + return Command::SUCCESS; } protected function geocode(string $address): array diff --git a/Classes/Controller/ActionController.php b/Classes/Controller/ActionController.php index de7e132..cc71270 100644 --- a/Classes/Controller/ActionController.php +++ b/Classes/Controller/ActionController.php @@ -16,30 +16,19 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController { - /** - * @var CategoryRepository - */ - protected $categoryRepository; - /** - * @var \TYPO3\CMS\Core\Domain\Repository\PageRepository - */ - protected $pageRepository; - /** - * @param CategoryRepository $categoryRepository - */ - public function injectCategoryRepository(CategoryRepository $categoryRepository) + protected CategoryRepository $categoryRepository; + protected PageRepository $pageRepository; + + public function injectPageRepository(PageRepository $pageRepository): void { - $this->categoryRepository = $categoryRepository; + $this->pageRepository = $pageRepository; } - /** - * @param \TYPO3\CMS\Core\Domain\Repository\PageRepository $pageRepository - */ - public function injectPageRepository(PageRepository $pageRepository) + public function injectCategoryRepository(CategoryRepository $categoryRepository): void { - $this->pageRepository = $pageRepository; + $this->categoryRepository = $categoryRepository; } /** @@ -80,7 +69,7 @@ protected function createDemandObjectFromSettings(array $settings) : Demand /** * @param Demand $demand */ - protected function addCategoriesToDemandObjectFromSettings(&$demand) + protected function addCategoriesToDemandObjectFromSettings(&$demand): void { if ($this->settings['categoriesList']) { $selectedCategories = GeneralUtility::intExplode( diff --git a/Classes/Controller/AddressController.php b/Classes/Controller/AddressController.php index dab9f6c..4f28b61 100755 --- a/Classes/Controller/AddressController.php +++ b/Classes/Controller/AddressController.php @@ -15,32 +15,18 @@ use Extcode\Contacts\Domain\Repository\ZipRepository; use Extcode\Contacts\Hooks\AddressSearchAddressesLoadedHookInterface; use Extcode\Contacts\Utility\PageUtility; +use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; class AddressController extends ActionController { - /** - * @var AddressRepository - */ - protected $addressRepository; + public function __construct( + protected AddressRepository $addressRepository, + protected ZipRepository $zipRepository) + {} - /** - * @var ZipRepository - */ - protected $zipRepository; - - public function injectAddressRepository(AddressRepository $addressRepository): void - { - $this->addressRepository = $addressRepository; - } - - public function injectZipRepository(ZipRepository $zipRepository): void - { - $this->zipRepository = $zipRepository; - } - - public function searchAction(): void + public function searchAction(): ResponseInterface { $addressSearch = new AddressSearch(); if ($this->settings['orderBy']) { @@ -77,8 +63,8 @@ public function searchAction(): void $addressSearch->setPids( PageUtility::extendPidListByChildren( - $this->configurationManager->getContentObject()->data['pages'], - $this->configurationManager->getContentObject()->data['recursive'] + $this->request->getAttribute('currentContentObject')->data['pages'] ?? '', + $this->request->getAttribute('currentContentObject')->data['recursive'] ?? '' ) ); @@ -96,14 +82,16 @@ public function searchAction(): void } $this->view->assign('addresses', $addresses); + return $this->htmlResponse(); } - public function showAction(Address $address = null): void + public function showAction(Address $address = null): ResponseInterface { if (!$address) { $address = $this->addressRepository->findByUid($this->settings['address']); } $this->view->assign('address', $address); + return $this->htmlResponse(); } } diff --git a/Classes/Controller/Backend/CompanyController.php b/Classes/Controller/Backend/CompanyController.php index 1d41892..6bed252 100755 --- a/Classes/Controller/Backend/CompanyController.php +++ b/Classes/Controller/Backend/CompanyController.php @@ -1,5 +1,7 @@ companyRepository = $companyRepository; - } + public function __construct( + protected readonly CompanyRepository $companyRepository, + protected readonly ModuleTemplateFactory $moduleTemplateFactory, + protected readonly LanguageServiceFactory $languageServiceFactory, + protected readonly IconFactory $iconFactory, + ) + {} protected function initializeAction(): void { - $this->pageId = (int)GeneralUtility::_GP('id'); + $this->pageId = (int)($this->request->getParsedBody()['id'] ?? $this->request->getQueryParams()['id'] ?? 0); + $this->companyRepository->setDefaultOrderings(['name' => QueryInterface::ORDER_ASCENDING]); + $this->moduleTemplate = $this->moduleTemplateFactory->create($this->request); + $this->createButtons(); $frameworkConfiguration = $this->configurationManager->getConfiguration( ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK @@ -50,38 +62,59 @@ protected function initializeAction(): void $this->configurationManager->setConfiguration(array_merge($frameworkConfiguration, $persistenceConfiguration)); } - public function listAction(int $currentPage = 1): void + public function listAction(int $currentPage = 1): ResponseInterface { - $demand = $this->createDemandObject(); + $demand = $this->createDemandObject(); $companies = $this->companyRepository->findDemanded($demand); $itemsPerPage = $this->settings['itemsPerPage'] ?? 25; - $arrayPaginator = new QueryResultPaginator( - $companies, - $currentPage, - $itemsPerPage - ); - $pagination = new SimplePagination($arrayPaginator); - $this->view->assignMultiple( - [ - 'demand' => $demand, - 'companies' => $companies, - 'paginator' => $arrayPaginator, - 'pagination' => $pagination, - 'pages' => range(1, $pagination->getLastPageNumber()), - ] - ); + $paginator = new QueryResultPaginator($companies, $currentPage, $itemsPerPage); + $pagination = new SimplePagination($paginator); + + $this->moduleTemplate->assignMultiple([ + 'docHeader' => [ + 'enabled' => true + ], + 'demand' => $demand, + 'companies' => $companies, + 'paginator' => $paginator, + 'pagination' => $pagination, + 'pages' => range(1, $pagination->getLastPageNumber()), + ]); + + + return $this->moduleTemplate->renderResponse('Backend/Company/List'); } - /** - * @param Company $company - * - * @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("company") - */ - public function showAction(Company $company): void + public function createButtons(): void { - $this->view->assign('company', $company); + $pageTitle = BackendUtility::getRecordTitle('pages', BackendUtility::getRecord('pages', $this->pageId)); + $routeIdentifier = 'web_contacts'; // array-key of the module-configuration + $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar(); + + $shortcutButton = $buttonBar->makeShortcutButton() + ->setDisplayName($pageTitle) + ->setRouteIdentifier($routeIdentifier) + ->setArguments(['id' => $this->pageId]); + $buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT); + + $contactsListButton = $buttonBar + ->makeLinkButton() + ->setTitle(LocalizationUtility::translate('tx_contacts.module.contactController.listAction.menuItem', 'contacts')) + ->setShowLabelText(true) + ->setIcon($this->iconFactory->getIcon('actions-users',IconSize::SMALL)) + ->setHref($this->uriBuilder->uriFor('list', null, 'Backend\Contact')); + $buttonBar->addButton($contactsListButton); + } + + #[IgnoreValidation(['company'])] + public function showAction(Company $company): ResponseInterface + { + $moduleTemplate = $this->moduleTemplateFactory->create($this->request); + $moduleTemplate->assign('company', $company); + + return $moduleTemplate->renderResponse('Backend/Company/Show'); } protected function createDemandObject(): Demand diff --git a/Classes/Controller/Backend/ContactController.php b/Classes/Controller/Backend/ContactController.php index b0227e3..ca16c83 100755 --- a/Classes/Controller/Backend/ContactController.php +++ b/Classes/Controller/Backend/ContactController.php @@ -1,5 +1,7 @@ contactRepository = $contactRepository; - } + public function __construct( + protected readonly ContactRepository $contactRepository, + protected readonly ModuleTemplateFactory $moduleTemplateFactory, + protected readonly IconFactory $iconFactory, + ) + {} protected function initializeAction(): void { - $this->pageId = (int)GeneralUtility::_GP('id'); - - $frameworkConfiguration = $this->configurationManager->getConfiguration( - ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK - ); - $persistenceConfiguration = [ - 'persistence' => [ - 'storagePid' => $this->pageId, - ], - ]; - $this->configurationManager->setConfiguration(array_merge($frameworkConfiguration, $persistenceConfiguration)); + $this->pageId = (int)($this->request->getParsedBody()['id'] ?? $this->request->getQueryParams()['id'] ?? 0); + $this->contactRepository->setDefaultOrderings(['lastName' => QueryInterface::ORDER_ASCENDING]); + $this->moduleTemplate = $this->moduleTemplateFactory->create($this->request); + $this->createButtons(); } - public function listAction(int $currentPage = 1): void + public function listAction(int $currentPage = 1): ResponseInterface { - $demand = $this->createDemandObject(); + $demand = $this->createDemandObject(); $contacts = $this->contactRepository->findDemanded($demand); $itemsPerPage = $this->settings['itemsPerPage'] ?? 25; - $arrayPaginator = new QueryResultPaginator( - $contacts, - $currentPage, - $itemsPerPage - ); - $pagination = new SimplePagination($arrayPaginator); - $this->view->assignMultiple( - [ - 'demand' => $demand, - 'contacts' => $contacts, - 'paginator' => $arrayPaginator, - 'pagination' => $pagination, - 'pages' => range(1, $pagination->getLastPageNumber()), - ] - ); + $paginator = new QueryResultPaginator($contacts, $currentPage, $itemsPerPage); + $pagination = new SimplePagination($paginator); + + $this->moduleTemplate->assignMultiple([ + 'demand' => $demand, + 'contacts' => $contacts, + 'paginator' => $paginator, + 'pagination' => $pagination, + 'pages' => range(1, $pagination->getLastPageNumber()), + ]); + + return $this->moduleTemplate->renderResponse('Backend/Contact/List'); } - /** - * @param Contact $contact - * - * @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("contact") - */ - public function showAction(Contact $contact): void + public function createButtons() { - $this->view->assign('contact', $contact); + $pageTitle = BackendUtility::getRecordTitle('pages', BackendUtility::getRecord('pages', $this->pageId)); + $routeIdentifier = 'web_contacts'; // array-key of the module-configuration + $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar(); + + $shortcutButton = $buttonBar->makeShortcutButton() + ->setDisplayName($pageTitle) + ->setRouteIdentifier($routeIdentifier) + ->setArguments([ + 'id' => $this->pageId, + 'controller' => 'Backend\Contact', + 'action' => 'list', + ]); + $buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT); + + $companiesListButton = $buttonBar + ->makeLinkButton() + ->setTitle(LocalizationUtility::translate('tx_contacts.module.companyController.listAction.menuItem', 'contacts')) + ->setShowLabelText(true) + ->setIcon($this->iconFactory->getIcon('actions-building',IconSize::SMALL)) + ->setHref($this->uriBuilder->uriFor('list', null, 'Backend\Company')); + $buttonBar->addButton($companiesListButton); + } + + #[IgnoreValidation(['contact'])] + public function showAction(Contact $contact): ResponseInterface + { + $moduleTemplate = $this->moduleTemplateFactory->create($this->request); + $moduleTemplate->assign('contact', $contact); + + return $moduleTemplate->renderResponse('Backend/Contact/Show'); } protected function createDemandObject(): Demand diff --git a/Classes/Controller/CompanyController.php b/Classes/Controller/CompanyController.php index 80ed1d5..8730863 100755 --- a/Classes/Controller/CompanyController.php +++ b/Classes/Controller/CompanyController.php @@ -11,30 +11,22 @@ use Extcode\Contacts\Domain\Model\Company; use Extcode\Contacts\Domain\Repository\CompanyRepository; -use TYPO3\CMS\Core\Utility\GeneralUtility; +use Extcode\Contacts\Controller\ActionController as ContactsActionController; +use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; -class CompanyController extends ActionController +class CompanyController extends ContactsActionController { - /** - * @var CompanyRepository - */ - protected $companyRepository; - /** - * @var int - */ - protected $pageId; + protected int $pageId; - public function injectCompanyRepository(CompanyRepository $companyRepository): void - { - $this->companyRepository = $companyRepository; - } + public function __construct(protected CompanyRepository $companyRepository) + {} protected function initializeAction(): void { if ($GLOBALS['TSFE'] === null) { - $this->pageId = (int)GeneralUtility::_GP('id'); + $this->pageId = (int)($this->request->getParsedBody()['id'] ?? $this->request->getQueryParams()['id'] ?? null); } else { $this->pageId = $GLOBALS['TSFE']->id; } @@ -61,7 +53,7 @@ protected function initializeAction(): void } } - public function listAction(): void + public function listAction(): ResponseInterface { $demand = $this->createDemandObjectFromSettings($this->settings); $demand->setActionAndClass(__METHOD__, __CLASS__); @@ -71,9 +63,10 @@ public function listAction(): void $this->view->assign('demand', $demand); $this->view->assign('companies', $companies); $this->view->assign('categories', $this->getSelectedCategories($demand)); + return $this->htmlResponse(); } - public function showAction(Company $company = null): void + public function showAction(Company $company = null): ResponseInterface { if (!$company && (int)$this->settings['company']) { $company = $this->companyRepository->findByUid((int)$this->settings['company']); @@ -82,14 +75,16 @@ public function showAction(Company $company = null): void $this->view->assign('company', $company); $this->addCacheTags([$company]); + return $this->htmlResponse(); } - public function teaserAction(): void + public function teaserAction(): ResponseInterface { $companies = $this->companyRepository->findByUids($this->settings['companyUids']); $this->view->assign('companies', $companies); $this->addCacheTags($companies); + return $this->htmlResponse(); } protected function addCacheTags(array $companies): void diff --git a/Classes/Controller/ContactController.php b/Classes/Controller/ContactController.php index 55171a3..1762321 100755 --- a/Classes/Controller/ContactController.php +++ b/Classes/Controller/ContactController.php @@ -11,30 +11,26 @@ use Extcode\Contacts\Domain\Model\Contact; use Extcode\Contacts\Domain\Repository\ContactRepository; -use TYPO3\CMS\Core\Utility\GeneralUtility; +use Extcode\Contacts\Controller\ActionController as ContactsActionController; +use Psr\Http\Message\ResponseInterface; use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface; +use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; -class ContactController extends ActionController +class ContactController extends ContactsActionController { - /** - * @var ContactRepository - */ - protected $contactRepository; /** * @var int */ protected $pageId; - public function injectContactRepository(ContactRepository $contactRepository): void - { - $this->contactRepository = $contactRepository; - } + public function __construct(protected ContactRepository $contactRepository) + {} protected function initializeAction(): void { if ($GLOBALS['TSFE'] === null) { - $this->pageId = (int)GeneralUtility::_GP('id'); + $this->pageId = (int)($this->request->getParsedBody()['id'] ?? $this->request->getQueryParams()['id'] ?? null); } else { $this->pageId = $GLOBALS['TSFE']->id; } @@ -52,7 +48,7 @@ protected function initializeAction(): void if (!empty($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE'])) { static $cacheTagsSet = false; - /** @var $typoScriptFrontendController \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */ + /** @var $typoScriptFrontendController TypoScriptFrontendController */ $typoScriptFrontendController = $GLOBALS['TSFE']; if (!$cacheTagsSet) { $typoScriptFrontendController->addCacheTags(['tx_contacts']); @@ -61,7 +57,7 @@ protected function initializeAction(): void } } - public function listAction(): void + public function listAction(): ResponseInterface { $demand = $this->createDemandObjectFromSettings($this->settings); $demand->setActionAndClass(__METHOD__, __CLASS__); @@ -71,9 +67,10 @@ public function listAction(): void $this->view->assign('demand', $demand); $this->view->assign('contacts', $contacts); $this->view->assign('categories', $this->getSelectedCategories($demand)); + return $this->htmlResponse(); } - public function showAction(Contact $contact = null): void + public function showAction(Contact $contact = null): ResponseInterface { if (!$contact && (int)$this->settings['contact']) { $contact = $this->contactRepository->findByUid((int)$this->settings['contact']); @@ -82,14 +79,16 @@ public function showAction(Contact $contact = null): void $this->view->assign('contact', $contact); $this->addCacheTags([$contact]); + return $this->htmlResponse(); } - public function teaserAction(): void + public function teaserAction(): ResponseInterface { $contacts = $this->contactRepository->findByUids($this->settings['contactUids']); $this->view->assign('contacts', $contacts); $this->addCacheTags($contacts); + return $this->htmlResponse(); } protected function addCacheTags(array $contacts): void diff --git a/Classes/Domain/Model/AbstractContact.php b/Classes/Domain/Model/AbstractContact.php index bdb79de..e0c9f3a 100644 --- a/Classes/Domain/Model/AbstractContact.php +++ b/Classes/Domain/Model/AbstractContact.php @@ -3,8 +3,6 @@ namespace Extcode\Contacts\Domain\Model; -use TYPO3\CMS\Extbase\Domain\Model\Category; -use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; /* * This file is part of the package extcode/contacts. * @@ -12,81 +10,69 @@ * LICENSE file that was distributed with this source code. */ +use TYPO3\CMS\Extbase\Domain\Model\Category; +use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; +use TYPO3\CMS\Extbase\Annotation\ORM\Lazy; abstract class AbstractContact extends AbstractEntity { /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Extcode\Contacts\Domain\Model\Address> + * @var ObjectStorage
*/ - protected $addresses; + protected ObjectStorage $addresses; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Extcode\Contacts\Domain\Model\Phone> + * @var ObjectStorage */ - protected $phoneNumbers; + protected ObjectStorage $phoneNumbers; - /** - * @var string - */ - protected $email = ''; + protected string $email = ''; + protected string $uri = ''; + protected string $teaser = ''; + protected string $description = ''; + protected string $metaDescription = ''; /** - * @var string + * @var ObjectStorage */ - protected $uri = ''; + #[Lazy] + protected ObjectStorage $ttContent; - /** - * @var string - */ - protected $teaser = ''; + protected ?Category $category; /** - * @var string + * @var ObjectStorage */ - protected $description = ''; + protected ObjectStorage $categories; - /** - * @var string - */ - protected $metaDescription = ''; - - /** - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Extcode\Contacts\Domain\Model\TtContent> - */ - protected $ttContent; - - /** - * @var \TYPO3\CMS\Extbase\Domain\Model\Category - */ - protected $category; + public function __construct() + { + $this->initializeObject(); + } - /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> - */ - protected $categories; + public function initializeObject(): void + { + $this->addresses = new ObjectStorage(); + $this->phoneNumbers = new ObjectStorage(); + $this->ttContent = new ObjectStorage(); + $this->categories = new ObjectStorage(); + } - /** - * @param Address $address - */ - public function addAddress(Address $address) + public function addAddress(Address $address): void { - $this->addresses->attach($address); + $this->addresses?->attach($address); } - /** - * @param Address $address - */ - public function removeAddress(Address $address) + public function removeAddress(Address $address): void { - $this->addresses->detach($address); + $this->addresses?->detach($address); } /** * @return ObjectStorage
*/ - public function getAddresses() + public function getAddresses(): ObjectStorage { return $this->addresses; } @@ -94,31 +80,24 @@ public function getAddresses() /** * @param ObjectStorage
$addresses */ - public function setAddresses(ObjectStorage $addresses) + public function setAddresses(ObjectStorage $addresses): void { $this->addresses = $addresses; } - /** - * @param Phone $phoneNumber - */ - public function addPhoneNumber(Phone $phoneNumber) + public function addPhoneNumber(Phone $phoneNumber): void { - $this->phoneNumbers->attach($phoneNumber); + $this->phoneNumbers?->attach($phoneNumber); } - - /** - * @param Phone $phoneNumber - */ - public function removePhoneNumber(Phone $phoneNumber) + public function removePhoneNumber(Phone $phoneNumber): void { - $this->phoneNumbers->detach($phoneNumber); + $this->phoneNumbers?->detach($phoneNumber); } /** * @return ObjectStorage $phoneNumbers */ - public function getPhoneNumbers() + public function getPhoneNumbers(): ObjectStorage { return $this->phoneNumbers; } @@ -126,163 +105,108 @@ public function getPhoneNumbers() /** * @param ObjectStorage $phoneNumbers */ - public function setPhoneNumbers(ObjectStorage $phoneNumbers) + public function setPhoneNumbers(ObjectStorage $phoneNumbers): void { $this->phoneNumbers = $phoneNumbers; } - /** - * @return string - */ public function getEmail(): string { return $this->email; } - /** - * @param string $email - */ - public function setEmail(string $email) + public function setEmail(string $email): void { $this->email = $email; } - /** - * @return string - */ public function getUri(): string { return $this->uri; } - /** - * @param string $uri - */ - public function setUri(string $uri) + public function setUri(string $uri): void { $this->uri = $uri; } - /** - * @return string - */ public function getTeaser(): string { return $this->teaser; } - /** - * @param string $teaser - */ - public function setTeaser(string $teaser) + public function setTeaser(string $teaser): void { $this->teaser = $teaser; } - /** - * @return string - */ public function getDescription(): string { return $this->description; } - /** - * @param string $description - */ - public function setDescription(string $description) + public function setDescription(string $description): void { $this->description = $description; } - /** - * @return string - */ public function getMetaDescription(): string { return $this->metaDescription; } - /** - * @param string $metaDescription - */ - public function setMetaDescription(string $metaDescription) + public function setMetaDescription(string $metaDescription): void { $this->metaDescription = $metaDescription; } /** - * @return ObjectStorage + * @return ObjectStorage */ - public function getTtContent() + public function getTtContent(): ObjectStorage { return $this->ttContent; } /** - * @param ObjectStorage $ttContent + * @param ObjectStorage $ttContent */ - public function setTtContent(ObjectStorage $ttContent) + public function setTtContent(ObjectStorage $ttContent): void { $this->ttContent = $ttContent; } - /** - * Returns the Main Category - * - * @return \TYPO3\CMS\Extbase\Domain\Model\Category - */ - public function getCategory() + public function getCategory(): ?Category { - return $this->category; + return $this->category ?? null; } - /** - * Sets the Main Category - * - * @param \TYPO3\CMS\Extbase\Domain\Model\Category $category - */ - public function setCategory($category) + public function setCategory($category): void { $this->category = $category; } - /** - * Adds a Product Category - * - * @param \TYPO3\CMS\Extbase\Domain\Model\Category $category - */ - public function addCategory(Category $category) + public function addCategory(Category $category): void { - $this->categories->attach($category); + $this->categories?->attach($category); } - /** - * Removes a Category - * - * @param \TYPO3\CMS\Extbase\Domain\Model\Category $category - */ - public function removeCategory(Category $category) + public function removeCategory(Category $category): void { - $this->categories->detach($category); + $this->categories?->detach($category); } /** * Returns the Categories * - * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> $categories + * @return ObjectStorage $categories */ - public function getCategories() + public function getCategories(): ObjectStorage { return $this->categories; } - /** - * Returns the First Category - * - * @return \TYPO3\CMS\Extbase\Domain\Model\Category - */ - public function getFirstCategory() + public function getFirstCategory(): ?Category { $categories = $this->getCategories(); if ($categories !== null) { @@ -296,9 +220,9 @@ public function getFirstCategory() /** * Sets the Categories * - * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> $categories + * @param ObjectStorage $categories */ - public function setCategories(ObjectStorage $categories) + public function setCategories(ObjectStorage $categories): void { $this->categories = $categories; } diff --git a/Classes/Domain/Model/Address.php b/Classes/Domain/Model/Address.php index 7113a6f..dd631b1 100755 --- a/Classes/Domain/Model/Address.php +++ b/Classes/Domain/Model/Address.php @@ -11,112 +11,55 @@ */ use TYPO3\CMS\Extbase\Persistence\ObjectStorage; +use TYPO3\CMS\Extbase\Annotation\ORM\Lazy; class Address extends AbstractEntity { - /** - * @var string - */ - protected $title = ''; - - /** - * @var string - */ - protected $type = 'INTL,POSTAL,PARCEL,WORK'; - - /** - * @var string - */ - protected $street = ''; - - /** - * @var string - */ - protected $streetNumber = ''; - - /** - * @var string - */ - protected $addition1 = ''; - - /** - * @var string - */ - protected $addition2 = ''; - - /** - * @var string - */ - protected $zip = ''; - - /** - * @var string - */ - protected $city = ''; - - /** - * @var string - */ - protected $region = ''; + protected string $title = ''; + protected string $type = 'INTL,POSTAL,PARCEL,WORK'; + protected string $street = ''; + protected string $streetNumber = ''; + protected string $addition1 = ''; + protected string $addition2 = ''; + protected string $zip = ''; + protected string $city = ''; + protected string $region = ''; + protected ?Country $country; + protected string $postBox = ''; + protected string $lat = ''; + protected string $lon = ''; /** - * @var \Extcode\Contacts\Domain\Model\Country + * @var ObjectStorage */ - protected $country = ''; + #[Lazy] + protected ObjectStorage $ttContent; - /** - * @var string - */ - protected $postBox = ''; + protected ?Contact $contact; - /** - * @var string - */ - protected $lon = ''; - - /** - * @var string - */ - protected $lat = ''; + protected ?Company $company; - /** - * @TYPO3\CMS\Extbase\Annotation\ORM\Lazy - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Extcode\Contacts\Domain\Model\TtContent> - */ - protected $ttContent; - - /** - * @var \Extcode\Contacts\Domain\Model\Contact - */ - protected $contact = null; + public function __construct() + { + $this->initializeObject(); + } - /** - * @var \Extcode\Contacts\Domain\Model\Company - */ - protected $company = null; + public function initializeObject(): void + { + $this->ttContent = new ObjectStorage(); + } - /** - * @param string $title - */ - public function setTitle(string $title) + public function setTitle(string $title): void { $this->title = $title; } - /** - * @return string - */ - public function getTitle() + public function getTitle(): string { return $this->title; } - /** - * @param string $type - * - * @throws \InvalidArgumentException - */ - public function setType(string $type) + public function setType(string $type): void { $types = ['DOM', 'INTL', 'POSTAL', 'PARCEL', 'HOME', 'WORK']; @@ -130,234 +73,153 @@ public function setType(string $type) $this->type = $type; } - /** - * @return string - */ - public function getType() + public function getType(): string { return $this->type; } - /** - * @param string $street - */ - public function setStreet(string $street) + public function setStreet(string $street): void { $this->street = $street; } - /** - * @return string - */ - public function getStreet() + public function getStreet(): string { return $this->street; } - /** - * @param string $streetNumber - */ - public function setStreetNumber(string $streetNumber) + public function setStreetNumber(string $streetNumber): void { $this->streetNumber = $streetNumber; } - /** - * @return string - */ - public function getStreetNumber() + public function getStreetNumber(): string { return $this->streetNumber; } - /** - * @param string $addition1 - */ - public function setAddition1(string $addition1) + public function setAddition1(string $addition1): void { $this->addition1 = $addition1; } - /** - * @return string - */ - public function getAddition1() + public function getAddition1(): string { return $this->addition1; } - /** - * @param string $addition2 - */ - public function setAddition2(string $addition2) + public function setAddition2(string $addition2): void { $this->addition2 = $addition2; } - /** - * @return string - */ - public function getAddition2() + public function getAddition2(): string { return $this->addition2; } - /** - * @param string $zip - */ - public function setZip(string $zip) + public function setZip(string $zip): void { $this->zip = $zip; } - /** - * @return string - */ - public function getZip() + public function getZip(): string { return $this->zip; } - /** - * @param string $city - */ - public function setCity(string $city) + public function setCity(string $city): void { $this->city = $city; } - /** - * @return string - */ - public function getCity() + public function getCity(): string { return $this->city; } - /** - * @param string $region - */ - public function setRegion(string $region) + public function setRegion(string $region): void { $this->region = $region; } - /** - * @return string - */ - public function getRegion() + public function getRegion(): string { return $this->region; } - /** - * @param Country $country - */ - public function setCountry(Country $country) + public function setCountry(Country $country): void { $this->country = $country; } - /** - * @return Country - */ - public function getCountry() + public function getCountry(): ?Country { - return $this->country; + return $this->country ?? null; } - /** - * @param string $postBox - */ - public function setPostBox(string $postBox) + public function setPostBox(string $postBox): void { $this->postBox = $postBox; } - /** - * @return string - */ - public function getPostBox() + public function getPostBox(): string { return $this->postBox; } - /** - * @param string $lat - */ - public function setLat(string $lat) + public function setLat(string $lat): void { $this->lat = $lat; } - /** - * @return string - */ - public function getLat() + public function getLat(): string { return $this->lat; } - /** - * @param string $lon - */ - public function setLon(string $lon) + public function setLon(string $lon): void { $this->lon = $lon; } - /** - * @return string - */ - public function getLon() + public function getLon(): ?float { - return $this->lon; + return $this->lon ?? null; } - /** - * @param Contact $contact - */ - public function setContact(Contact $contact) + public function setContact(Contact $contact): void { $this->contact = $contact; } - /** - * @return Contact - */ - public function getContact() + public function getContact(): ?Contact { - return $this->contact; + return $this->contact ?? null; } - /** - * @return Company - */ - public function getCompany() + public function getCompany(): ?Company { - return $this->company; + return $this->company ?? null; } - /** - * @param Company $company - */ - public function setCompany($company) + public function setCompany($company): void { $this->company = $company; } /** - * @param ObjectStorage $ttContent + * @param ObjectStorage $ttContent */ - public function setTtContent(ObjectStorage $ttContent) + public function setTtContent(ObjectStorage $ttContent): void { $this->ttContent = $ttContent; } /** - * @return ObjectStorage + * @return ObjectStorage */ - public function getTtContent() + public function getTtContent(): ObjectStorage { return $this->ttContent; } diff --git a/Classes/Domain/Model/Company.php b/Classes/Domain/Model/Company.php index 0f2db3a..6375330 100755 --- a/Classes/Domain/Model/Company.php +++ b/Classes/Domain/Model/Company.php @@ -11,87 +11,55 @@ use TYPO3\CMS\Extbase\Domain\Model\FileReference; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; +use TYPO3\CMS\Extbase\Annotation\Validate; class Company extends AbstractContact { - /** - * @var string - * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") - */ - protected $name; - - /** - * @var string - */ - protected $legalName = ''; - - /** - * @var string - */ - protected $legalForm = ''; - - /** - * @var string - */ - protected $registeredOffice = ''; - - /** - * @var string - */ - protected $registerCourt = ''; - - /** - * @var string - */ - protected $registerNumber = ''; - - /** - * @var string - */ - protected $vatId = ''; + #[Validate(['validator' => 'NotEmpty'])] + protected string $name; + protected string $legalName = ''; + protected string $legalForm = ''; + protected string $registeredOffice = ''; + protected string $registerCourt = ''; + protected string $registerNumber = ''; + protected string $vatId = ''; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Extcode\Contacts\Domain\Model\Contact> + * @var ObjectStorage */ - protected $directors; + protected ObjectStorage $directors; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Extcode\Contacts\Domain\Model\Contact> + * @var ObjectStorage */ - protected $contacts; + protected ObjectStorage $contacts; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Extcode\Contacts\Domain\Model\Company> + * @var ObjectStorage */ - protected $companies; + protected ObjectStorage $companies; - /** - * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference - */ - protected $logo = null; + protected ?FileReference $logo; - /** - * @param string $name - */ public function __construct(string $name) { + parent::__construct(); $this->name = $name; } - /** - * @return string - */ - public function getName() + public function initializeObject(): void + { + $this->directors = new ObjectStorage(); + $this->contacts = new ObjectStorage(); + $this->companies = new ObjectStorage(); + } + + public function getName(): string { return $this->name; } - /** - * @param string $name - * - * @throws \InvalidArgumentException - */ - public function setName(string $name) + public function setName(string $name): void { if (strlen($name) == 0) { throw new \InvalidArgumentException( @@ -103,122 +71,80 @@ public function setName(string $name) $this->name = $name; } - /** - * @return string - */ - public function getLegalName() + public function getLegalName(): string { return $this->legalName; } - /** - * @param string $legalName - */ - public function setLegalName(string $legalName) + public function setLegalName(string $legalName): void { $this->legalName = $legalName; } - /** - * @return string - */ - public function getLegalForm() + public function getLegalForm(): string { return $this->legalForm; } - /** - * @param string $legalForm - */ - public function setLegalForm(string $legalForm) + public function setLegalForm(string $legalForm): void { $this->legalForm = $legalForm; } - /** - * @return string - */ - public function getRegisteredOffice() + public function getRegisteredOffice(): string { return $this->registeredOffice; } - /** - * @param string $registeredOffice - */ - public function setRegisteredOffice(string $registeredOffice) + public function setRegisteredOffice(string $registeredOffice): void { $this->registeredOffice = $registeredOffice; } - /** - * @return string - */ - public function getRegisterCourt() + public function getRegisterCourt(): string { return $this->registerCourt; } - /** - * @param string $registerCourt - */ - public function setRegisterCourt(string $registerCourt) + public function setRegisterCourt(string $registerCourt): void { $this->registerCourt = $registerCourt; } - /** - * @return string - */ - public function getRegisterNumber() + public function getRegisterNumber(): string { return $this->registerNumber; } - /** - * @param string $registerNumber - */ - public function setRegisterNumber(string $registerNumber) + public function setRegisterNumber(string $registerNumber): void { $this->registerNumber = $registerNumber; } - /** - * @return string - */ - public function getVatId() + public function getVatId(): string { return $this->vatId; } - /** - * @param string $vatId - */ - public function setVatId(string $vatId) + public function setVatId(string $vatId): void { $this->vatId = $vatId; } - /** - * @param Contact $director - */ - public function addDirector(Contact $director) + public function addDirector(Contact $director): void { - $this->directors->attach($director); + $this->directors?->attach($director); } - /** - * @param Contact $director - */ - public function removeDirector(Contact $director) + public function removeDirector(Contact $director): void { - $this->directors->detach($director); + $this->directors?->detach($director); } /** * @return ObjectStorage */ - public function getDirectors() + public function getDirectors(): ObjectStorage { return $this->directors; } @@ -226,31 +152,25 @@ public function getDirectors() /** * @param ObjectStorage $directors */ - public function setDirectors($directors) + public function setDirectors($directors): void { $this->directors = $directors; } - /** - * @param Contact $contact - */ - public function addContact(Contact $contact) + public function addContact(Contact $contact): void { - $this->contacts->attach($contact); + $this->contacts?->attach($contact); } - /** - * @param Contact $contact - */ - public function removeContact(Contact $contact) + public function removeContact(Contact $contact): void { - $this->contacts->detach($contact); + $this->contacts?->detach($contact); } /** * @return ObjectStorage $contacts */ - public function getContacts() + public function getContacts(): ObjectStorage { return $this->contacts; } @@ -258,31 +178,25 @@ public function getContacts() /** * @param ObjectStorage $contacts */ - public function setContacts(ObjectStorage $contacts) + public function setContacts(ObjectStorage $contacts): void { $this->contacts = $contacts; } - /** - * @param Company $company - */ - public function addCompany(self $company) + public function addCompany(self $company): void { - $this->companies->attach($company); + $this->companies?->attach($company); } - /** - * @param Company $company - */ - public function removeCompany(self $company) + public function removeCompany(self $company): void { - $this->companies->detach($company); + $this->companies?->detach($company); } /** * @return ObjectStorage $companies */ - public function getCompanies() + public function getCompanies(): ObjectStorage { return $this->companies; } @@ -290,23 +204,17 @@ public function getCompanies() /** * @param ObjectStorage $companies */ - public function setCompanies(ObjectStorage $companies) + public function setCompanies(ObjectStorage $companies): void { $this->companies = $companies; } - /** - * @return FileReference - */ - public function getLogo() + public function getLogo(): ?FileReference { - return $this->logo; + return $this->logo ?? null; } - /** - * @param FileReference $logo - */ - public function setLogo(FileReference $logo) + public function setLogo(FileReference $logo): void { $this->logo = $logo; } diff --git a/Classes/Domain/Model/Contact.php b/Classes/Domain/Model/Contact.php index a7117ca..a3b9c55 100755 --- a/Classes/Domain/Model/Contact.php +++ b/Classes/Domain/Model/Contact.php @@ -11,114 +11,70 @@ use TYPO3\CMS\Extbase\Domain\Model\FileReference; use TYPO3\CMS\Extbase\Persistence\ObjectStorage; +use TYPO3\CMS\Extbase\Annotation\Validate; class Contact extends AbstractContact { - /** - * @var string - */ - protected $salutation = ''; + protected string $salutation = ''; + protected string $title = ''; - /** - * @var string - */ - protected $title = ''; + #[Validate(['validator' => 'NotEmpty'])] + protected string $firstName; - /** - * @var string - * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") - */ - protected $firstName; + #[Validate(['validator' => 'NotEmpty'])] + protected string $lastName; - /** - * @var string - * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") - */ - protected $lastName; - - /** - * @var \DateTime - */ - protected $birthday; + protected \DateTime $birthday; /** - * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Extcode\Contacts\Domain\Model\Company> + * @var ObjectStorage */ - protected $companies; + protected ObjectStorage $companies; - /** - * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference - */ - protected $photo; + protected ?FileReference $photo; - /** - * @param string $salutation - * @param string $title - * @param string $firstName - * @param string $lastName - */ public function __construct( string $salutation, string $title, string $firstName, string $lastName ) { + parent::__construct(); $this->salutation = $salutation; $this->title = $title; $this->firstName = $firstName; $this->lastName = $lastName; - $this->initStorageObjects(); + $this->initializeObject(); } - /** - * Initializes all ObjectStorage properties. - */ - protected function initStorageObjects() + public function initializeObject(): void { + parent::initializeObject(); $this->companies = new ObjectStorage(); - $this->addresses = new ObjectStorage(); - $this->phoneNumbers = new ObjectStorage(); } - /** - * @param string $salutation - */ - public function setSalutation(string $salutation) + public function setSalutation(string $salutation): void { $this->salutation = $salutation; } - /** - * @return string - */ - public function getSalutation() + public function getSalutation(): string { return $this->salutation; } - /** - * @param string $title - */ - public function setTitle(string $title) + public function setTitle(string $title): void { $this->title = $title; } - /** - * @return string - */ - public function getTitle() + public function getTitle(): string { return $this->title; } - /** - * @param string $firstName - * - * @throws \InvalidArgumentException - */ - public function setFirstName(string $firstName) + public function setFirstName(string $firstName): void { if (strlen($firstName) == 0) { throw new \InvalidArgumentException( @@ -130,20 +86,12 @@ public function setFirstName(string $firstName) $this->firstName = $firstName; } - /** - * @return string - */ - public function getFirstName() + public function getFirstName(): string { return $this->firstName; } - /** - * @param string $lastName - * - * @throws \InvalidArgumentException - */ - public function setLastName(string $lastName) + public function setLastName(string $lastName): void { if (strlen($lastName) == 0) { throw new \InvalidArgumentException( @@ -155,28 +103,17 @@ public function setLastName(string $lastName) $this->lastName = $lastName; } - /** - * @return string - */ - public function getLastName() + public function getLastName(): string { return $this->lastName; } - /** - * @param string $seperator - * @return string - */ - public function getFullName(string $seperator = ' ') + public function getFullName(string $seperator = ' '): string { return implode($seperator, [$this->getFirstName(), $this->getLastName()]); } - /** - * @param string $seperator - * @return string - */ - public function getTitleFullName(string $seperator = ' ') + public function getTitleFullName(string $seperator = ' '): string { $titleFullName = []; if ($this->getTitle()) { @@ -187,18 +124,12 @@ public function getTitleFullName(string $seperator = ' ') return implode($seperator, $titleFullName); } - /** - * @param \DateTime $birthday - */ - public function setBirthday(\DateTime $birthday) + public function setBirthday(\DateTime $birthday): void { $this->birthday = $birthday; } - /** - * @return \DateTime|null - */ - public function getBirthday() + public function getBirthday(): ?\DateTime { if ($this->birthday) { return $this->birthday; @@ -207,26 +138,20 @@ public function getBirthday() return null; } - /** - * @param Company $company - */ - public function addCompany(Company $company) + public function addCompany(Company $company): void { - $this->companies->attach($company); + $this->companies?->attach($company); } - /** - * @param Company $company - */ - public function removeCompany(Company $company) + public function removeCompany(Company $company): void { - $this->companies->detach($company); + $this->companies?->detach($company); } /** * @return ObjectStorage $companies */ - public function getCompanies() + public function getCompanies(): ObjectStorage { return $this->companies; } @@ -234,23 +159,17 @@ public function getCompanies() /** * @param ObjectStorage $companies */ - public function setCompanies(ObjectStorage $companies) + public function setCompanies(ObjectStorage $companies): void { $this->companies = $companies; } - /** - * @return FileReference - */ - public function getPhoto() + public function getPhoto(): ?FileReference { - return $this->photo; + return $this->photo ?? null; } - /** - * @param FileReference $photo - */ - public function setPhoto(FileReference $photo) + public function setPhoto(FileReference $photo): void { $this->photo = $photo; } diff --git a/Classes/Domain/Model/Country.php b/Classes/Domain/Model/Country.php index 8a128e0..db1be2e 100755 --- a/Classes/Domain/Model/Country.php +++ b/Classes/Domain/Model/Country.php @@ -4,6 +4,7 @@ use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\Property\Exception; +use TYPO3\CMS\Extbase\Annotation\Validate; /* * This file is part of the package extcode/contacts. @@ -13,41 +14,21 @@ */ class Country extends AbstractEntity { - /** - * @var string - * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") - */ - protected $iso2 = ''; - - /** - * @var string - * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") - */ - protected $iso3 = ''; - - /** - * @var string - * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") - */ - protected $name = ''; - - /** - * @var string - */ - protected $tld = ''; - - /** - * @var string - * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") - */ - protected $phoneCountryCode = ''; - - /** - * @param string $iso2 - * - * @throws \TYPO3\CMS\Extbase\Property\Exception - */ - public function setIso2(string $iso2) + #[Validate(['validator' => 'NotEmpty'])] + protected string $iso2 = ''; + + #[Validate(['validator' => 'NotEmpty'])] + protected string $iso3 = ''; + + #[Validate(['validator' => 'NotEmpty'])] + protected string $name = ''; + + protected string $tld = ''; + + #[Validate(['validator' => 'NotEmpty'])] + protected string $phoneCountryCode = ''; + + public function setIso2(string $iso2): void { if (strlen($iso2) != 2) { throw new Exception( @@ -59,20 +40,12 @@ public function setIso2(string $iso2) $this->iso2 = $iso2; } - /** - * @return string - */ - public function getIso2() + public function getIso2(): string { return $this->iso2; } - /** - * @param string $iso3 - * - * @throws \TYPO3\CMS\Extbase\Property\Exception - */ - public function setIso3(string $iso3) + public function setIso3(string $iso3): void { if ((strlen($iso3) != 0) and (strlen($iso3) != 3)) { throw new Exception( @@ -84,58 +57,37 @@ public function setIso3(string $iso3) $this->iso3 = $iso3; } - /** - * @return string - */ - public function getIso3() + public function getIso3(): string { return $this->iso3; } - /** - * @param string $name - */ - public function setName(string $name) + public function setName(string $name): void { $this->name = $name; } - /** - * @return string - */ - public function getName() + public function getName(): string { return $this->name; } - /** - * @param string $tld - */ - public function setTld(string $tld) + public function setTld(string $tld): void { $this->tld = $tld; } - /** - * @return string - */ - public function getTld() + public function getTld(): string { return $this->tld; } - /** - * @param string $phoneCountryCode - */ - public function setPhoneCountryCode(string $phoneCountryCode) + public function setPhoneCountryCode(string $phoneCountryCode): void { $this->phoneCountryCode = $phoneCountryCode; } - /** - * @return string - */ - public function getPhoneCountryCode() + public function getPhoneCountryCode(): string { return $this->phoneCountryCode; } diff --git a/Classes/Domain/Model/Dto/AddressSearch.php b/Classes/Domain/Model/Dto/AddressSearch.php index 2e8f7b7..7582b8f 100644 --- a/Classes/Domain/Model/Dto/AddressSearch.php +++ b/Classes/Domain/Model/Dto/AddressSearch.php @@ -12,40 +12,13 @@ class AddressSearch { - /** - * @var float - */ - protected $lat = 0.0; - - /** - * @var float - */ - protected $lon = 0.0; - - /** - * @var int - */ - protected $radius = 0; - - /** - * @var string - */ - protected $pids = ''; - - /** - * @var string - */ - protected $searchString = ''; - - /** - * @var string - */ - protected $orderBy = ''; - - /** - * @var string - */ - protected $fallbackOrderBy = ''; + protected float $lat = 0.0; + protected float $lon = 0.0; + protected int $radius = 0; + protected string $pids = ''; + protected string $searchString = ''; + protected string $orderBy = ''; + protected string $fallbackOrderBy = ''; public function getLat(): float { diff --git a/Classes/Domain/Model/Dto/Demand.php b/Classes/Domain/Model/Dto/Demand.php index 772c014..37b7401 100644 --- a/Classes/Domain/Model/Dto/Demand.php +++ b/Classes/Domain/Model/Dto/Demand.php @@ -11,36 +11,12 @@ class Demand { - - /** - * @var string - */ - protected $searchString = ''; - - /** - * @var array - */ - protected $availableCategories = []; - - /** - * @var int - */ - protected $selectedCategory = 0; - - /** - * @var string - */ - protected $action = ''; - - /** - * @var string - */ - protected $class = ''; - - /** - * @var string - */ - protected $orderBy = ''; + protected string $searchString = ''; + protected array $availableCategories = []; + protected int $selectedCategory = 0; + protected string $action = ''; + protected string $class = ''; + protected string $orderBy = ''; public function getSearchString(): string { diff --git a/Classes/Domain/Model/Phone.php b/Classes/Domain/Model/Phone.php index 2fa2017..b126c1d 100755 --- a/Classes/Domain/Model/Phone.php +++ b/Classes/Domain/Model/Phone.php @@ -3,6 +3,7 @@ namespace Extcode\Contacts\Domain\Model; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; +use TYPO3\CMS\Extbase\Annotation\Validate; /* * This file is part of the package extcode/contacts. @@ -12,22 +13,12 @@ */ class Phone extends AbstractEntity { - /** - * @var string - */ - protected $type = 'VOICE'; + protected string $type = 'VOICE'; - /** - * @var string - * @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty") - */ - protected $number = ''; + #[Validate(['validator' => 'NotEmpty'])] + protected string $number = ''; - /** - * @param string $type - * @throws \InvalidArgumentException - */ - public function setType(string $type) + public function setType(string $type): void { $types = [ 'PREF', @@ -55,26 +46,17 @@ public function setType(string $type) $this->type = $type; } - /** - * @return string - */ - public function getType() + public function getType(): string { return $this->type; } - /** - * @param string $number - */ - public function setNumber(string $number) + public function setNumber(string $number): void { $this->number = $number; } - /** - * @return string - */ - public function getNumber() + public function getNumber(): string { return $this->number; } diff --git a/Classes/Domain/Model/TtContent.php b/Classes/Domain/Model/TtContent.php index 3dc206c..adc27ca 100644 --- a/Classes/Domain/Model/TtContent.php +++ b/Classes/Domain/Model/TtContent.php @@ -12,1413 +12,740 @@ */ class TtContent extends AbstractEntity { - /** - * @var \DateTime - */ - protected $crdate; - - /** - * @var \DateTime - */ - protected $tstamp; - - /** - * @var string - */ - protected $contentType; - - /** - * @var string - */ - protected $header; - - /** - * @var string - */ - protected $headerPosition; - - /** - * @var string - */ - protected $bodytext; - - /** - * @var int - */ - protected $colPos; - - /** - * @var string - */ - protected $image; - - /** - * @var int - */ - protected $imagewidth; - - /** - * @var int - */ - protected $imageheight; - - /** - * @var int - */ - protected $imageorient; - - /** - * @var string - */ - protected $imagecaption; - - /** - * @var int - */ - protected $imagecols; - - /** - * @var int - */ - protected $imageborder; - - /** - * @var string - */ - protected $media; - - /** - * @var string - */ - protected $layout; - - /** - * @var int - */ - protected $cols; - - /** - * @var string - */ - protected $subheader; - - /** - * @var string - */ - protected $headerLink; - - /** - * @var string - */ - protected $imageLink; - - /** - * @var string - */ - protected $imageZoom; - - /** - * @var string - */ - protected $altText; - - /** - * @var string - */ - protected $titleText; - - /** - * @var string - */ - protected $headerLayout; - - /** - * @var string - */ - protected $listType; - - /** - * @var string - */ - protected $records; - - /** - * @var string - */ - protected $pages; - - /** - * @var string - */ - protected $feGroup; - - /** - * @var string - */ - protected $imagecaptionPosition; - - /** - * @var string - */ - protected $longdescUrl; - - /** - * @var string - */ - protected $menuType; - - /** - * @var string - */ - protected $selectKey; - - /** - * @var string - */ - protected $fileCollections; - - /** - * @var string - */ - protected $filelinkSorting; - - /** - * @var string - */ - protected $target; - - /** - * @var string - */ - protected $multimedia; - - /** - * @var string - */ - protected $piFlexform; - - /** - * @var string - */ - protected $accessibilityTitle; - - /** - * @var string - */ - protected $accessibilityBypassText; - - /** - * @var string - */ - protected $selectedCategories; - - /** - * @var string - */ - protected $categoryField; - - /** - * @var int - */ - protected $spaceBefore; - - /** - * @var int - */ - protected $spaceAfter; - - /** - * @var int - */ - protected $imageNoRows; - - /** - * @var int - */ - protected $imageEffects; - - /** - * @var int - */ - protected $imageCompression; - - /** - * @var int - */ - protected $tableBorder; - - /** - * @var int - */ - protected $tableCellspacing; - - /** - * @var int - */ - protected $tableCellpadding; - - /** - * @var int - */ - protected $tableBgColor; - - /** - * @var int - */ - protected $sectionIndex; - - /** - * @var int - */ - protected $linkToTop; - - /** - * @var int - */ - protected $filelinkSize; - - /** - * @var int - */ - protected $sectionFrame; - - /** - * @var int - */ - protected $date; - - /** - * @var int - */ - protected $imageFrames; - - /** - * @var int - */ - protected $recursive; - - /** - * @var int - */ - protected $rteEnabled; - - /** - * @var int - */ - protected $txImpexpOriguid; - - /** - * @var int - */ - protected $accessibilityBypass; - - /** - * @var int - */ - protected $sysLanguageUid; - - /** - * @var int - */ - protected $starttime; - - /** - * @var int - */ - protected $endtime; - - /** - * @var string - */ - protected $txGridelementsBackendLayout; - - /** - * @var int - */ - protected $txGridelementsChildren; - - /** - * @var int - */ - protected $txGridelementsContainer; - - /** - * @var int - */ - protected $txGridelementsColumns; - - /** - * @return DateTime - */ - public function getCrdate() + protected \DateTime $crdate; + protected \DateTime $tstamp; + protected string $contentType; + protected string $header; + protected string $headerPosition; + protected string $bodytext; + protected int $colPos; + protected string $image; + protected int $imagewidth; + protected int $imageheight; + protected int $imageorient; + protected string $imagecaption; + protected int $imagecols; + protected int $imageborder; + protected string $media; + protected string $layout; + protected int $cols; + protected string $subheader; + protected string $headerLink; + protected string $imageLink; + protected string $imageZoom; + protected string $altText; + protected string $titleText; + protected string $headerLayout; + protected string $listType; + protected string $records; + protected string $pages; + protected string $feGroup; + protected string $imagecaptionPosition; + protected string $longdescUrl; + protected string $menuType; + protected string $selectKey; + protected string $fileCollections; + protected string $filelinkSorting; + protected string $target; + protected string $multimedia; + protected string $piFlexform; + protected string $accessibilityTitle; + protected string $accessibilityBypassText; + protected string $selectedCategories; + protected string $categoryField; + protected int $spaceBefore; + protected int $spaceAfter; + protected int $imageNoRows; + protected int $imageEffects; + protected int $imageCompression; + protected int $tableBorder; + protected int $tableCellspacing; + protected int $tableCellpadding; + protected int $tableBgColor; + protected int $sectionIndex; + protected int $linkToTop; + protected int $filelinkSize; + protected int $sectionFrame; + protected int $date; + protected int $imageFrames; + protected int $recursive; + protected int $rteEnabled; + protected int $txImpexpOriguid; + protected int $accessibilityBypass; + protected int $sysLanguageUid; + protected int $starttime; + protected int $endtime; + protected string $txGridelementsBackendLayout; + protected int $txGridelementsChildren; + protected int $txGridelementsContainer; + protected int $txGridelementsColumns; + + public function getCrdate(): \DateTime { return $this->crdate; } - /** - * @param $crdate - */ - public function setCrdate($crdate) + public function setCrdate(\DateTime $crdate): void { $this->crdate = $crdate; } - /** - * @return DateTime - */ - public function getTstamp() + public function getTstamp(): \DateTime { return $this->tstamp; } - /** - * @param $tstamp - */ - public function setTstamp($tstamp) + public function setTstamp(\DateTime $tstamp): void { $this->tstamp = $tstamp; } - /** - * @return string - */ - public function getContentType() + public function getContentType(): string { return $this->contentType; } - /** - * @param $contentType - */ - public function setContentType($contentType) + public function setContentType(string $contentType): void { $this->contentType = $contentType; } - /** - * @return string - */ - public function getHeader() + public function getHeader(): string { return $this->header; } - /** - * @param $header - */ - public function setHeader($header) + public function setHeader(string $header): void { $this->header = $header; } - /** - * @return string - */ - public function getHeaderPosition() + public function getHeaderPosition(): string { return $this->headerPosition; } - /** - * @param $headerPosition - */ - public function setHeaderPosition($headerPosition) + public function setHeaderPosition(string $headerPosition): void { $this->headerPosition = $headerPosition; } - /** - * @return string - */ - public function getBodytext() + public function getBodytext(): string { return $this->bodytext; } - /** - * @param $bodytext - */ - public function setBodytext($bodytext) + public function setBodytext(string $bodytext): void { $this->bodytext = $bodytext; } - /** - * Get the colpos - * - * @return int - */ - public function getColPos() + public function getColPos(): int { return (int)$this->colPos; } - /** - * Set colpos - * - * @param int $colPos - */ - public function setColPos($colPos) + public function setColPos(int $colPos): void { $this->colPos = $colPos; } - /** - * @return string - */ - public function getImage() + public function getImage(): string { return $this->image; } - /** - * @param $image - */ - public function setImage($image) + public function setImage(string $image): void { $this->image = $image; } - /** - * @return int - */ - public function getImagewidth() + public function getImagewidth(): int { return $this->imagewidth; } - /** - * @param $imagewidth - */ - public function setImagewidth($imagewidth) + public function setImagewidth(int $imagewidth): void { $this->imagewidth = $imagewidth; } - /** - * @return int - */ - public function getImageheight() + public function getImageheight(): int { return $this->imageheight; } - /** - * @param $imageheight - */ - public function setImageheight($imageheight) + public function setImageheight(int $imageheight): void { $this->imageheight = $imageheight; } - /** - * @return int - */ - public function getImageorient() + public function getImageorient(): int { return $this->imageorient; } - /** - * @param $imageorient - */ - public function setImageorient($imageorient) + public function setImageorient(int $imageorient): void { $this->imageorient = $imageorient; } - /** - * @return string - */ - public function getImagecaption() + public function getImagecaption(): string { return $this->imagecaption; } - /** - * @param $imagecaption - */ - public function setImagecaption($imagecaption) + public function setImagecaption(string $imagecaption): void { $this->imagecaption = $imagecaption; } - /** - * @return int - */ - public function getImagecols() + public function getImagecols(): int { return $this->imagecols; } - /** - * @param $imagecols - */ - public function setImagecols($imagecols) + public function setImagecols(int $imagecols): void { $this->imagecols = $imagecols; } - /** - * @return int - */ - public function getImageborder() + public function getImageborder(): int { return $this->imageborder; } - /** - * @param $imageborder - */ - public function setImageborder($imageborder) + public function setImageborder(int $imageborder): void { $this->imageborder = $imageborder; } - /** - * @return string - */ - public function getMedia() + public function getMedia(): string { return $this->media; } - /** - * @param $media - */ - public function setMedia($media) + public function setMedia(string $media): void { $this->media = $media; } - /** - * @return string - */ - public function getLayout() + public function getLayout(): string { return $this->layout; } - /** - * @param $layout - */ - public function setLayout($layout) + public function setLayout(string $layout): void { $this->layout = $layout; } - /** - * @return int - */ - public function getCols() + public function getCols(): int { return $this->cols; } - /** - * @param $cols - */ - public function setCols($cols) + public function setCols(int $cols): void { $this->cols = $cols; } - /** - * @return string - */ - public function getSubheader() + public function getSubheader(): string { return $this->subheader; } - /** - * @param $subheader - */ - public function setSubheader($subheader) + public function setSubheader(string $subheader): void { $this->subheader = $subheader; } - /** - * @return string - */ - public function getHeaderLink() + public function getHeaderLink(): string { return $this->headerLink; } - /** - * @param $headerLink - */ - public function setHeaderLink($headerLink) + public function setHeaderLink(string $headerLink): void { $this->headerLink = $headerLink; } - /** - * @return string - */ - public function getImageLink() + public function getImageLink(): string { return $this->imageLink; } - /** - * @param $imageLink - */ - public function setImageLink($imageLink) + public function setImageLink(string $imageLink): void { $this->imageLink = $imageLink; } - /** - * @return string - */ - public function getImageZoom() + public function getImageZoom(): string { return $this->imageZoom; } - /** - * @param $imageZoom - */ - public function setImageZoom($imageZoom) + public function setImageZoom(string $imageZoom): void { $this->imageZoom = $imageZoom; } - /** - * @return string - */ - public function getAltText() + public function getAltText(): string { return $this->altText; } - /** - * @param $altText - */ - public function setAltText($altText) + public function setAltText(string $altText): void { $this->altText = $altText; } - /** - * @return string - */ - public function getTitleText() + public function getTitleText(): string { return $this->titleText; } - /** - * @param $titleText - */ - public function setTitleText($titleText) + public function setTitleText(string $titleText): void { $this->titleText = $titleText; } - /** - * @return string - */ - public function getHeaderLayout() + public function getHeaderLayout(): string { return $this->headerLayout; } - /** - * @param $headerLayout - */ - public function setHeaderLayout($headerLayout) + public function setHeaderLayout(string $headerLayout): void { $this->headerLayout = $headerLayout; } - /** - * @return string - */ - public function getListType() + public function getListType(): string { return $this->listType; } - /** - * @param string $listType - */ - public function setListType($listType) + public function setListType(string $listType): void { $this->listType = $listType; } - /** - * @return string - */ - public function getRecords() + public function getRecords(): string { return $this->records; } - /** - * @param $records - */ - public function setRecords($records) + public function setRecords(string $records): void { $this->records = $records; } - /** - * @return string - */ - public function getPages() + public function getPages(): string { return $this->pages; } - /** - * @param $pages - */ - public function setPages($pages) + public function setPages(string $pages): void { $this->pages = $pages; } - /** - * @return string - */ - public function getFeGroup() + public function getFeGroup(): string { return $this->feGroup; } - /** - * @param $feGroup - */ - public function setFeGroup($feGroup) + public function setFeGroup(string $feGroup): void { $this->feGroup = $feGroup; } - /** - * @return string - */ - public function getImagecaptionPosition() + public function getImagecaptionPosition(): string { return $this->imagecaptionPosition; } - /** - * @param $imagecaptionPosition - */ - public function setImagecaptionPosition($imagecaptionPosition) + public function setImagecaptionPosition(string $imagecaptionPosition): void { $this->imagecaptionPosition = $imagecaptionPosition; } - /** - * @return string - */ - public function getLongdescUrl() + public function getLongdescUrl(): string { return $this->longdescUrl; } - /** - * @param $longdescUrl - */ - public function setLongdescUrl($longdescUrl) + public function setLongdescUrl(string $longdescUrl): void { $this->longdescUrl = $longdescUrl; } - /** - * @return string - */ - public function getMenuType() + public function getMenuType(): string { return $this->menuType; } - /** - * @param $menuType - */ - public function setMenuType($menuType) + public function setMenuType(string $menuType): void { $this->menuType = $menuType; } - /** - * @return string - */ - public function getSelectKey() + public function getSelectKey(): string { return $this->selectKey; } - /** - * @param $selectKey - */ - public function setSelectKey($selectKey) + public function setSelectKey(string $selectKey): void { $this->selectKey = $selectKey; } - /** - * @return string - */ - public function getFileCollections() + public function getFileCollections(): string { return $this->fileCollections; } - /** - * @param $fileCollections - */ - public function setFileCollections($fileCollections) + public function setFileCollections(string $fileCollections): void { $this->fileCollections = $fileCollections; } - /** - * @return string - */ - public function getFilelinkSorting() + public function getFilelinkSorting(): string { return $this->filelinkSorting; } - /** - * @param $filelinkSorting - */ - public function setFilelinkSorting($filelinkSorting) + public function setFilelinkSorting(string $filelinkSorting): void { $this->filelinkSorting = $filelinkSorting; } - /** - * @return string - */ - public function getTarget() + public function getTarget(): string { return $this->target; } - /** - * @param $target - */ - public function setTarget($target) + public function setTarget(string $target): void { $this->target = $target; } - /** - * @return string - */ - public function getMultimedia() + public function getMultimedia(): string { return $this->multimedia; } - /** - * @param $multimedia - */ - public function setMultimedia($multimedia) + public function setMultimedia(string $multimedia): void { $this->multimedia = $multimedia; } - /** - * @return string - */ - public function getPiFlexform() + public function getPiFlexform(): string { return $this->piFlexform; } - /** - * @param $piFlexform - */ - public function setPiFlexform($piFlexform) + public function setPiFlexform(string $piFlexform): void { $this->piFlexform = $piFlexform; } - /** - * @return string - */ - public function getAccessibilityTitle() + public function getAccessibilityTitle(): string { return $this->accessibilityTitle; } - /** - * @param $accessibilityTitle - */ - public function setAccessibilityTitle($accessibilityTitle) + public function setAccessibilityTitle(string $accessibilityTitle): void { $this->accessibilityTitle = $accessibilityTitle; } - /** - * @return string - */ - public function getAccessibilityBypassText() + public function getAccessibilityBypassText(): string { return $this->accessibilityBypassText; } - /** - * @param $accessibilityBypassText - */ - public function setAccessibilityBypassText($accessibilityBypassText) + public function setAccessibilityBypassText(string $accessibilityBypassText): void { $this->accessibilityBypassText = $accessibilityBypassText; } - /**string - * @return string - */ - public function getSelectedCategories() + public function getSelectedCategories(): string { return $this->selectedCategories; } - /** - * @param $selectedCategories - */ - public function setSelectedCategories($selectedCategories) + public function setSelectedCategories(string $selectedCategories): void { $this->selectedCategories = $selectedCategories; } - /** - * @return string - */ - public function getCategoryField() + public function getCategoryField(): string { return $this->categoryField; } - /** - * @param $categoryField - */ - public function setCategoryField($categoryField) + public function setCategoryField(string $categoryField): void { $this->categoryField = $categoryField; } - /** - * @return int - */ - public function getSpaceBefore() + public function getSpaceBefore(): int { return $this->spaceBefore; } - /** - * @param $spaceBefore - */ - public function setSpaceBefore($spaceBefore) + public function setSpaceBefore(int $spaceBefore): void { $this->spaceBefore = $spaceBefore; } - /** - * @return int - */ - public function getSpaceAfter() + public function getSpaceAfter(): int { return $this->spaceAfter; } - /** - * @param $spaceAfter - */ - public function setSpaceAfter($spaceAfter) + public function setSpaceAfter(int $spaceAfter): void { $this->spaceAfter = $spaceAfter; } - /** - * @return int - */ - public function getImageNoRows() + public function getImageNoRows(): int { return $this->imageNoRows; } - /** - * @param $imageNoRows - */ - public function setImageNoRows($imageNoRows) + public function setImageNoRows(int $imageNoRows): void { $this->imageNoRows = $imageNoRows; } - /** - * @return int - */ - public function getImageEffects() + public function getImageEffects(): int { return $this->imageEffects; } - /** - * @param $imageEffects - */ - public function setImageEffects($imageEffects) + public function setImageEffects(int $imageEffects): void { $this->imageEffects = $imageEffects; } - /** - * @return int - */ - public function getImageCompression() + public function getImageCompression(): int { return $this->imageCompression; } - /** - * @param $imageCompression - */ - public function setImageCompression($imageCompression) + public function setImageCompression(int $imageCompression): void { $this->imageCompression = $imageCompression; } - /** - * @return int - */ - public function getTableBorder() + public function getTableBorder(): int { return $this->tableBorder; } - /** - * @param $tableBorder - */ - public function setTableBorder($tableBorder) + public function setTableBorder(int $tableBorder): void { $this->tableBorder = $tableBorder; } - /** - * @return int - */ - public function getTableCellspacing() + public function getTableCellspacing(): int { return $this->tableCellspacing; } - /** - * @param $tableCellspacing - */ - public function setTableCellspacing($tableCellspacing) + public function setTableCellspacing(int $tableCellspacing): void { $this->tableCellspacing = $tableCellspacing; } - /** - * @return int - */ - public function getTableCellpadding() + public function getTableCellpadding(): int { return $this->tableCellpadding; } - /** - * @param $tableCellpadding - */ - public function setTableCellpadding($tableCellpadding) + public function setTableCellpadding(int $tableCellpadding): void { $this->tableCellpadding = $tableCellpadding; } - /** - * @return int - */ - public function getTableBgColor() + public function getTableBgColor(): int { return $this->tableBgColor; } - /** - * @param $tableBgColor - */ - public function setTableBgColor($tableBgColor) + public function setTableBgColor(int $tableBgColor): void { $this->tableBgColor = $tableBgColor; } - /** - * @return int - */ - public function getSectionIndex() + public function getSectionIndex(): int { return $this->sectionIndex; } - /** - * @param $sectionIndex - */ - public function setSectionIndex($sectionIndex) + public function setSectionIndex(int $sectionIndex): void { $this->sectionIndex = $sectionIndex; } - /** - * @return int - */ - public function getLinkToTop() + public function getLinkToTop(): int { return $this->linkToTop; } - /** - * @param $linkToTop - */ - public function setLinkToTop($linkToTop) + public function setLinkToTop(int $linkToTop): void { $this->linkToTop = $linkToTop; } - /** - * @return int - */ - public function getFilelinkSize() + public function getFilelinkSize(): int { return $this->filelinkSize; } - /** - * @param $filelinkSize - */ - public function setFilelinkSize($filelinkSize) + public function setFilelinkSize(int $filelinkSize): void { $this->filelinkSize = $filelinkSize; } - /** - * @return int - */ - public function getSectionFrame() + public function getSectionFrame(): int { return $this->sectionFrame; } - /** - * @param $sectionFrame - */ - public function setSectionFrame($sectionFrame) + public function setSectionFrame(int $sectionFrame): void { $this->sectionFrame = $sectionFrame; } - /** - * @return int - */ - public function getDate() + public function getDate(): int { return $this->date; } - /** - * @param $date - */ - public function setDate($date) + public function setDate(int $date): void { $this->date = $date; } - /** - * @return int - */ - public function getImageFrames() + public function getImageFrames(): int { return $this->imageFrames; } - /** - * @param $imageFrames - */ - public function setImageFrames($imageFrames) + public function setImageFrames(int $imageFrames): void { $this->imageFrames = $imageFrames; } - /** - * @return int - */ - public function getRecursive() + public function getRecursive(): int { return $this->recursive; } - /** - * @param $recursive - */ - public function setRecursive($recursive) + public function setRecursive(int $recursive): void { $this->recursive = $recursive; } - /** - * @return int - */ - public function getRteEnabled() + public function getRteEnabled(): int { return $this->rteEnabled; } - /** - * @param $rteEnabled - */ - public function setRteEnabled($rteEnabled) + public function setRteEnabled(int $rteEnabled): void { $this->rteEnabled = $rteEnabled; } - /** - * @return int - */ - public function getTxImpexpOriguid() + public function getTxImpexpOriguid(): int { return $this->txImpexpOriguid; } - /** - * @param $txImpexpOriguid - */ - public function setTxImpexpOriguid($txImpexpOriguid) + public function setTxImpexpOriguid(int $txImpexpOriguid): void { $this->txImpexpOriguid = $txImpexpOriguid; } - /** - * @return int - */ - public function getAccessibilityBypass() + public function getAccessibilityBypass(): int { return $this->accessibilityBypass; } - /** - * @param $accessibilityBypass - */ - public function setAccessibilityBypass($accessibilityBypass) + public function setAccessibilityBypass(int $accessibilityBypass): void { $this->accessibilityBypass = $accessibilityBypass; } - /** - * @return int - */ - public function getSysLanguageUid() + public function getSysLanguageUid(): int { return $this->sysLanguageUid; } - /** - * @param $sysLanguageUid - */ - public function setSysLanguageUid($sysLanguageUid) + public function setSysLanguageUid(int $sysLanguageUid): void { $this->sysLanguageUid = $sysLanguageUid; } - /** - * @return int - */ - public function getStarttime() + public function getStarttime(): int { return $this->starttime; } - /** - * @param $starttime - */ - public function setStarttime($starttime) + public function setStarttime(int $starttime): void { $this->starttime = $starttime; } - /** - * @return int - */ - public function getEndtime() + public function getEndtime(): int { return $this->endtime; } - /** - * @param $endtime - */ - public function setEndtime($endtime) + public function setEndtime(int $endtime): void { $this->endtime = $endtime; } - /** - * @return string - */ - public function getTxGridelementsBackendLayout() + public function getTxGridelementsBackendLayout(): string { return $this->txGridelementsBackendLayout; } - /** - * @param $txGridelementsBackendLayout - */ - public function setTxGridelementsBackendLayout($txGridelementsBackendLayout) + public function setTxGridelementsBackendLayout(string $txGridelementsBackendLayout): void { $this->txGridelementsBackendLayout = $txGridelementsBackendLayout; } - /** - * @return int - */ - public function getTxGridelementsChildren() + public function getTxGridelementsChildren(): int { return $this->txGridelementsChildren; } - /** - * @param $txGridelementsChildren - */ - public function setTxGridelementsChildren($txGridelementsChildren) + public function setTxGridelementsChildren(int $txGridelementsChildren): void { $this->txGridelementsChildren = $txGridelementsChildren; } - /** - * @return int - */ - public function getTxGridelementsContainer() + public function getTxGridelementsContainer(): int { return $this->txGridelementsContainer; } - /** - * @param $txGridelementsContainer - */ - public function setTxGridelementsContainer($txGridelementsContainer) + public function setTxGridelementsContainer(int $txGridelementsContainer): void { $this->txGridelementsContainer = $txGridelementsContainer; } - /** - * @return int - */ - public function getTxGridelementsColumns() + public function getTxGridelementsColumns(): int { return $this->txGridelementsColumns; } - /** - * @param $txGridelementsColumns - */ - public function setTxGridelementsColumns($txGridelementsColumns) + public function setTxGridelementsColumns(int $txGridelementsColumns): void { $this->txGridelementsColumns = $txGridelementsColumns; } diff --git a/Classes/Domain/Repository/AddressRepository.php b/Classes/Domain/Repository/AddressRepository.php index 733c1ca..a164e76 100755 --- a/Classes/Domain/Repository/AddressRepository.php +++ b/Classes/Domain/Repository/AddressRepository.php @@ -84,7 +84,7 @@ protected function getCompanyData(array $ids): array $queryBuilder->expr()->in('uid', $ids) ); - $queryResult = $queryBuilder->execute()->fetchAll(); + $queryResult = $queryBuilder->executeQuery()->fetchAllAssociative(); $uids = array_column($queryResult, 'uid'); $queryResult = array_combine($uids, $queryResult); @@ -125,7 +125,7 @@ protected function getContactData(array $ids): array $queryBuilder->expr()->in('uid', $ids) ); - $queryResult = $queryBuilder->execute()->fetchAll(); + $queryResult = $queryBuilder->executeQuery()->fetchAllAssociative(); $uids = array_column($queryResult, 'uid'); $queryResult = array_combine($uids, $queryResult); @@ -165,7 +165,8 @@ protected function getPhones(string $type, array $ids): array ->where( $queryBuilder->expr()->in($type, $ids) ) - ->execute()->fetchAll(); + ->executeQuery() + ->fetchAllAssociative(); $uids = array_column($queryResult, 'uid'); $queryResult = array_combine($uids, $queryResult); @@ -181,13 +182,14 @@ protected function getImages(string $tableName, string $fieldName, array $ids): ->select('uid', 'uid_foreign') ->from('sys_file_reference') ->where( - $queryBuilder->expr()->andX( + $queryBuilder->expr()->and( $queryBuilder->expr()->eq('tablenames', $queryBuilder->createNamedParameter($tableName)), $queryBuilder->expr()->eq('fieldname', $queryBuilder->createNamedParameter($fieldName)), $queryBuilder->expr()->in('uid_foreign', $ids) ) ) - ->execute()->fetchAll(); + ->executeQuery() + ->fetchAllAssociative(); $uids = array_column($queryResult, 'uid_foreign'); $queryResult = array_combine($uids, $queryResult); @@ -203,13 +205,14 @@ protected function getCategories(string $tableName, string $fieldName, array $id ->select('uid_local', 'uid_foreign') ->from('sys_category_record_mm') ->where( - $queryBuilder->expr()->andX( + $queryBuilder->expr()->and( $queryBuilder->expr()->eq('tablenames', $queryBuilder->createNamedParameter($tableName)), $queryBuilder->expr()->eq('fieldname', $queryBuilder->createNamedParameter($fieldName)), $queryBuilder->expr()->in('uid_foreign', $ids) ) ) - ->execute()->fetchAll(); + ->executeQuery() + ->fetchAllAssociative(); $uids = array_column($queryResult, 'uid_foreign'); $queryResult = array_combine($uids, $queryResult); @@ -225,7 +228,7 @@ protected function findAddressesByDistance(AddressSearch $addressSearch): array ->select('tx_contacts_domain_model_address.*') ->from('tx_contacts_domain_model_address') ->where( - $queryBuilder->expr()->andX( + $queryBuilder->expr()->and( $queryBuilder->expr()->neq('lat', 0.0), $queryBuilder->expr()->neq('lon', 0.0) ) @@ -254,7 +257,7 @@ protected function findAddressesByDistance(AddressSearch $addressSearch): array $queryBuilder->orderBy($addressSearch->getFallbackOrderBy()); } - $addresses = $queryBuilder->execute()->fetchAll(); + $addresses = $queryBuilder->executeQuery()->fetchAllAssociative(); if ($addressSearch->getLat() !== 0.0 && $addressSearch->getLon() !== 0.0 && $addressSearch->getRadius() !== 0) { $addressesInDistance = []; @@ -290,8 +293,8 @@ protected function findCountries(): array $queryResult = $queryBuilder ->select('uid', 'pid', 'iso2', 'iso3', 'name', 'tld', 'phone_country_code') ->from('tx_contacts_domain_model_country') - ->execute() - ->fetchAll(); + ->executeQuery() + ->fetchAllAssociative(); $uids = array_column($queryResult, 'uid'); $queryResult = array_combine($uids, $queryResult); diff --git a/Classes/Domain/Repository/CategoryRepository.php b/Classes/Domain/Repository/CategoryRepository.php index d4d7e76..9a02b8c 100644 --- a/Classes/Domain/Repository/CategoryRepository.php +++ b/Classes/Domain/Repository/CategoryRepository.php @@ -13,8 +13,9 @@ use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Domain\Model\Category; +use TYPO3\CMS\Extbase\Persistence\Repository; -class CategoryRepository extends \TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository +class CategoryRepository extends Repository { public function findAllAsRecursiveTreeArray(Category $selectedCategory = null): array { @@ -108,6 +109,6 @@ public function findFromDemand(Demand $demand): array $queryBuilder->expr()->in('uid', $demand->getAvailableCategories()) ); - return $queryBuilder->execute()->fetchAll(); + return $queryBuilder->executeQuery()->fetchAllAssociative(); } } diff --git a/Classes/Domain/Repository/CompanyRepository.php b/Classes/Domain/Repository/CompanyRepository.php index 1bd61a8..70ad3c3 100755 --- a/Classes/Domain/Repository/CompanyRepository.php +++ b/Classes/Domain/Repository/CompanyRepository.php @@ -17,12 +17,7 @@ class CompanyRepository extends Repository { - /** - * @param Demand $demand - * - * @return QueryResultInterface|array - */ - public function findDemanded(Demand $demand) + public function findDemanded(Demand $demand): QueryResultInterface|array { // settings $query = $this->createQuery(); @@ -38,23 +33,23 @@ public function findDemanded(Demand $demand) if ($demand->getSelectedCategory()) { $category = $demand->getSelectedCategory(); - $categoryConstraints[] = $query->contains('category', $category); - $categoryConstraints[] = $query->contains('categories', $category); + $categoryConstraints[] = $query->equals('category', $category); + $categoryConstraints[] = $query->equals('categories', $category); } else { foreach ($demand->getAvailableCategories() as $category) { - $categoryConstraints[] = $query->contains('category', $category); - $categoryConstraints[] = $query->contains('categories', $category); + $categoryConstraints[] = $query->equals('category', $category); + $categoryConstraints[] = $query->equals('categories', $category); } } - $constraints = $query->logicalOr($categoryConstraints); + $constraints[] = $query->logicalOr(...$categoryConstraints); } // create constraint if (!empty($constraints)) { $query->matching( $query->logicalAnd( - $query->logicalOr($constraints) + $query->logicalOr(...$constraints) ) ); } diff --git a/Classes/Domain/Repository/ContactRepository.php b/Classes/Domain/Repository/ContactRepository.php index 0aae6b1..a9dbc67 100755 --- a/Classes/Domain/Repository/ContactRepository.php +++ b/Classes/Domain/Repository/ContactRepository.php @@ -42,14 +42,14 @@ public function findDemanded(Demand $demand): QueryResultInterface } } - $constraints = $query->logicalOr($categoryConstraints); + $constraints = $query->logicalOr(...$categoryConstraints); } // create constraint if (!empty($constraints)) { $query->matching( $query->logicalAnd( - $query->logicalOr($constraints) + $query->logicalOr(...$constraints) ) ); } diff --git a/Classes/Domain/Repository/ZipRepository.php b/Classes/Domain/Repository/ZipRepository.php index f5133f1..cd4f8db 100644 --- a/Classes/Domain/Repository/ZipRepository.php +++ b/Classes/Domain/Repository/ZipRepository.php @@ -13,9 +13,6 @@ class ZipRepository { - /** - * @var array - */ protected $zipMap = []; protected function includeZipMap(string $zipMapFile): void diff --git a/Classes/Hooks/AddressSearchAddressesLoadedHookInterface.php b/Classes/Hooks/AddressSearchAddressesLoadedHookInterface.php index ffcc2e1..c38491f 100644 --- a/Classes/Hooks/AddressSearchAddressesLoadedHookInterface.php +++ b/Classes/Hooks/AddressSearchAddressesLoadedHookInterface.php @@ -12,11 +12,5 @@ interface AddressSearchAddressesLoadedHookInterface { - /** - * @param array $addresses - * @param array $addressSearchArgs - * - * @return array - */ public function enrichAddresses(array $addresses, array $addressSearchArgs): array; } diff --git a/Classes/Hooks/DataHandler.php b/Classes/Hooks/DataHandler.php index 5444665..de194be 100644 --- a/Classes/Hooks/DataHandler.php +++ b/Classes/Hooks/DataHandler.php @@ -14,17 +14,15 @@ class DataHandler { - /** - * Flushes the cache if a news record was edited. + * Flushes the cache if a contact or company record was edited. * This happens on two levels: by UID and by PID. - * - * @param array $params */ - public function clearCachePostProc(array $params) + public function clearCachePostProc(array $params): void { - if (($params['table'] !== 'tx_contacts_domain_model_contact') && - ($params['table'] !== 'tx_contacts_domain_model_company') + $table = $params['table'] ?? ''; + if (($table !== 'tx_contacts_domain_model_contact') && + ($table !== 'tx_contacts_domain_model_company') ) { return; } @@ -37,10 +35,6 @@ public function clearCachePostProc(array $params) } } - /** - * @param array $params - * @return array - */ protected function getCacheTagsToFlush(array $params): array { $cachePrefix = 'tx_contacts_'; diff --git a/Classes/Hooks/GoogleMapHook.php b/Classes/Hooks/GoogleMapHook.php index 0fdff1c..4214d30 100755 --- a/Classes/Hooks/GoogleMapHook.php +++ b/Classes/Hooks/GoogleMapHook.php @@ -14,70 +14,22 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\VersionNumberUtility; -use TYPO3\CMS\Extbase\Object\ObjectManager; class GoogleMapHook { - /** - * @var \TYPO3\CMS\Extbase\Object\ObjectManager - */ - protected $objectManager; - - /** - * @var CountryRepository - */ - protected $countryRepository; - - /** - * @var array - */ - protected $pluginSettings = []; - - /** - * @var string - */ - protected $idPrefix = ''; - - /** - * @var string - */ - protected $tableName = ''; - - /** - * @var string - */ - protected $addressId = ''; - - /** - * @var string - */ - protected $latFieldName = 'lat'; - - /** - * @var string - */ - protected $lonFieldName = 'lon'; - - /** - * @var float - */ - protected $latitude = 51.439310; - - /** - * @var float - */ - protected $longitude = 9.997579; - - /** - * @param array $params - */ - protected function init(array $params) + protected CountryRepository $countryRepository; + protected array $pluginSettings = []; + protected string $idPrefix = ''; + protected string $tableName = ''; + protected string $addressId = ''; + protected string $latFieldName = 'lat'; + protected string $lonFieldName = 'lon'; + protected float $latitude = 51.439310; + protected float $longitude = 9.997579; + + protected function init(array $params): void { - $this->objectManager = new ObjectManager(); - - $this->countryRepository = $this->objectManager->get( - CountryRepository::class - ); + $this->countryRepository = GeneralUtility::makeInstance(CountryRepository::class); $querySettings = $this->countryRepository->createQuery()->getQuerySettings(); $querySettings->setRespectStoragePage(false); @@ -93,16 +45,8 @@ protected function init(array $params) /** * Renders the Google map. - * - * @param array $params - * @param $fObj - * - * @return string - * - * @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException - * @throws \TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException */ - public function render(array $params, $fObj) + public function render(array $params, $fObj): string { $this->init($params); @@ -119,11 +63,6 @@ public function render(array $params, $fObj) return $out; } - /** - * @param array $params - * - * @return string - */ protected function concatenateFieldsToAddress(array $params): string { $address = []; @@ -152,14 +91,9 @@ protected function concatenateFieldsToAddress(array $params): string return $addressString; } - /** - * @param int $countryId - * - * @return string - */ protected function retrieveCountryCode(int $countryId): string { - $country = $this->countryRepository->findOneByUid($countryId); + $country = $this->countryRepository->findOneBy(['uid' => $countryId]); if ($country) { $countryCode = $country->getIso2(); @@ -170,11 +104,6 @@ protected function retrieveCountryCode(int $countryId): string return ''; } - /** - * @param string $googleMapsLibrary - * - * @return string - */ protected function getJavaScript(string $googleMapsLibrary): string { $version = VersionNumberUtility::convertVersionNumberToInteger(GeneralUtility::makeInstance(Typo3Version::class)->getVersion()); @@ -197,11 +126,6 @@ protected function getJavaScript(string $googleMapsLibrary): string return $out; } - /** - * @param array $params - * - * @return string - */ protected function getInputFields(array $params): string { $address = $this->concatenateFieldsToAddress($params); @@ -220,10 +144,7 @@ protected function getInputFields(array $params): string return $out; } - /** - * @param array $params - */ - protected function setLatLon(array $params) + protected function setLatLon(array $params): void { $latitude = (float)$params['row'][$this->latFieldName]; $longitude = (float)$params['row'][$this->lonFieldName]; @@ -234,10 +155,7 @@ protected function setLatLon(array $params) } } - /** - * @param array $params - */ - protected function setLatLonFieldNames(array $params) + protected function setLatLonFieldNames(array $params): void { $dataPrefix = 'data[' . $this->tableName . '][' . $params['row']['uid'] . ']'; if ($params['parameters']['latitude']) { diff --git a/Classes/Updates/SlugUpdater.php b/Classes/Updates/SlugUpdater.php deleted file mode 100644 index 13a9952..0000000 --- a/Classes/Updates/SlugUpdater.php +++ /dev/null @@ -1,170 +0,0 @@ -updateNecessaryForTable(self::TABLE_NAME_ADDRESS); - $updateCompany = $this->updateNecessaryForTable(self::TABLE_NAME_COMPANY); - $updateContact = $this->updateNecessaryForTable(self::TABLE_NAME_CONTACT); - - return $updateAddress || $updateCompany || $updateContact; - } - - protected function updateNecessaryForTable(string $tableName): bool - { - $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($tableName); - $queryBuilder->getRestrictions()->removeAll(); - $elementCount = $queryBuilder->count('uid') - ->from($tableName) - ->where( - $queryBuilder->expr()->orX( - $queryBuilder->expr()->eq('path_segment', $queryBuilder->createNamedParameter('', \PDO::PARAM_STR)), - $queryBuilder->expr()->isNull('path_segment') - ) - ) - ->execute()->fetchColumn(0); - - return (bool)$elementCount; - } - - /** - * Performs the database update - * - * @return bool - */ - public function executeUpdate(): bool - { - $this->updatePathSegment(self::TABLE_NAME_ADDRESS); - $this->updatePathSegment(self::TABLE_NAME_COMPANY); - $this->updatePathSegment(self::TABLE_NAME_CONTACT); - - return true; - } - - /** - * Returns an array of class names of Prerequisite classes - * - * @return string[] - */ - public function getPrerequisites(): array - { - return []; - } - - /** - * Setter injection for output into upgrade wizards - * - * @param OutputInterface $output - */ - public function setOutput(OutputInterface $output): void - { - $this->output = $output; - } - - /** - * @param string $tableName - * - * @return bool - */ - protected function updatePathSegment(string $tableName): bool - { - $slugHelper = GeneralUtility::makeInstance( - SlugHelper::class, - $tableName, - 'path_segment', - $GLOBALS['TCA'][$tableName]['columns']['path_segment']['config'] - ); - - $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($tableName); - $queryBuilder = $connection->createQueryBuilder(); - $queryBuilder->getRestrictions()->removeAll(); - $statement = $queryBuilder->select('*') - ->from($tableName) - ->where( - $queryBuilder->expr()->orX( - $queryBuilder->expr()->eq('path_segment', $queryBuilder->createNamedParameter('', \PDO::PARAM_STR)), - $queryBuilder->expr()->isNull('path_segment') - ) - ) - ->execute(); - while ($record = $statement->fetch()) { - $slug = $slugHelper->generate($record, $record['pid']); - - $queryBuilder = $connection->createQueryBuilder(); - $queryBuilder->update($tableName) - ->where( - $queryBuilder->expr()->eq( - 'uid', - $queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT) - ) - ) - ->set('path_segment', $slug); - $queryBuilder->getSQL(); - $queryBuilder->execute(); - } - - return true; - } -} diff --git a/Classes/Hooks/ItemsProcFunc.php b/Classes/UserFunctions/ItemsProcFunc.php similarity index 77% rename from Classes/Hooks/ItemsProcFunc.php rename to Classes/UserFunctions/ItemsProcFunc.php index 7511477..8ec2f50 100644 --- a/Classes/Hooks/ItemsProcFunc.php +++ b/Classes/UserFunctions/ItemsProcFunc.php @@ -1,6 +1,6 @@ getPageId($config['flexParentDatabaseRow']['pid']); + $pageId = $this->getPageId($config['flexParentDatabaseRow']['pid']) ?? 0; $extKey = $config['config']['extKey']; $pluginName = $config['config']['pluginName']; @@ -48,8 +45,8 @@ public function user_templateLayout(array &$config) $templateLayouts = $this->reduceTemplateLayouts($templateLayouts, $currentColPos); foreach ($templateLayouts as $layout) { $additionalLayout = [ - htmlspecialchars($this->getLanguageService()->sL($layout[0])), - $layout[1] + 'label' => htmlspecialchars($this->getLanguageService()->sL($layout[0])), + 'value' => $layout[1], ]; $config['items'][] = $additionalLayout; } @@ -58,19 +55,15 @@ public function user_templateLayout(array &$config) /** * Reduce the template layouts by the ones that are not allowed in given colPos - * - * @param array $templateLayouts - * @param int $currentColPos - * @return array */ - protected function reduceTemplateLayouts($templateLayouts, $currentColPos) + protected function reduceTemplateLayouts($templateLayouts, $currentColPos): array { $currentColPos = (int)$currentColPos; $restrictions = []; $allLayouts = []; foreach ($templateLayouts as $key => $layout) { if (is_array($layout[0])) { - if (isset($layout[0]['allowedColPos']) && StringUtility::endsWith($layout[1], '.')) { + if (isset($layout[0]['allowedColPos']) && str_ends_with($layout[1], '.')) { $layoutKey = substr($layout[1], 0, -1); $restrictions[$layoutKey] = GeneralUtility::intExplode(',', $layout[0]['allowedColPos'], true); } @@ -91,11 +84,8 @@ protected function reduceTemplateLayouts($templateLayouts, $currentColPos) /** * Get page id, if negative, then it is a "after record" - * - * @param int $pid - * @return int */ - protected function getPageId($pid) + protected function getPageId($pid): int { $pid = (int)$pid; @@ -107,12 +97,7 @@ protected function getPageId($pid) return $row['pid']; } - /** - * Returns LanguageService - * - * @return \TYPO3\CMS\Core\Localization\LanguageService - */ - protected function getLanguageService() + protected function getLanguageService(): LanguageService { return $GLOBALS['LANG']; } diff --git a/Classes/Utility/PageUtility.php b/Classes/Utility/PageUtility.php index 15c4293..901b1ae 100644 --- a/Classes/Utility/PageUtility.php +++ b/Classes/Utility/PageUtility.php @@ -1,8 +1,6 @@ = 0) { - $pids = $queryGenerator->getTreeList($startPid, $recursive, 0, 1); + $pids = self::getTreeList($startPid, $recursive, 0, 1); if (strlen($pids) > 0) { $recursiveStoragePids .= ',' . $pids; } } } - return GeneralUtility::uniqueList($recursiveStoragePids); + return StringUtility::uniqueList($recursiveStoragePids); } + + /** + * Recursively fetch all descendants of a given page + */ + protected static function getTreeList(int $id, int $depth, int $begin = 0, string $permsClause = ''): string + { + if ($id < 0) { + $id = abs($id); + } + if ($begin === 0) { + $theList = (string)$id; + } else { + $theList = ''; + } + if ($id && $depth > 0) { + $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages'); + $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class)); + $queryBuilder->select('uid') + ->from('pages') + ->where( + $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($id, Connection::PARAM_INT)), + $queryBuilder->expr()->eq('sys_language_uid', 0) + ) + ->orderBy('uid'); + if ($permsClause !== '') { + $queryBuilder->andWhere(QueryHelper::stripLogicalOperatorPrefix($permsClause)); + } + $statement = $queryBuilder->executeQuery(); + while ($row = $statement->fetchAssociative()) { + if ($begin <= 0) { + $theList .= ',' . $row['uid']; + } + if ($depth > 1) { + $theSubList = self::getTreeList($row['uid'], $depth - 1, $begin - 1, $permsClause); + if (!empty($theList) && !empty($theSubList) && ($theSubList[0] !== ',')) { + $theList .= ','; + } + $theList .= $theSubList; + } + } + } + + return $theList; + } + } diff --git a/Classes/Utility/TemplateLayout.php b/Classes/Utility/TemplateLayout.php index d6f963e..57b0798 100644 --- a/Classes/Utility/TemplateLayout.php +++ b/Classes/Utility/TemplateLayout.php @@ -18,13 +18,8 @@ class TemplateLayout implements SingletonInterface /** * Get available template layouts for a certain page - * - * @param int $pageUid - * @param string $extKey - * @param string $pluginName - * @return array */ - public function getAvailableTemplateLayouts($pageUid, $extKey, $pluginName) + public function getAvailableTemplateLayouts($pageUid, $extKey, $pluginName): array { $templateLayouts = []; $pluginName = GeneralUtility::camelCaseToLowerCaseUnderscored($pluginName); @@ -45,7 +40,7 @@ public function getAvailableTemplateLayouts($pageUid, $extKey, $pluginName) // Add TsConfig values foreach ($this->getTemplateLayoutsFromTsConfig($pageUid, $extKey, $pluginName) as $templateKey => $title) { - if (GeneralUtility::isFirstPartOfStr($title, '--div--')) { + if (str_starts_with($title, '--div--')) { $optGroupParts = GeneralUtility::trimExplode(',', $title, true, 2); $title = $optGroupParts[1]; $templateKey = $optGroupParts[0]; @@ -58,12 +53,8 @@ public function getAvailableTemplateLayouts($pageUid, $extKey, $pluginName) /** * Get template layouts defined in TsConfig - * - * @param $pageUid - * @param string $pluginName - * @return array */ - protected function getTemplateLayoutsFromTsConfig($pageUid, $extKey, $pluginName) + protected function getTemplateLayoutsFromTsConfig(int $pageUid, string $extKey, string $pluginName): array { $templateLayouts = []; $pagesTsConfig = BackendUtility::getPagesTSconfig($pageUid); diff --git a/Classes/ViewHelpers/MetaTagViewHelper.php b/Classes/ViewHelpers/MetaTagViewHelper.php index 086c02f..b894703 100644 --- a/Classes/ViewHelpers/MetaTagViewHelper.php +++ b/Classes/ViewHelpers/MetaTagViewHelper.php @@ -18,7 +18,7 @@ * * # Example: Basic Example: product title as og:title meta tag * - * + * * * * @@ -31,9 +31,6 @@ class MetaTagViewHelper extends AbstractViewHelper */ protected $tagName = 'meta'; - /** - * Arguments initialization - */ public function initializeArguments() { $this->registerArgument( diff --git a/Configuration/Backend/Modules.php b/Configuration/Backend/Modules.php new file mode 100644 index 0000000..9d8c125 --- /dev/null +++ b/Configuration/Backend/Modules.php @@ -0,0 +1,25 @@ + [ + 'parent' => 'web', + 'position' => ['bottom'], + 'access' => 'admin', + 'workspaces' => 'live', + 'path' => '/module/web/contacts', + 'labels' => 'LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.module.contacts', + 'iconIdentifier' => 'module-contacts', + 'extensionName' => 'Contacts', + 'controllerActions' => [ + CompanyController::class => [ + 'list', 'show', + ], + ContactController::class => [ + 'list', 'show', + ], + ], + ], +]; diff --git a/Configuration/Commands.php b/Configuration/Commands.php deleted file mode 100644 index 479a2ca..0000000 --- a/Configuration/Commands.php +++ /dev/null @@ -1,9 +0,0 @@ - [ - 'class' => GeocodeCommand::class - ] -]; diff --git a/Configuration/FlexForms/AddressPlugin.xml b/Configuration/FlexForms/AddressPlugin.xml old mode 100755 new mode 100644 index fbad500..ecf7643 --- a/Configuration/FlexForms/AddressPlugin.xml +++ b/Configuration/FlexForms/AddressPlugin.xml @@ -1,42 +1,36 @@ + - - Optionen - + Optionen array - - - - select - selectSingle - - - - - - - - - tx_contacts_domain_model_address - - + + + select + selectSingle + + + + + + + + tx_contacts_domain_model_address + - - - - - select - Extcode\Contacts\Hooks\ItemsProcFunc->user_templateLayout - contacts - Address - selectSingle - - + + + select + Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout + contacts + Address + selectSingle + diff --git a/Configuration/FlexForms/AddressSearchPlugin.xml b/Configuration/FlexForms/AddressSearchPlugin.xml old mode 100755 new mode 100644 index ea784cf..7e3b7c8 --- a/Configuration/FlexForms/AddressSearchPlugin.xml +++ b/Configuration/FlexForms/AddressSearchPlugin.xml @@ -1,105 +1,89 @@ + - - Optionen - + Optionen array - - - - select - Extcode\Contacts\Hooks\ItemsProcFunc->user_templateLayout - contacts - AddressSearch - selectSingle - - + + + select + Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout + contacts + AddressSearch + selectSingle + - - - - reload - - check - - + + reload + + check + - - - - reload - FIELD:settings.displayResultList:=:1 - - select - selectSingle - - - - - - - - - LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.addressSearch.settings.orderBy.distance - distance - - - LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.addressSearch.settings.orderBy.title - title - - - - + + reload + FIELD:settings.displayResultList:=:1 + + select + selectSingle + + + + + + + + + distance + + + + title + + + - - - - FIELD:settings.orderBy:=:distance - - select - selectSingle - - - - - - - - - LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.addressSearch.settings.orderBy.title - title - - - - + + FIELD:settings.orderBy:=:distance + + select + selectSingle + + + + + + + + + title + + + - - - 1 - - - group - db - pages - 1 - 1 - 0 - 1 - - - suggest - - - - + 1 + + + group + pages + 1 + 1 + 0 + 1 + + + suggest + + + diff --git a/Configuration/FlexForms/CompaniesPlugin.xml b/Configuration/FlexForms/CompaniesPlugin.xml old mode 100755 new mode 100644 index dbc3a82..6ac34a0 --- a/Configuration/FlexForms/CompaniesPlugin.xml +++ b/Configuration/FlexForms/CompaniesPlugin.xml @@ -1,108 +1,93 @@ + - - Optionen - + Optionen array - - - - select - selectSingle - - - - LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.companyController.listAction.title - - Company->list;Company->show - - - - LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.companyController.teaserAction.title - - Company->teaser - - - - + + + select + selectSingle + + + + Company->list;Company->show + + + + Company->teaser + + + - - - - - select - selectSingle - - - - - - - - - LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.companies.action.company.list.orderBy.name - name - - - - + + + select + selectSingle + + + + + + + + + name + + + - - - - FIELD:switchableControllerActions:=:Company->teaser - - select - selectMultipleSideBySide - tx_contacts_domain_model_company - AND (tx_contacts_domain_model_company.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_contacts_domain_model_company.sys_language_uid = '-1') AND tx_contacts_domain_model_company.deleted = 0 AND tx_contacts_domain_model_company.hidden = 0 - 3 - 1 - 99 - - - - - - - 1 - - FIELD:switchableControllerActions:=:Company->list;Company->show - - select - 50 - sys_category - AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC - + + FIELD:switchableControllerActions:=:Company->teaser + + select + selectMultipleSideBySide + tx_contacts_domain_model_company + AND (tx_contacts_domain_model_company.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_contacts_domain_model_company.sys_language_uid = '-1') AND tx_contacts_domain_model_company.deleted = 0 AND tx_contacts_domain_model_company.hidden = 0 + 3 + 1 99 - tree - selectTree - 10 - - - 1 - 1 - - parent - - + + + 1 + + FIELD:switchableControllerActions:=:Company->list;Company->show + + select + 50 + sys_category + AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC + + 99 + tree + selectTree + 10 + + + 1 + 1 + + parent + + - - - - FIELD:switchableControllerActions:=:Company->list;Company->show - - check - - + + FIELD:switchableControllerActions:=:Company->list;Company->show + + check + diff --git a/Configuration/FlexForms/CompanyTeaserPlugin.xml b/Configuration/FlexForms/CompanyTeaserPlugin.xml old mode 100755 new mode 100644 index 0380f02..7521203 --- a/Configuration/FlexForms/CompanyTeaserPlugin.xml +++ b/Configuration/FlexForms/CompanyTeaserPlugin.xml @@ -1,38 +1,32 @@ + - - Optionen - + Optionen array - - - - select - selectMultipleSideBySide - tx_contacts_domain_model_company - AND (tx_contacts_domain_model_company.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_contacts_domain_model_company.sys_language_uid = '-1') AND tx_contacts_domain_model_company.deleted = 0 AND tx_contacts_domain_model_company.hidden = 0 - 3 - 1 - 99 - - + + + select + selectMultipleSideBySide + tx_contacts_domain_model_company + AND (tx_contacts_domain_model_company.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_contacts_domain_model_company.sys_language_uid = '-1') AND tx_contacts_domain_model_company.deleted = 0 AND tx_contacts_domain_model_company.hidden = 0 + 3 + 1 + 99 + - - - - - select - Extcode\Contacts\Hooks\ItemsProcFunc->user_templateLayout - contacts - CompanyTeaser - selectSingle - - + + + select + Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout + contacts + CompanyTeaser + selectSingle + diff --git a/Configuration/FlexForms/ContactTeaserPlugin.xml b/Configuration/FlexForms/ContactTeaserPlugin.xml old mode 100755 new mode 100644 index 936f8ed..8bcd289 --- a/Configuration/FlexForms/ContactTeaserPlugin.xml +++ b/Configuration/FlexForms/ContactTeaserPlugin.xml @@ -1,38 +1,32 @@ + - - Optionen - + Optionen array - - - - select - selectMultipleSideBySide - tx_contacts_domain_model_contact - AND (tx_contacts_domain_model_contact.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_contacts_domain_model_contact.sys_language_uid = '-1') AND tx_contacts_domain_model_contact.deleted = 0 AND tx_contacts_domain_model_contact.hidden = 0 - 3 - 1 - 99 - - + + + select + selectMultipleSideBySide + tx_contacts_domain_model_contact + AND (tx_contacts_domain_model_contact.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_contacts_domain_model_contact.sys_language_uid = '-1') AND tx_contacts_domain_model_contact.deleted = 0 AND tx_contacts_domain_model_contact.hidden = 0 + 3 + 1 + 99 + - - - - - select - Extcode\Contacts\Hooks\ItemsProcFunc->user_templateLayout - contacts - ContactTeaser - selectSingle - - + + + select + Extcode\Contacts\UserFunctions\ItemsProcFunc->user_templateLayout + contacts + ContactTeaser + selectSingle + diff --git a/Configuration/FlexForms/ContactsPlugin.xml b/Configuration/FlexForms/ContactsPlugin.xml old mode 100755 new mode 100644 index f6ceee2..fe0b492 --- a/Configuration/FlexForms/ContactsPlugin.xml +++ b/Configuration/FlexForms/ContactsPlugin.xml @@ -1,109 +1,94 @@ + - - Optionen - + Optionen array - - - reload - - select - selectSingle - - - - LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.contactController.listAction.title - - Contact->list;Contact->show - - - - LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf:tx_contacts.plugin.contactController.teaserAction.title - - Contact->teaser - - - - + + reload + + select + selectSingle + + + + Contact->list;Contact->show + + + + Contact->teaser + + + - - - - - select - selectSingle - - - - - - - - - LLL:EXT:contacts/Resources/Private/Language/locallang_be.xlf:tx_contacts.plugin.contacts.action.contact.list.orderBy.last_name - last_name - - - - + + + select + selectSingle + + + + + + + + + last_name + + + - - - - FIELD:switchableControllerActions:=:Contact->teaser - - select - selectMultipleSideBySide - tx_contacts_domain_model_contact - AND (tx_contacts_domain_model_contact.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_contacts_domain_model_contact.sys_language_uid = '-1') AND tx_contacts_domain_model_contact.deleted = 0 AND tx_contacts_domain_model_contact.hidden = 0 - 3 - 1 - 99 - - - - - - - 1 - - FIELD:switchableControllerActions:=:Contact->list;Contact->show - - select - 50 - sys_category - AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC - + + FIELD:switchableControllerActions:=:Contact->teaser + + select + selectMultipleSideBySide + tx_contacts_domain_model_contact + AND (tx_contacts_domain_model_contact.sys_language_uid=CAST('###REC_FIELD_sys_language_uid###' AS UNSIGNED) OR tx_contacts_domain_model_contact.sys_language_uid = '-1') AND tx_contacts_domain_model_contact.deleted = 0 AND tx_contacts_domain_model_contact.hidden = 0 + 3 + 1 99 - tree - selectTree - 10 - - - 1 - 1 - - parent - - + + + 1 + + FIELD:switchableControllerActions:=:Contact->list;Contact->show + + select + 50 + sys_category + AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC + + 99 + tree + selectTree + 10 + + + 1 + 1 + + parent + + - - - - FIELD:switchableControllerActions:=:Contact->list;Contact->show - - check - - + + FIELD:switchableControllerActions:=:Contact->list;Contact->show + + check + diff --git a/Configuration/Icons.php b/Configuration/Icons.php new file mode 100644 index 0000000..ab00a2c --- /dev/null +++ b/Configuration/Icons.php @@ -0,0 +1,8 @@ + [ + 'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + 'source' => 'EXT:contacts/Resources/Public/Icons/module_contacts.svg', + ], +]; diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml new file mode 100644 index 0000000..c4d091c --- /dev/null +++ b/Configuration/Services.yaml @@ -0,0 +1,8 @@ +services: + _defaults: + autowire: true + autoconfigure: true + public: false + + Extcode\Contacts\: + resource: '../Classes/*' diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php index 4c0c774..7f41548 100644 --- a/Configuration/TCA/Overrides/sys_template.php +++ b/Configuration/TCA/Overrides/sys_template.php @@ -3,7 +3,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; -defined('TYPO3_MODE') or die(); +defined('TYPO3') or die(); call_user_func(function () { ExtensionManagementUtility::addStaticFile( diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php index 5fa749d..8c6eea2 100644 --- a/Configuration/TCA/Overrides/tt_content.php +++ b/Configuration/TCA/Overrides/tt_content.php @@ -4,7 +4,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Utility\ExtensionUtility; -defined('TYPO3_MODE') or die(); +defined('TYPO3') or die(); call_user_func(function () { $_LLL_db = 'LLL:' . 'EXT:contacts/Resources/Private/Language/locallang_db.xlf'; @@ -18,12 +18,14 @@ 'ContactTeaser', ]; + foreach ($pluginNames as $pluginName) { $pluginSignature = 'contacts_' . strtolower($pluginName); ExtensionUtility::registerPlugin( 'Contacts', $pluginName, - $_LLL_db . ':tx_contacts.plugin.' . lcfirst($pluginName) + $_LLL_db . ':tx_contacts.plugin.' . lcfirst($pluginName), + 'module-contacts', ); $flexFormPath = 'EXT:contacts/Configuration/FlexForms/' . $pluginName . 'Plugin.xml'; if (file_exists(GeneralUtility::getFileAbsFileName($flexFormPath))) { diff --git a/Configuration/TCA/Overrides/tx_contacts_domain_model_address.php b/Configuration/TCA/Overrides/tx_contacts_domain_model_address.php index fa2ed88..43a008e 100755 --- a/Configuration/TCA/Overrides/tx_contacts_domain_model_address.php +++ b/Configuration/TCA/Overrides/tx_contacts_domain_model_address.php @@ -2,7 +2,7 @@ use Extcode\Contacts\Hooks\GoogleMapHook; -defined('TYPO3_MODE') or die(); +defined('TYPO3') or die(); use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; diff --git a/Configuration/TCA/Overrides/tx_contacts_domain_model_company.php b/Configuration/TCA/Overrides/tx_contacts_domain_model_company.php index ee8b243..9fe858e 100644 --- a/Configuration/TCA/Overrides/tx_contacts_domain_model_company.php +++ b/Configuration/TCA/Overrides/tx_contacts_domain_model_company.php @@ -1,5 +1,5 @@ $_LLL_db . 'tx_contacts_domain_model_company.category', - 'fieldConfiguration' => [ - 'minitems' => 0, - 'maxitems' => 1, - 'multiple' => false, - ] - ] -); +$GLOBALS['TCA']['tx_contacts_domain_model_company']['columns']['category'] = [ + 'exclude' => true, + 'label' => $_LLL_db . 'tx_contacts_domain_model_company.category', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'foreign_table' => 'sys_category', + 'foreign_table_where' => 'AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC', + 'items' => [ + ['', 0], + ], + 'minitems' => 0, + 'maxitems' => 1, + 'eval' => 'int', + 'default' => 0, + ], +]; -ExtensionManagementUtility::makeCategorizable( - 'contacts', - 'tx_contacts_domain_model_company', - 'categories', - [ - 'label' => $_LLL_db . 'tx_contacts_domain_model_company.categories' - ] -); +$GLOBALS['TCA']['tx_contacts_domain_model_company']['columns']['categories'] = [ + 'exclude' => true, + 'label' => $_LLL_db . 'tx_contacts_domain_model_company.categories', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'foreign_table' => 'sys_category', + 'foreign_table_where' => 'AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC', + 'items' => [ + ['', 0], + ], + 'minitems' => 0, + 'maxitems' => 9999, + 'eval' => 'int', + 'default' => 0, + ], +]; // category restriction based on settings in extension manager $categoryRestrictionSetting = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('contacts', 'categoryRestriction'); diff --git a/Configuration/TCA/Overrides/tx_contacts_domain_model_contact.php b/Configuration/TCA/Overrides/tx_contacts_domain_model_contact.php index 927c687..e04c431 100644 --- a/Configuration/TCA/Overrides/tx_contacts_domain_model_contact.php +++ b/Configuration/TCA/Overrides/tx_contacts_domain_model_contact.php @@ -1,5 +1,5 @@ $_LLL_db . 'tx_contacts_domain_model_contact.category', - 'fieldConfiguration' => [ - 'minitems' => 0, - 'maxitems' => 1, - 'multiple' => false, - ] - ] -); +$GLOBALS['TCA']['tx_contacts_domain_model_contact']['columns']['category'] = [ + 'exclude' => true, + 'label' => $_LLL_db . 'tx_contacts_domain_model_contact.category', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'foreign_table' => 'sys_category', + 'foreign_table_where' => 'AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC', + 'items' => [ + ['', 0], + ], + 'minitems' => 0, + 'maxitems' => 1, + 'eval' => 'int', + 'default' => 0, + ], +]; -ExtensionManagementUtility::makeCategorizable( - 'contacts', - 'tx_contacts_domain_model_contact', - 'categories', - [ - 'label' => $_LLL_db . 'tx_contacts_domain_model_contact.categories' - ] -); +$GLOBALS['TCA']['tx_contacts_domain_model_contact']['columns']['categories'] = [ + 'exclude' => true, + 'label' => $_LLL_db . 'tx_contacts_domain_model_contact.categories', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectMultipleSideBySide', + 'foreign_table' => 'sys_category', + 'foreign_table_where' => 'AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.title ASC', + 'items' => [ + ['', 0], + ], + 'minitems' => 0, + 'maxitems' => 9999, + 'eval' => 'int', + 'default' => 0, + ], +]; // category restriction based on settings in extension manager $categoryRestrictionSetting = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('contacts', 'categoryRestriction'); diff --git a/Configuration/TCA/tx_contacts_domain_model_address.php b/Configuration/TCA/tx_contacts_domain_model_address.php index 857fa4c..7300cdc 100755 --- a/Configuration/TCA/tx_contacts_domain_model_address.php +++ b/Configuration/TCA/tx_contacts_domain_model_address.php @@ -1,6 +1,6 @@ 1, 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'versioningWS' => true, 'origUid' => 't3_origuid', @@ -65,18 +64,7 @@ 'sys_language_uid' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'foreign_table' => 'sys_language', - 'foreign_table_where' => 'ORDER BY sys_language.title', - 'items' => [ - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1], - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0] - ], - 'eval' => 'int', - 'default' => 0, - ], + 'config' => ['type' => 'language'], ], 'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -85,7 +73,7 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'foreign_table' => 'tx_contacts_domain_model_address', 'foreign_table_where' => 'AND tx_contacts_domain_model_address.pid=###CURRENT_PID### AND tx_contacts_domain_model_address.sys_language_uid IN (-1,0)', @@ -109,22 +97,15 @@ 'label' => $_LLL_core_general . ':LGL.hidden', 'config' => [ 'type' => 'check', - 'renderType' => 'checkboxToggle', - 'items' => [ - '1' => [ - '0' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:hidden.I.0' - ] - ] + 'renderType' => 'checkboxToggle' ], ], 'starttime' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => [ @@ -136,10 +117,8 @@ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => [ @@ -184,28 +163,28 @@ 'renderType' => 'selectSingle', 'items' => [ [ - $_LLL_db . ':tx_contacts_domain_model_address.type.DOM', - 'DOM' + 'label' => $_LLL_db . ':tx_contacts_domain_model_address.type.DOM', + 'value' => 'DOM' ], [ - $_LLL_db . ':tx_contacts_domain_model_address.type.INTL', - 'INTL' + 'label' => $_LLL_db . ':tx_contacts_domain_model_address.type.INTL', + 'value' => 'INTL' ], [ - $_LLL_db . ':tx_contacts_domain_model_address.type.POSTAL', - 'POSTAL' + 'label' => $_LLL_db . ':tx_contacts_domain_model_address.type.POSTAL', + 'value' => 'POSTAL' ], [ - $_LLL_db . ':tx_contacts_domain_model_address.type.PARCEL', - 'PARCEL' + 'label' => $_LLL_db . ':tx_contacts_domain_model_address.type.PARCEL', + 'value' => 'PARCEL' ], [ - $_LLL_db . ':tx_contacts_domain_model_address.type.HOME', - 'HOME' + 'label' => $_LLL_db . ':tx_contacts_domain_model_address.type.HOME', + 'value' => 'HOME' ], [ - $_LLL_db . ':tx_contacts_domain_model_address.type.WORK', - 'WORK' + 'label' => $_LLL_db . ':tx_contacts_domain_model_address.type.WORK', + 'value' => 'WORK' ], ], 'size' => 5, @@ -340,7 +319,6 @@ 'appearance' => [ 'levelLinksPosition' => 'top', 'showPossibleLocalizationRecords' => true, - 'showRemovedLocalizationRecords' => true, 'showAllLocalizationLink' => true, 'showSynchronizationLink' => true, 'enabledControls' => [ diff --git a/Configuration/TCA/tx_contacts_domain_model_company.php b/Configuration/TCA/tx_contacts_domain_model_company.php index f4777ff..d6eb861 100755 --- a/Configuration/TCA/tx_contacts_domain_model_company.php +++ b/Configuration/TCA/tx_contacts_domain_model_company.php @@ -2,7 +2,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; -defined('TYPO3_MODE') or die(); +defined('TYPO3') or die(); $_LLL_core_general = 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf'; $_LLL_db = 'LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf'; @@ -14,7 +14,6 @@ 'label' => 'name', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'versioningWS' => true, 'origUid' => 't3_origuid', @@ -71,18 +70,7 @@ 'sys_language_uid' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'foreign_table' => 'sys_language', - 'foreign_table_where' => 'ORDER BY sys_language.title', - 'items' => [ - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1], - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0] - ], - 'eval' => 'int', - 'default' => 0, - ], + 'config' => ['type' => 'language'], ], 'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -91,7 +79,7 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'foreign_table' => 'tx_contacts_domain_model_company', 'foreign_table_where' => 'AND tx_contacts_domain_model_company.pid=###CURRENT_PID### AND tx_contacts_domain_model_company.sys_language_uid IN (-1,0)', @@ -117,20 +105,18 @@ 'type' => 'check', 'renderType' => 'checkboxToggle', 'items' => [ - '1' => [ - '0' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:hidden.I.0' - ] - ] + [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hidden', + ], + ], ], ], 'starttime' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => [ @@ -142,10 +128,8 @@ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => [ @@ -164,7 +148,7 @@ 'foreign_table' => 'fe_users', 'size' => 1, 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'minitems' => 0, 'maxitems' => 1, @@ -179,7 +163,8 @@ 'config' => [ 'type' => 'input', 'size' => 30, - 'eval' => 'trim,required' + 'eval' => 'trim', + 'required' => true ], ], 'legal_name' => [ @@ -261,7 +246,6 @@ 'label' => $_LLL_db . ':tx_contacts_domain_model_company.directors', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'foreign_table' => 'tx_contacts_domain_model_contact', 'allowed' => 'tx_contacts_domain_model_contact', 'MM' => 'tx_contacts_domain_model_company_director_mm', @@ -284,7 +268,6 @@ 'label' => $_LLL_db . ':tx_contacts_domain_model_company.contacts', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'foreign_table' => 'tx_contacts_domain_model_contact', 'allowed' => 'tx_contacts_domain_model_contact', 'MM' => 'tx_contacts_domain_model_contact_company_mm', @@ -307,7 +290,6 @@ 'label' => $_LLL_db . ':tx_contacts_domain_model_company.companies', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'foreign_table' => 'tx_contacts_domain_model_company', 'allowed' => 'tx_contacts_domain_model_company', 'MM' => 'tx_contacts_domain_model_company_company_mm', @@ -372,23 +354,38 @@ 'exclude' => 1, 'label' => $_LLL_db . ':tx_contacts_domain_model_company.uri', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputLink', + 'type' => 'link', 'size' => 30, - 'max' => 256, - 'eval' => 'trim', - 'softref' => 'typolink', - 'fieldControl' => ['linkPopup' => ['options' => ['title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_link_formlabel', 'blindLinkOptions' => 'mail,folder']]] + 'allowedTypes' => ['page', 'file', 'url', 'record', 'telephone'], + 'appearance' => ['browserTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_link_formlabel'] ], ], 'logo' => [ 'exclude' => 1, 'label' => $_LLL_db . ':tx_contacts_domain_model_company.logo', - 'config' => ExtensionManagementUtility::getFileFieldTCAConfig( - 'Logo', - ['maxitems' => 1], - $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] - ), + 'config' => [ + 'type' => 'file', + 'allowed' => 'common-image-types', + 'maxitems' => 1, + 'minitems' => 0, + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + '0' => [ + 'showitem' => ' + --palette--;LLL:EXT:file/Resources/Private/Language/locallang.xlf:fileimageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\FileType::IMAGE->value => [ + 'showitem' => ' + --palette--;LLL:EXT:file/Resources/Private/Language/locallang.xlf:fileimageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ] + ] + ] + ] ], 'teaser' => [ @@ -432,7 +429,6 @@ 'appearance' => [ 'levelLinksPosition' => 'top', 'showPossibleLocalizationRecords' => true, - 'showRemovedLocalizationRecords' => true, 'showAllLocalizationLink' => true, 'showSynchronizationLink' => true, 'enabledControls' => [ diff --git a/Configuration/TCA/tx_contacts_domain_model_contact.php b/Configuration/TCA/tx_contacts_domain_model_contact.php index 8c4c81d..3d8adce 100755 --- a/Configuration/TCA/tx_contacts_domain_model_contact.php +++ b/Configuration/TCA/tx_contacts_domain_model_contact.php @@ -2,7 +2,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; -defined('TYPO3_MODE') or die(); +defined('TYPO3') or die(); $_LLL_core_general = 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf'; $_LLL_db = 'LLL:EXT:contacts/Resources/Private/Language/locallang_db.xlf'; @@ -16,7 +16,6 @@ 'label_alt_force' => 1, 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'versioningWS' => true, 'origUid' => 't3_origuid', @@ -69,18 +68,7 @@ 'sys_language_uid' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'foreign_table' => 'sys_language', - 'foreign_table_where' => 'ORDER BY sys_language.title', - 'items' => [ - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1], - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0] - ], - 'eval' => 'int', - 'default' => 0, - ], + 'config' => ['type' => 'language'], ], 'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -89,7 +77,7 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'foreign_table' => 'tx_contacts_domain_model_contact', 'foreign_table_where' => 'AND tx_contacts_domain_model_contact.pid=###CURRENT_PID### AND tx_contacts_domain_model_contact.sys_language_uid IN (-1,0)', @@ -115,20 +103,18 @@ 'type' => 'check', 'renderType' => 'checkboxToggle', 'items' => [ - '1' => [ - '0' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:hidden.I.0' - ] - ] + [ + 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.hidden', + ], + ], ], ], 'starttime' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => [ @@ -140,10 +126,8 @@ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => [ @@ -162,7 +146,7 @@ 'foreign_table' => 'fe_users', 'size' => 1, 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'minitems' => 0, 'maxitems' => 1, @@ -195,7 +179,8 @@ 'config' => [ 'type' => 'input', 'size' => 30, - 'eval' => 'trim,required' + 'eval' => 'trim', + 'required' => true ], ], 'last_name' => [ @@ -204,7 +189,8 @@ 'config' => [ 'type' => 'input', 'size' => 30, - 'eval' => 'trim,required' + 'eval' => 'trim', + 'required' => true ], ], @@ -231,12 +217,11 @@ 'exclude' => 1, 'label' => $_LLL_db . ':tx_contacts_domain_model_contact.birthday', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'date,int', 'checkbox' => 1, 'default' => 0, + 'format' => 'date', ], ], 'companies' => [ @@ -244,7 +229,6 @@ 'label' => $_LLL_db . ':tx_contacts_domain_model_contact.companies', 'config' => [ 'type' => 'group', - 'internal_type' => 'db', 'foreign_table' => 'tx_contacts_domain_model_company', 'allowed' => 'tx_contacts_domain_model_company', 'MM' => 'tx_contacts_domain_model_contact_company_mm', @@ -310,23 +294,38 @@ 'exclude' => 1, 'label' => $_LLL_db . ':tx_contacts_domain_model_contact.uri', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputLink', + 'type' => 'link', 'size' => 30, - 'max' => 256, - 'eval' => 'trim', - 'softref' => 'typolink', - 'fieldControl' => ['linkPopup' => ['options' => ['title' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_link_formlabel', 'blindLinkOptions' => 'mail,folder']]] + 'allowedTypes' => ['page', 'file', 'url', 'record', 'telephone'], + 'appearance' => ['browserTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_link_formlabel'] ], ], 'photo' => [ 'exclude' => 1, 'label' => $_LLL_db . ':tx_contacts_domain_model_contact.photo', - 'config' => ExtensionManagementUtility::getFileFieldTCAConfig( - 'Photo', - ['maxitems' => 1], - $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] - ), + 'config' => [ + 'type' => 'file', + 'allowed' => 'common-image-types', + 'maxitems' => 1, + 'minitems' => 0, + 'appearance' => [ + 'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference' + ], + 'overrideChildTca' => [ + 'types' => [ + '0' => [ + 'showitem' => ' + --palette--;LLL:EXT:file/Resources/Private/Language/locallang.xlf:fileimageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ], + \TYPO3\CMS\Core\Resource\FileType::IMAGE->value => [ + 'showitem' => ' + --palette--;LLL:EXT:file/Resources/Private/Language/locallang.xlf:fileimageoverlayPalette;imageoverlayPalette, + --palette--;;filePalette' + ] + ] + ] + ] ], 'teaser' => [ @@ -370,7 +369,6 @@ 'appearance' => [ 'levelLinksPosition' => 'top', 'showPossibleLocalizationRecords' => true, - 'showRemovedLocalizationRecords' => true, 'showAllLocalizationLink' => true, 'showSynchronizationLink' => true, 'enabledControls' => [ diff --git a/Configuration/TCA/tx_contacts_domain_model_country.php b/Configuration/TCA/tx_contacts_domain_model_country.php index dbd0f9b..19611f4 100755 --- a/Configuration/TCA/tx_contacts_domain_model_country.php +++ b/Configuration/TCA/tx_contacts_domain_model_country.php @@ -1,6 +1,6 @@ 1, 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'versioningWS' => true, 'origUid' => 't3_origuid', @@ -55,18 +54,7 @@ 'sys_language_uid' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'foreign_table' => 'sys_language', - 'foreign_table_where' => 'ORDER BY sys_language.title', - 'items' => [ - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1], - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0] - ], - 'eval' => 'int', - 'default' => 0, - ], + 'config' => ['type' => 'language'], ], 'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -75,7 +63,7 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'foreign_table' => 'tx_contacts_domain_model_company', 'foreign_table_where' => 'AND tx_contacts_domain_model_company.pid=###CURRENT_PID### AND tx_contacts_domain_model_company.sys_language_uid IN (-1,0)', @@ -99,22 +87,15 @@ 'label' => $_LLL_core_general . ':LGL.hidden', 'config' => [ 'type' => 'check', - 'renderType' => 'checkboxToggle', - 'items' => [ - '1' => [ - '0' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:hidden.I.0' - ] - ] + 'renderType' => 'checkboxToggle' ], ], 'starttime' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => [ @@ -126,10 +107,8 @@ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => [ @@ -143,7 +122,8 @@ 'config' => [ 'type' => 'input', 'size' => 30, - 'eval' => 'trim,required' + 'eval' => 'trim', + 'required' => true ], ], 'iso3' => [ @@ -161,7 +141,8 @@ 'config' => [ 'type' => 'input', 'size' => 30, - 'eval' => 'trim,required' + 'eval' => 'trim', + 'required' => true ], ], 'tld' => [ diff --git a/Configuration/TCA/tx_contacts_domain_model_phone.php b/Configuration/TCA/tx_contacts_domain_model_phone.php index cd69c6c..a320133 100755 --- a/Configuration/TCA/tx_contacts_domain_model_phone.php +++ b/Configuration/TCA/tx_contacts_domain_model_phone.php @@ -1,6 +1,6 @@ 'number', 'tstamp' => 'tstamp', 'crdate' => 'crdate', - 'cruser_id' => 'cruser_id', 'versioningWS' => true, 'origUid' => 't3_origuid', @@ -51,18 +50,7 @@ 'sys_language_uid' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', - 'config' => [ - 'type' => 'select', - 'renderType' => 'selectSingle', - 'foreign_table' => 'sys_language', - 'foreign_table_where' => 'ORDER BY sys_language.title', - 'items' => [ - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', -1], - ['LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.default_value', 0] - ], - 'eval' => 'int', - 'default' => 0, - ], + 'config' => ['type' => 'language'], ], 'l10n_parent' => [ 'displayCond' => 'FIELD:sys_language_uid:>:0', @@ -71,7 +59,7 @@ 'type' => 'select', 'renderType' => 'selectSingle', 'items' => [ - ['', 0], + ['label' => '', 'value' => 0], ], 'foreign_table' => 'tx_contacts_domain_model_phone', 'foreign_table_where' => 'AND tx_contacts_domain_model_phone.pid=###CURRENT_PID### AND tx_contacts_domain_model_phone.sys_language_uid IN (-1,0)', @@ -95,22 +83,15 @@ 'label' => $_LLL_core_general . ':LGL.hidden', 'config' => [ 'type' => 'check', - 'renderType' => 'checkboxToggle', - 'items' => [ - '1' => [ - '0' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:hidden.I.0' - ] - ] + 'renderType' => 'checkboxToggle' ], ], 'starttime' => [ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => [ @@ -122,10 +103,8 @@ 'exclude' => 1, 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.endtime', 'config' => [ - 'type' => 'input', - 'renderType' => 'inputDateTime', + 'type' => 'datetime', 'size' => 13, - 'eval' => 'datetime', 'checkbox' => 0, 'default' => 0, 'range' => [ @@ -141,56 +120,56 @@ 'renderType' => 'selectSingle', 'items' => [ [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.PREF', - 'PREF' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.PREF', + 'value' => 'PREF' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.WORK', - 'WORK' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.WORK', + 'value' => 'WORK' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.HOME', - 'HOME' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.HOME', + 'value' => 'HOME' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.VOICE', - 'VOICE' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.VOICE', + 'value' => 'VOICE' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.FAX', - 'FAX' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.FAX', + 'value' => 'FAX' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.MSG', - 'MSG' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.MSG', + 'value' => 'MSG' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.CELL', - 'CELL' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.CELL', + 'value' => 'CELL' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.PAGER', - 'PAGER' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.PAGER', + 'value' => 'PAGER' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.BBS', - 'BBS' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.BBS', + 'value' => 'BBS' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.MODEM', - 'MODEM' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.MODEM', + 'value' => 'MODEM' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.CAR', - 'CAR' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.CAR', + 'value' => 'CAR' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.ISDN', - 'ISDN' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.ISDN', + 'value' => 'ISDN' ], [ - $_LLL_db . ':tx_contacts_domain_model_phone.type.VIDEO', - 'VIDEO' + 'label' => $_LLL_db . ':tx_contacts_domain_model_phone.type.VIDEO', + 'value' => 'VIDEO' ], ], 'size' => 5, @@ -204,7 +183,8 @@ 'config' => [ 'type' => 'input', 'size' => 30, - 'eval' => 'trim,required' + 'eval' => 'trim', + 'required' => true ], ], 'contact' => [ diff --git a/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript old mode 100755 new mode 100644 index 84a44ad..95a5f2a --- a/Configuration/TypoScript/constants.typoscript +++ b/Configuration/TypoScript/constants.typoscript @@ -4,4 +4,4 @@ plugin.tx_contacts { partialRootPath = EXT:contacts/Resources/Private/Partials/ layoutRootPath = EXT:contacts/Resources/Private/Layouts/ } -} \ No newline at end of file +} diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript old mode 100755 new mode 100644 index 55c018c..a834bef --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -44,8 +44,8 @@ plugin.tx_contacts { saturation = -30 lightness = 30 - companyMarker = EXT:contacts/Resources/Public/Icons/tx_contacts_domain_model_address.png - contactMarker = EXT:contacts/Resources/Public/Icons/tx_contacts_domain_model_address.png + companyMarker = EXT:contacts/Resources/Public/Icons/tx_contacts_domain_model_address.svg + contactMarker = EXT:contacts/Resources/Public/Icons/tx_contacts_domain_model_address.svg } radius { @@ -63,4 +63,4 @@ plugin.tx_contacts_addresssearch { searchWord = disabled } } -} \ No newline at end of file +} diff --git a/README.md b/README.md index d89d876..0eb5b9f 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,14 @@ Download and install the extension with the extension manager module. ## 3.1 Compatibility and supported Versions -| Contacts | TYPO3 | PHP | Support/Development | -| ------------- | ---------- | ----------|--------------------------------------| -| 4.x.x | 10.4, 11.5 | 7.2+ | Features, Bugfixes, Security Updates | -| 3.x.x | 9.5 | 7.2 - 7.4 | Bugfixes, Security Updates | -| 2.x.x | 8.7 | 7.0 - 7.2 | Security Updates | -| 1.x.x | 7.6 | 5.6 - 7.1 | | -| 0.x.x | | | | +| Contacts | TYPO3 | PHP | Support/Development | +|----------|------------|-----------|--------------------------------------| +| 5.x.x | 13.4 | 8.2 | Upgrade TYPO3 v13 | +| 4.x.x | 10.4, 11.5 | 7.2+ | Features, Bugfixes, Security Updates | +| 3.x.x | 9.5 | 7.2 - 7.4 | Bugfixes, Security Updates | +| 2.x.x | 8.7 | 7.0 - 7.2 | Security Updates | +| 1.x.x | 7.6 | 5.6 - 7.1 | | +| 0.x.x | | | | ### 3.2. Changelog @@ -54,4 +55,4 @@ News uses **semantic versioning** which basically means for you, that * [Patreon](https://patreon.com/ext_cart) [1]: https://docs.typo3.org/typo3cms/extensions/cart/ -[2]: https://getcomposer.org/ \ No newline at end of file +[2]: https://getcomposer.org/ diff --git a/Resources/Private/Backend/Layouts/Default.html b/Resources/Private/Backend/Layouts/Default.html deleted file mode 100644 index 0382757..0000000 --- a/Resources/Private/Backend/Layouts/Default.html +++ /dev/null @@ -1,32 +0,0 @@ - - - -
-
-
- -
-
- - -
-
-
-
- -
-
- -
-
-
-
-
- - -
-
- -
- diff --git a/Resources/Private/Backend/Partials/Contact/List/Actions.html b/Resources/Private/Backend/Partials/Contact/List/Actions.html deleted file mode 100644 index c5c4c9a..0000000 --- a/Resources/Private/Backend/Partials/Contact/List/Actions.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - \ No newline at end of file diff --git a/Resources/Private/Backend/Partials/Utility/Paginator.html b/Resources/Private/Backend/Partials/Utility/Paginator.html deleted file mode 100644 index d6ffb9d..0000000 --- a/Resources/Private/Backend/Partials/Utility/Paginator.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - \ No newline at end of file diff --git a/Resources/Private/Backend/Templates/Backend/Company/List.html b/Resources/Private/Backend/Templates/Backend/Company/List.html deleted file mode 100644 index 8c61553..0000000 --- a/Resources/Private/Backend/Templates/Backend/Company/List.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - -
- - - -
- - Select a Page where Company Dataset are saved. - -
-
- diff --git a/Resources/Private/Backend/Templates/Backend/Contact/List.html b/Resources/Private/Backend/Templates/Backend/Contact/List.html deleted file mode 100644 index b0db95b..0000000 --- a/Resources/Private/Backend/Templates/Backend/Contact/List.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - -
- - - -
- - Select a Page where Contacts Dataset are saved. - -
-
- diff --git a/Resources/Private/Layouts/Default.html b/Resources/Private/Layouts/Default.html index 81072b4..13d904a 100755 --- a/Resources/Private/Layouts/Default.html +++ b/Resources/Private/Layouts/Default.html @@ -1,7 +1,6 @@ -
- \ No newline at end of file + diff --git a/Resources/Private/Partials/Address/Marker.html b/Resources/Private/Partials/Address/Marker.html index 557c732..d4850b9 100644 --- a/Resources/Private/Partials/Address/Marker.html +++ b/Resources/Private/Partials/Address/Marker.html @@ -38,10 +38,10 @@

{address.contact.salutation} {address.contact.title} {address.contact.first_ : {phoneNumber.number}
- :
+ :
- : {address.company.uri} + : {address.company.uri}

diff --git a/Resources/Private/Backend/Partials/Address/Show.html b/Resources/Private/Partials/Backend/Address/Show.html similarity index 100% rename from Resources/Private/Backend/Partials/Address/Show.html rename to Resources/Private/Partials/Backend/Address/Show.html diff --git a/Resources/Private/Backend/Partials/Company/List/Actions.html b/Resources/Private/Partials/Backend/Company/List/Actions.html similarity index 100% rename from Resources/Private/Backend/Partials/Company/List/Actions.html rename to Resources/Private/Partials/Backend/Company/List/Actions.html diff --git a/Resources/Private/Backend/Partials/Contact/List/Filter.html b/Resources/Private/Partials/Backend/Company/List/Filter.html similarity index 73% rename from Resources/Private/Backend/Partials/Contact/List/Filter.html rename to Resources/Private/Partials/Backend/Company/List/Filter.html index 27045bb..4b55247 100644 --- a/Resources/Private/Backend/Partials/Contact/List/Filter.html +++ b/Resources/Private/Partials/Backend/Company/List/Filter.html @@ -5,10 +5,9 @@
- - - + +
diff --git a/Resources/Private/Backend/Partials/Company/List/Table.html b/Resources/Private/Partials/Backend/Company/List/Table.html similarity index 100% rename from Resources/Private/Backend/Partials/Company/List/Table.html rename to Resources/Private/Partials/Backend/Company/List/Table.html diff --git a/Resources/Private/Backend/Partials/Company/Show/Actions.html b/Resources/Private/Partials/Backend/Company/Show/Actions.html similarity index 100% rename from Resources/Private/Backend/Partials/Company/Show/Actions.html rename to Resources/Private/Partials/Backend/Company/Show/Actions.html diff --git a/Resources/Private/Backend/Partials/Company/List/Filter.html b/Resources/Private/Partials/Backend/Contact/List/Filter.html similarity index 72% rename from Resources/Private/Backend/Partials/Company/List/Filter.html rename to Resources/Private/Partials/Backend/Contact/List/Filter.html index 2d101b6..fe5f6f0 100644 --- a/Resources/Private/Backend/Partials/Company/List/Filter.html +++ b/Resources/Private/Partials/Backend/Contact/List/Filter.html @@ -5,9 +5,9 @@
- + - +
diff --git a/Resources/Private/Backend/Partials/Contact/List/Table.html b/Resources/Private/Partials/Backend/Contact/List/Table.html similarity index 93% rename from Resources/Private/Backend/Partials/Contact/List/Table.html rename to Resources/Private/Partials/Backend/Contact/List/Table.html index d5db1a2..4eb8034 100644 --- a/Resources/Private/Backend/Partials/Contact/List/Table.html +++ b/Resources/Private/Partials/Backend/Contact/List/Table.html @@ -53,6 +53,5 @@ - - \ No newline at end of file + diff --git a/Resources/Private/Backend/Partials/Contact/Show/Actions.html b/Resources/Private/Partials/Backend/Contact/Show/Actions.html similarity index 100% rename from Resources/Private/Backend/Partials/Contact/Show/Actions.html rename to Resources/Private/Partials/Backend/Contact/Show/Actions.html diff --git a/Resources/Private/Backend/Partials/Phone/Show.html b/Resources/Private/Partials/Backend/Phone/Show.html similarity index 100% rename from Resources/Private/Backend/Partials/Phone/Show.html rename to Resources/Private/Partials/Backend/Phone/Show.html diff --git a/Resources/Private/Partials/Backend/Utility/Paginator.html b/Resources/Private/Partials/Backend/Utility/Paginator.html new file mode 100644 index 0000000..4251e73 --- /dev/null +++ b/Resources/Private/Partials/Backend/Utility/Paginator.html @@ -0,0 +1,75 @@ + + + + + + + diff --git a/Resources/Private/Templates/Backend/Company/List.html b/Resources/Private/Templates/Backend/Company/List.html new file mode 100644 index 0000000..ef6f07f --- /dev/null +++ b/Resources/Private/Templates/Backend/Company/List.html @@ -0,0 +1,23 @@ + + + + + + + + + + +
+ + + +
+ + Select a Page where Company Dataset are saved. + +
+
+ diff --git a/Resources/Private/Backend/Templates/Backend/Company/Show.html b/Resources/Private/Templates/Backend/Company/Show.html similarity index 82% rename from Resources/Private/Backend/Templates/Backend/Company/Show.html rename to Resources/Private/Templates/Backend/Company/Show.html index d81bd12..247c866 100644 --- a/Resources/Private/Backend/Templates/Backend/Company/Show.html +++ b/Resources/Private/Templates/Backend/Company/Show.html @@ -1,13 +1,14 @@ - + - - + + +

@@ -51,30 +52,30 @@

- +

- +

- +

- +

- +
@@ -82,4 +83,4 @@

- \ No newline at end of file + diff --git a/Resources/Private/Templates/Backend/Contact/List.html b/Resources/Private/Templates/Backend/Contact/List.html new file mode 100644 index 0000000..f3a91b4 --- /dev/null +++ b/Resources/Private/Templates/Backend/Contact/List.html @@ -0,0 +1,21 @@ + + + + + + + + + +
+ + + +
+ + Select a Page where Contacts Dataset are saved. + +
+
+ diff --git a/Resources/Private/Backend/Templates/Backend/Contact/Show.html b/Resources/Private/Templates/Backend/Contact/Show.html similarity index 90% rename from Resources/Private/Backend/Templates/Backend/Contact/Show.html rename to Resources/Private/Templates/Backend/Contact/Show.html index 0ef676c..682c5cc 100644 --- a/Resources/Private/Backend/Templates/Backend/Contact/Show.html +++ b/Resources/Private/Templates/Backend/Contact/Show.html @@ -1,13 +1,10 @@ - + - - - - - + +

@@ -75,24 +72,24 @@

- +

- +

- +
- \ No newline at end of file + diff --git a/Tests/Functional/Fixtures/pages.xml b/Tests/Functional/Fixtures/pages.xml index 0071e53..b243b5f 100644 --- a/Tests/Functional/Fixtures/pages.xml +++ b/Tests/Functional/Fixtures/pages.xml @@ -15,4 +15,4 @@ 1 Museums - \ No newline at end of file + diff --git a/Tests/Functional/Fixtures/tx_contacts_domain_model_address.xml b/Tests/Functional/Fixtures/tx_contacts_domain_model_address.xml index 92c9194..d24ef82 100644 --- a/Tests/Functional/Fixtures/tx_contacts_domain_model_address.xml +++ b/Tests/Functional/Fixtures/tx_contacts_domain_model_address.xml @@ -258,7 +258,6 @@ 50.9657873 11.0319855 - 17 3 @@ -308,4 +307,4 @@ 52.5305726 13.3769868 - \ No newline at end of file + diff --git a/Tests/Functional/Fixtures/tx_contacts_domain_model_company.xml b/Tests/Functional/Fixtures/tx_contacts_domain_model_company.xml index e288873..4fa2c79 100644 --- a/Tests/Functional/Fixtures/tx_contacts_domain_model_company.xml +++ b/Tests/Functional/Fixtures/tx_contacts_domain_model_company.xml @@ -144,4 +144,4 @@ '' '' - \ No newline at end of file + diff --git a/Tests/Functional/Fixtures/tx_contacts_domain_model_contact.xml b/Tests/Functional/Fixtures/tx_contacts_domain_model_contact.xml index 4d77ec0..7e9882e 100644 --- a/Tests/Functional/Fixtures/tx_contacts_domain_model_contact.xml +++ b/Tests/Functional/Fixtures/tx_contacts_domain_model_contact.xml @@ -18,7 +18,6 @@ '' '' - 3 3 @@ -37,7 +36,6 @@ '' '' - 5 4 @@ -74,4 +72,4 @@ '' '' - \ No newline at end of file + diff --git a/Tests/Functional/Fixtures/tx_contacts_domain_model_country.xml b/Tests/Functional/Fixtures/tx_contacts_domain_model_country.xml index 5e380fa..e21812f 100644 --- a/Tests/Functional/Fixtures/tx_contacts_domain_model_country.xml +++ b/Tests/Functional/Fixtures/tx_contacts_domain_model_country.xml @@ -9,4 +9,4 @@ de +49 - \ No newline at end of file + diff --git a/composer.json b/composer.json index 2680caa..bf17395 100644 --- a/composer.json +++ b/composer.json @@ -80,8 +80,8 @@ ] }, "require": { - "php": "^7.2 || ^8.0", - "typo3/cms-core": "^10.4 || ^11.5" + "php": "^8.2", + "typo3/cms-core": "^13.4" }, "require-dev": { "typo3/testing-framework": "^6.0", diff --git a/ext_emconf.php b/ext_emconf.php deleted file mode 100755 index 19eb4d4..0000000 --- a/ext_emconf.php +++ /dev/null @@ -1,28 +0,0 @@ - 'Contacts', - 'description' => 'Contacts can handle persons and companies and relations to each other. With multiple addresses and phone numbers Contacts can be a modern replacement for tt_address.', - 'category' => 'plugin', - 'author' => 'Daniel Gohlke', - 'author_email' => 'ext.contacts@extco.de', - 'author_company' => 'extco.de UG (haftungsbeschränkt)', - 'shy' => '', - 'priority' => '', - 'module' => '', - 'state' => 'stable', - 'internal' => '', - 'uploadfolder' => '0', - 'createDirs' => '', - 'modify_tables' => '', - 'clearCacheOnLoad' => 0, - 'lockType' => '', - 'version' => '4.1.0', - 'constraints' => [ - 'depends' => [ - 'typo3' => '10.4.0-11.5.99', - ], - 'conflicts' => [], - 'suggests' => [], - ], -]; diff --git a/ext_localconf.php b/ext_localconf.php index ae03f8b..cb4ab22 100755 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,72 +1,81 @@ 'list, show, teaser', + ContactController::class => 'list, show, teaser', ], [ - \Extcode\Contacts\Controller\ContactController::class => 'list', + ContactController::class => 'list', ] ); -\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( +ExtensionUtility::configurePlugin( 'Contacts', 'ContactTeaser', [ - \Extcode\Contacts\Controller\ContactController::class => 'teaser', + ContactController::class => 'teaser', ], [ - \Extcode\Contacts\Controller\ContactController::class => '', + ContactController::class => '', ] ); -\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( +ExtensionUtility::configurePlugin( 'Contacts', 'Companies', [ - \Extcode\Contacts\Controller\CompanyController::class => 'list, show, teaser', + CompanyController::class => 'list, show, teaser', ], [ - \Extcode\Contacts\Controller\CompanyController::class => 'list', + CompanyController::class => 'list', ] ); -\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( +ExtensionUtility::configurePlugin( 'Contacts', 'CompanyTeaser', [ - \Extcode\Contacts\Controller\CompanyController::class => 'teaser', + CompanyController::class => 'teaser', ], [ - \Extcode\Contacts\Controller\CompanyController::class => '', + CompanyController::class => '', ] ); -\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( +ExtensionUtility::configurePlugin( 'Contacts', 'AddressSearch', [ - \Extcode\Contacts\Controller\AddressController::class => 'search', + AddressController::class => 'search', ], [ - \Extcode\Contacts\Controller\AddressController::class => 'search', + AddressController::class => 'search', ] ); -\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( +ExtensionUtility::configurePlugin( 'Contacts', 'Address', [ - \Extcode\Contacts\Controller\AddressController::class => 'show', + AddressController::class => 'show', ], [ - \Extcode\Contacts\Controller\AddressController::class => '', + AddressController::class => '', ] ); @@ -74,24 +83,20 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['contacts'][] = 'Extcode\\Contacts\\ViewHelpers'; -// update wizard for slugs -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['contactsSlugUpdater'] = - \Extcode\Contacts\Updates\SlugUpdater::class; - // clearCachePostProc Hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['contacts_clearcache'] = - \Extcode\Contacts\Hooks\DataHandler::class . '->clearCachePostProc'; + DataHandler::class . '->clearCachePostProc'; // provide extension configuration for TypoScript -$extensionConfiguration = new \TYPO3\CMS\Core\Configuration\ExtensionConfiguration(); +$extensionConfiguration = new ExtensionConfiguration(); $contactsConfiguration = $extensionConfiguration->get('contacts'); -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('plugin.tx_contacts.googleMapsApiKey=' . $contactsConfiguration['googleMapsApiKey']); -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('plugin.tx_contacts.googleMapsLibrary=' . $contactsConfiguration['googleMapsLibrary']); +ExtensionManagementUtility::addTypoScriptConstants('plugin.tx_contacts.googleMapsApiKey=' . $contactsConfiguration['googleMapsApiKey']); +ExtensionManagementUtility::addTypoScriptConstants('plugin.tx_contacts.googleMapsLibrary=' . $contactsConfiguration['googleMapsLibrary']); // register class to be available in 'eval' of TCA -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][\Extcode\Contacts\DataHandler\EvalFloat8::class] = ''; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][EvalFloat8::class] = ''; // register layouts $GLOBALS['TYPO3_CONF_VARS']['EXT']['contacts']['templateLayouts']['address'][] = [$_LLL_be . ':flexforms_template.templateLayout.address.gmaps', 'gmaps']; diff --git a/ext_tables.php b/ext_tables.php index f0c11af..871e1f7 100755 --- a/ext_tables.php +++ b/ext_tables.php @@ -1,23 +1,3 @@ 'list, show', - \Extcode\Contacts\Controller\Backend\ContactController::class => 'list, show', - ], - [ - 'access' => 'admin', - 'icon' => 'EXT:contacts/Resources/Public/Icons/module_contacts.svg', - 'labels' => $_LLL_db . 'tx_contacts.module.contacts', - ] - ); -} +defined('TYPO3') or die(); diff --git a/ext_tables.sql b/ext_tables.sql index 8a434f2..6de523b 100755 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -288,36 +288,8 @@ CREATE TABLE tx_contacts_domain_model_country ( ); -CREATE TABLE tx_contacts_domain_model_company_company_mm ( - uid_local int(11) DEFAULT '0' NOT NULL, - uid_foreign int(11) DEFAULT '0' NOT NULL, - sorting int(11) DEFAULT '0' NOT NULL, - sorting_foreign int(11) DEFAULT '0' NOT NULL, - - KEY uid_local (uid_local), - KEY uid_foreign (uid_foreign) -); - CREATE TABLE tx_contacts_domain_model_contact_company_mm ( - uid_local int(11) DEFAULT '0' NOT NULL, - uid_foreign int(11) DEFAULT '0' NOT NULL, - sorting int(11) DEFAULT '0' NOT NULL, - sorting_foreign int(11) DEFAULT '0' NOT NULL, - - contact int(11) unsigned DEFAULT '0' NOT NULL, - - KEY uid_local (uid_local), - KEY uid_foreign (uid_foreign) -); - -CREATE TABLE tx_contacts_domain_model_company_director_mm ( - uid_local int(11) DEFAULT '0' NOT NULL, - uid_foreign int(11) DEFAULT '0' NOT NULL, - sorting int(11) DEFAULT '0' NOT NULL, - sorting_foreign int(11) DEFAULT '0' NOT NULL, - - KEY uid_local (uid_local), - KEY uid_foreign (uid_foreign) + contact int(10) unsigned DEFAULT '0' NOT NULL, ); # diff --git a/ext_typoscript_setup.typoscript b/ext_typoscript_setup.typoscript deleted file mode 100644 index c9c10ef..0000000 --- a/ext_typoscript_setup.typoscript +++ /dev/null @@ -1,15 +0,0 @@ -module.tx_contacts { - view { - templateRootPaths { - 100 = EXT:contacts/Resources/Private/Backend/Templates/ - } - - partialRootPaths { - 100 = EXT:contacts/Resources/Private/Backend/Partials/ - } - - layoutRootPaths { - 100 = EXT:contacts/Resources/Private/Backend/Layouts/ - } - } -}