From b30856eec3da990b916adef4ad5208e6a0cb4ead Mon Sep 17 00:00:00 2001 From: Joachim Ruhs Date: Wed, 6 Sep 2023 12:25:35 +0200 Subject: [PATCH] Version 1.8.7 SingleView shows now correct mapIcon --- Classes/Controller/AddressController.php | 24 +++---------------- Classes/Controller/AjaxController.php | 23 ++---------------- .../Domain/Repository/AddressRepository.php | 2 +- Configuration/Extbase/Persistence/Classes.php | 8 +++++++ Resources/Private/Templates/Address/Show.html | 14 +++++------ ext_emconf.php | 2 +- 6 files changed, 22 insertions(+), 51 deletions(-) create mode 100644 Configuration/Extbase/Persistence/Classes.php diff --git a/Classes/Controller/AddressController.php b/Classes/Controller/AddressController.php index 24404f0..0878039 100644 --- a/Classes/Controller/AddressController.php +++ b/Classes/Controller/AddressController.php @@ -69,24 +69,6 @@ public function injectCategoryRepository(\WSR\Myleaflet\Domain\Repository\Catego $this->categoryRepository = $categoryRepository; } - /** - * TTAddressRepository - * - * @var \FriendsOfTYPO3\TtAddress\Domain\Repository\AddressRepository - */ - protected $ttaddressRepository; - - - /** - * Inject a ttaddressRepository to enable DI - * - * @param \FriendsOfTYPO3\TtAddress\Domain\Repository\AddressRepository $ttaddressRepository - * @return void - */ - public function injectTtAddressRepository(\FriendsOfTYPO3\TtAddress\Domain\Repository\AddressRepository $ttaddressRepository) { - $this->ttaddressRepository = $ttaddressRepository; - } - /** * action show @@ -97,11 +79,11 @@ public function showAction() { $this->_GP = $this->request->getArguments(); if ($this->_GP['locationUid'] = $this->_GP['locationUid'] ?? 0) {// called from list link - $address = $this->ttaddressRepository->findByUid(intval($this->_GP['locationUid'])); + $address = $this->addressRepository->findByUid(intval($this->_GP['locationUid'])); // $address = $this->ttaddressRepository->findAll(); } else { - $address = $this->ttaddressRepository->findByUid(intval($this->settings['singleViewUid'])); + $address = $this->addressRepository->findByUid(intval($this->settings['singleViewUid'])); } $this->view->assign('address', $address); return $this->responseFactory->createResponse() @@ -201,7 +183,7 @@ public function ajaxSearchAction() $querySettings->setRespectStoragePage(true); $querySettings->setStoragePageIds(array($customStoragePid)); - $addresses = $this->ttaddressRepository->findAll(); + $addresses = $this->addressRepository->findAll(); if ($this->settings['defaultLanguageUid'] > '') { $querySettings->setLanguageUid($this->settings['defaultLanguageUid']); diff --git a/Classes/Controller/AjaxController.php b/Classes/Controller/AjaxController.php index 7028948..59117c6 100644 --- a/Classes/Controller/AjaxController.php +++ b/Classes/Controller/AjaxController.php @@ -68,25 +68,6 @@ public function injectAddressRepository(AddressRepository $addressRepository) { $this->addressRepository = $addressRepository; } - /** - * TTAddressRepository - * - * @var \FriendsOfTYPO3\TtAddress\Domain\Repository\AddressRepository - */ - protected $ttaddressRepository; - - - /** - * Inject a ttaddressRepository to enable DI - * - * @param \FriendsOfTYPO3\TtAddress\Domain\Repository\AddressRepository $ttaddressRepository - * @return void - */ - - public function injectTtAddressRepository(\FriendsOfTYPO3\TtAddress\Domain\Repository\AddressRepository $ttaddressRepository) { - $this->ttaddressRepository = $ttaddressRepository; - } - /** * categoryRepository * @@ -333,8 +314,8 @@ public function ajaxEidAction() { $locations[$i]['infoWindowAddress'] = str_replace(array("\r\n", "\r", "\n"), '
', htmlspecialchars($address, ENT_QUOTES)); if ($locations[$i]['image'] > 0) { - if ($this->ttaddressRepository->findByUid($locations[$i]['uid'])) { - $images = $this->ttaddressRepository->findByUid($locations[$i]['uid'])->getImage(); + if ($this->addressRepository->findByUid($locations[$i]['uid'])) { + $images = $this->addressRepository->findByUid($locations[$i]['uid'])->getImage(); } $locations[$i]['images'] = $images; } diff --git a/Classes/Domain/Repository/AddressRepository.php b/Classes/Domain/Repository/AddressRepository.php index 083973a..85f10c2 100644 --- a/Classes/Domain/Repository/AddressRepository.php +++ b/Classes/Domain/Repository/AddressRepository.php @@ -284,7 +284,7 @@ public function getFirstCategoryImage($locationUid, $storagePid) { ) ); */ - + } $result = $queryBuilder->execute()->fetchAll(); diff --git a/Configuration/Extbase/Persistence/Classes.php b/Configuration/Extbase/Persistence/Classes.php new file mode 100644 index 0000000..501d101 --- /dev/null +++ b/Configuration/Extbase/Persistence/Classes.php @@ -0,0 +1,8 @@ + [ + 'tableName' => 'tt_address', + ], +]; \ No newline at end of file diff --git a/Resources/Private/Templates/Address/Show.html b/Resources/Private/Templates/Address/Show.html index 3f6b49d..24dd3d5 100644 --- a/Resources/Private/Templates/Address/Show.html +++ b/Resources/Private/Templates/Address/Show.html @@ -57,15 +57,13 @@

Single View for MyLeaflet

{_all} - - -