From beb64503386ddb40bfe96046388c9af201d706c1 Mon Sep 17 00:00:00 2001 From: Thomas Peterson Date: Thu, 11 Dec 2025 15:11:46 +0100 Subject: [PATCH] Fixes --- .make/05-symfony.mk | 6 +- src/new/composer.json | 3 +- src/new/composer.lock | 68 +- src/new/config/packages/doctrine.php | 1 + .../packages/sensio_framework_extra.php | 7 - src/new/phpstan.neon | 6 + .../Controller/DashboardController.php | 82 +- .../Controller/DefaultController.php | 6 +- .../Controller/LoginController.php | 6 +- .../Controller/ShopController.php | 85 +- .../Controller/Backend/ListController.php | 12 +- .../Controller/Backend/ExporterController.php | 12 +- .../Controller/Backend/ImporterController.php | 8 +- .../Api/Account/GetParentByTitle.php | 2 +- .../PSC/Component/ApiBundle/Api/Cms/Get.php | 2 +- .../Component/ApiBundle/Api/Plugin/Get.php | 2 +- .../PSC/Component/ApiBundle/Api/Shop/Get.php | 2 +- .../ApiBundle/Api/Stockbooking/CreateByNr.php | 2 +- .../ApiBundle/Api/Stockbooking/GetByNr.php | 2 +- .../Component/ApiBundle/Api/System/Info.php | 2 +- .../Controller/StoreController.php | 2 +- .../SteplayouterBundle/Calendar/Type/Hoch.php | 4 +- .../Calendar/Type/Hochvariable.php | 4 +- .../SteplayouterBundle/Calendar/Type/Quer.php | 4 +- .../Controller/CalendarController.php | 4 +- .../Controller/DefaultController.php | 6 +- .../Controller/PdfController.php | 2 +- .../Controller/ProductController.php | 2 +- .../Controller/StoreController.php | 2 +- .../Controller/System/CheckController.php | 8 +- .../Controller/System/SettingsController.php | 8 +- .../DBAL/Platform/MariaDBPlatform.php | 16 + .../Controller/Backend/EditController.php | 8 +- .../Controller/Backend/ListController.php | 8 +- .../BasketBundle/Api/Basket/Legacy/Add.php | 2 +- .../BasketBundle/Api/Basket/Legacy/Temp.php | 2 +- .../BasketBundle/Api/Basket/Legacy/Update.php | 2 +- .../Controller/Backend/EditController.php | 10 +- .../Controller/Backend/ListController.php | 6 +- .../Controller/Frontend/ShowController.php | 6 +- .../Controller/Backend/OrderController.php | 6 +- .../Shop/ContactBundle/Api/Address/Crud.php | 2 +- .../Api/Address/GetAllForType.php | 2 +- .../src/PSC/Shop/ContactBundle/Api/All.php | 2 +- .../PSC/Shop/ContactBundle/Api/AllByShop.php | 2 +- .../src/PSC/Shop/ContactBundle/Api/Crud.php | 2 +- .../src/PSC/Shop/ContactBundle/Api/Exists.php | 2 +- .../PSC/Shop/ContactBundle/Api/Refresh.php | 2 +- .../Backend/AddressDetailController.php | 8 +- .../Backend/AddressImportController.php | 10 +- .../Controller/Backend/EditController.php | 10 +- .../Controller/Backend/ListController.php | 8 +- .../Repository/ContactRepository.php | 68 +- .../Controller/Backend/CopyController.php | 8 +- .../Controller/Backend/StartController.php | 8 +- .../Repository/AccountRepository.php | 2 +- .../EntityBundle/Repository/CmsRepository.php | 10 +- .../Repository/DomainRepository.php | 10 +- .../Repository/MotivRepository.php | 14 +- .../Repository/OrderRepository.php | 24 +- .../ProductProductgroupRepository.php | 6 +- .../Repository/ProductRepository.php | 40 +- .../Repository/ProductgroupRepository.php | 36 +- .../Repository/ShopContactRepository.php | 38 +- .../Repository/StockbookingRepository.php | 25 +- .../Shop/MediaBundle/Api/UploadVariant.php | 2 +- .../Controller/Backend/ChooserController.php | 4 +- .../Controller/Backend/FolderController.php | 14 +- .../Controller/Backend/MediaController.php | 8 +- .../Controller/Backend/UploadController.php | 10 +- .../Controller/Backend/EditController.php | 10 +- .../Controller/Backend/ListController.php | 6 +- .../OrderBundle/Api/Order/Action/Create.php | 2 +- .../PSC/Shop/OrderBundle/Api/Order/Calc.php | 2 +- .../OrderBundle/Api/Order/ChangeContact.php | 2 +- .../PSC/Shop/OrderBundle/Api/Order/Copy.php | 2 +- .../PSC/Shop/OrderBundle/Api/Order/Create.php | 2 +- .../OrderBundle/Api/Order/GetOneByUuid.php | 2 +- .../Shop/OrderBundle/Api/Order/Package/Nr.php | 2 +- .../Api/Order/Status/GetAllByStatus.php | 2 +- .../Api/Position/GetPluginListDisplay.php | 2 +- .../Api/Position/Status/Change.php | 2 +- .../Api/Position/Status/ChangeAll.php | 2 +- .../Api/Position/Upload/Delete.php | 2 +- .../Controller/Backend/DetailController.php | 12 +- .../Controller/Backend/ListController.php | 12 +- .../Controller/Backend/PackageController.php | 6 +- .../Controller/Backend/PrintController.php | 10 +- .../Controller/Backend/UploadController.php | 6 +- .../Normalizer/SpecialProductDenormalizer.php | 1 + .../PSC/Shop/OrderBundle/Service/Order.php | 124 +- .../src/PSC/Shop/PaymentBundle/Api/All.php | 2 +- .../Controller/Backend/EditController.php | 10 +- .../Controller/Backend/GatewayController.php | 6 +- .../Controller/Backend/ListController.php | 6 +- .../Controller/Frontend/NotifyController.php | 6 +- .../Controller/Frontend/PayController.php | 4 +- .../Api/Product/GetAllByProductGroup.php | 2 +- .../Api/Product/GetAllByTerm.php | 2 +- .../Shop/ProductBundle/Api/Product/One.php | 2 +- .../ProductBundle/Api/Product/Set/Add.php | 2 +- .../ProductBundle/Api/Product/Set/Delete.php | 2 +- .../Api/ProductGroup/GetTree.php | 2 +- .../Api/ProductGroup/GetWithProducts.php | 2 +- .../Backend/Product/EditController.php | 10 +- .../Backend/Product/ListController.php | 10 +- .../Backend/Product/PermissionController.php | 4 +- .../Backend/Product/SetController.php | 4 +- .../Backend/Product/StockController.php | 4 +- .../Product/TemplateprintController.php | 4 +- .../Backend/Product/UploadController.php | 4 +- .../Backend/Productgroup/EditController.php | 10 +- .../Backend/Productgroup/ListController.php | 8 +- .../Frontend/Product/OfferController.php | 4 +- .../Form/Backend/Product/PermissionType.php | 93 +- .../Form/Backend/Productgroup/SearchType.php | 65 +- .../Controller/Backend/EditController.php | 18 +- .../Controller/Backend/ListController.php | 6 +- .../Controller/Backend/CountryController.php | 12 +- .../Controller/Backend/RoutingController.php | 18 +- .../Controller/Backend/SettingsController.php | 12 +- .../Controller/Json/ShopController.php | 2 +- .../Controller/Backend/EditController.php | 10 +- .../Controller/Backend/GatewayController.php | 6 +- .../Controller/Backend/ImportController.php | 6 +- .../Controller/Backend/ListController.php | 6 +- .../Controller/Service/CreateController.php | 4 +- .../Controller/Service/DownloadController.php | 4 +- .../Repository/ShippingRepository.php | 24 +- .../Controller/Backend/SettingsController.php | 6 +- .../Controller/Backend/EditController.php | 14 +- .../Controller/Backend/ListController.php | 6 +- .../Controller/Backend/ListController.php | 16 +- .../System/SettingsBundle/Api/Paper/One.php | 2 +- .../SettingsBundle/Api/Paper/Update.php | 2 +- .../Controller/Backend/HelpController.php | 18 +- .../Controller/Backend/LogController.php | 8 +- .../Backend/PaperContainerController.php | 8 +- .../Controller/Backend/PaperController.php | 18 +- .../Controller/Backend/SettingsController.php | 14 +- .../Controller/Backend/StatusController.php | 18 +- .../Controller/Backend/TaxController.php | 18 +- .../Controller/FtpController.php | 24 +- .../Controller/MigrationController.php | 6 +- .../templates/backend_tailwind_base.html.twig | 2 +- .../Controller/Backend/StartController.php | 2 +- .../Controller/Backend/DeliveryController.php | 2 +- .../Controller/Backend/ExcelController.php | 2 +- .../Controller/Backend/StartController.php | 2 +- .../Controller/UsereditController.php | 12 +- .../Controller/RegisterController.php | 4 +- .../Controller/TemplateprintController.php | 6 +- .../Controller/Backend/StartController.php | 4 +- .../Krueger/Artikelimport/Queue/Import.php | 1095 ++++++++++------- .../Krueger/ArtikelimportEN/Queue/Import.php | 692 +++++++---- .../Krueger/ArtikelimportFR/Queue/Import.php | 686 +++++++---- .../Artikelkundenimport/Queue/Import.php | 677 ++++++---- .../Erlkonten/Controller/StartController.php | 4 +- .../Controller/StartController.php | 4 +- .../KDVwingame/Controller/StartController.php | 4 +- .../Controller/StartController.php | 4 +- .../Controller/LivesearchController.php | 4 +- .../Controller/StartController.php | 4 +- .../Controller/StartController.php | 4 +- .../Userlk/Controller/StartController.php | 4 +- .../Controller/UsereditController.php | 16 +- .../Controller/OrdersController.php | 4 +- .../Controller/StartController.php | 4 +- .../Controller/UsersController.php | 4 +- .../Controller/Backend/StartController.php | 2 +- .../Controller/TemplateprintController.php | 2 +- .../Controller/Backend/IndexController.php | 6 +- .../Frontend/DesignerController.php | 2 +- .../Controller/Frontend/UserController.php | 14 +- .../Controller/Backend/GroupController.php | 20 +- .../Controller/Backend/ListController.php | 12 +- .../Controller/Backend/XmlController.php | 4 +- .../Controller/Json/MotivController.php | 2 +- .../Controller/FastbillController.php | 4 +- .../Controller/Backend/ProductController.php | 8 +- .../Controller/Backend/XmlController.php | 4 +- .../Controller/Backend/SettingsController.php | 2 +- .../Formular/Controller/StartController.php | 2 +- .../Custom/PSC/HPLayouter/Queue/Render.php | 3 +- .../Controller/StartController.php | 6 +- .../Controller/Backend/DesignController.php | 2 +- .../Frontend/DesignerController.php | 2 +- .../Controller/Backend/EditController.php | 8 +- .../Controller/Backend/ListController.php | 6 +- .../Frontend/DesignerController.php | 2 +- .../Controller/Backend/DesignController.php | 4 +- .../Frontend/DesignerController.php | 2 +- .../Controller/Backend/OrderController.php | 6 +- .../Controller/Backend/SendController.php | 4 +- .../ApiController/ConfigController.php | 2 +- .../BackendController/CollectController.php | 4 +- .../BackendController/ConfigController.php | 4 +- .../Controller/OrderController.php | 2 +- .../Controller/SaxoprintController.php | 2 +- .../Controller/Backend/SettingsController.php | 2 +- .../Checkorder/SettingsController.php | 2 +- .../Checkversand/SettingsController.php | 2 +- .../Backend/AttachLayoutToOrderPosition.php | 2 +- .../TemplateprintLayouter/Api/Basket/Add.php | 2 +- .../Controller/Backend/ListController.php | 8 +- .../Controller/Frontend/CreateController.php | 6 +- .../WMD_API/Controller/OrderController.php | 2 +- .../Controller/Backend/ConfigController.php | 4 +- .../PSC/Zaikio/Controller/OrderController.php | 2 +- .../Controller/Backend/StartController.php | 2 +- .../Controller/Backend/StartController.php | 2 +- .../Controller/TemplateprintController.php | 6 +- .../Controller/Backend/SliderController.php | 6 +- .../Controller/Backend/SliderController.php | 6 +- .../Controller/Backend/IndexController.php | 8 +- .../Controller/Backend/OrderController.php | 4 +- .../ApiController/ConfigController.php | 2 +- .../BackendController/ConfigController.php | 4 +- .../Controller/ResellerController.php | 2 +- .../PaypalPlus/Controller/PayController.php | 4 +- .../Backend/CorrectionController.php | 16 +- .../Controller/Backend/PrepressController.php | 12 +- .../Backend/ProductionController.php | 12 +- .../Controller/Backend/ShippingController.php | 134 +- .../System/PSC/XmlCalc/Api/Product/One.php | 2 +- .../System/PSC/XmlCalc/Api/Product/Update.php | 2 +- .../System/PSC/XmlCalc/Api/Shop/One.php | 2 +- .../System/PSC/XmlCalc/Api/Shop/Update.php | 2 +- .../System/PSC/XmlCalc/Api/System/One.php | 2 +- .../System/PSC/XmlCalc/Api/System/Update.php | 2 +- .../Controller/Backend/LiveController.php | 6 +- 231 files changed, 3094 insertions(+), 2155 deletions(-) delete mode 100755 src/new/config/packages/sensio_framework_extra.php create mode 100644 src/new/phpstan.neon create mode 100644 src/new/src/PSC/Libraries/DoctrineBundle/DBAL/Platform/MariaDBPlatform.php diff --git a/.make/05-symfony.mk b/.make/05-symfony.mk index 5bdf78eb2..c47b565ec 100644 --- a/.make/05-symfony.mk +++ b/.make/05-symfony.mk @@ -11,6 +11,6 @@ symfony-init: ## init Symfony $(EXECUTE_IN_APPLICATION_CONTAINER) php "/application/src/new/bin/console" asset-map:compile; $(EXECUTE_IN_APPLICATION_CONTAINER) php "/application/src/new/bin/console" assets:install; -.PHONY: symfony -symfony: ## init Symfony - $(EXECUTE_IN_APPLICATION_CONTAINER) php "/application/src/new/bin/console" ; +.PHONY: php-stan +php-stan: ## init Symfony + $(EXECUTE_IN_APPLICATION_CONTAINER) php "vendor/bin/phpstan" analyse ; diff --git a/src/new/composer.json b/src/new/composer.json index 7518f2152..539adb891 100755 --- a/src/new/composer.json +++ b/src/new/composer.json @@ -114,9 +114,8 @@ "maglnet/composer-require-checker": "4.*", "mockery/mockery": "^1.5", "php-parallel-lint/php-parallel-lint": "dev-develop", - "phpstan/phpstan": "^1", + "phpstan/phpstan": "^2.1", "phpunit/phpunit": "^10", - "rector/rector": "0.19.2", "squizlabs/php_codesniffer": "*", "symfony/browser-kit": "*", "symfony/css-selector": "*", diff --git a/src/new/composer.lock b/src/new/composer.lock index 34d6dba40..0a004336a 100755 --- a/src/new/composer.lock +++ b/src/new/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9bd3881eabd3d4f827c1febe6a7fe16d", + "content-hash": "1f6b464ced8d089a56009a7fa15b2a34", "packages": [ { "name": "apimatic/core", @@ -16334,15 +16334,15 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.32", + "version": "2.1.33", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2770dcdf5078d0b0d53f94317e06affe88419aa8", - "reference": "2770dcdf5078d0b0d53f94317e06affe88419aa8", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9e800e6bee7d5bd02784d4c6069b48032d16224f", + "reference": "9e800e6bee7d5bd02784d4c6069b48032d16224f", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -16383,7 +16383,7 @@ "type": "github" } ], - "time": "2025-09-30T10:16:31+00:00" + "time": "2025-12-05T10:24:31+00:00" }, { "name": "phpunit/php-code-coverage", @@ -16815,62 +16815,6 @@ ], "time": "2025-12-06T07:50:42+00:00" }, - { - "name": "rector/rector", - "version": "0.19.2", - "source": { - "type": "git", - "url": "https://github.com/rectorphp/rector.git", - "reference": "bc96a99895bf47c6bfe70ea1b799f0081ed5a903" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/bc96a99895bf47c6bfe70ea1b799f0081ed5a903", - "reference": "bc96a99895bf47c6bfe70ea1b799f0081ed5a903", - "shasum": "" - }, - "require": { - "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.10.56" - }, - "conflict": { - "rector/rector-doctrine": "*", - "rector/rector-downgrade-php": "*", - "rector/rector-phpunit": "*", - "rector/rector-symfony": "*" - }, - "bin": [ - "bin/rector" - ], - "type": "library", - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Instant Upgrade and Automated Refactoring of any PHP code", - "keywords": [ - "automation", - "dev", - "migration", - "refactoring" - ], - "support": { - "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.19.2" - }, - "funding": [ - { - "url": "https://github.com/tomasvotruba", - "type": "github" - } - ], - "time": "2024-01-19T10:58:30+00:00" - }, { "name": "sebastian/cli-parser", "version": "2.0.1", diff --git a/src/new/config/packages/doctrine.php b/src/new/config/packages/doctrine.php index 73787b715..9dde41b79 100755 --- a/src/new/config/packages/doctrine.php +++ b/src/new/config/packages/doctrine.php @@ -11,6 +11,7 @@ return static function (ContainerConfigurator $containerConfigurator): void { 'url' => '%env(resolve:DATABASE_URL)%', 'charset' => 'utf8mb4', 'default_table_options' => ['collate' => 'utf8mb4_unicode_ci'], + 'server_version' => '8.0', ], 'orm' => [ 'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware', diff --git a/src/new/config/packages/sensio_framework_extra.php b/src/new/config/packages/sensio_framework_extra.php deleted file mode 100755 index a205a5f04..000000000 --- a/src/new/config/packages/sensio_framework_extra.php +++ /dev/null @@ -1,7 +0,0 @@ -getSelectedShop(); - $year1 = date("Y"); - $year2 = date("Y") - 1; - $year3 = date("Y") - 2; - $tempSales1 = array_column($entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop($selectedShop->getUid(), $year1), 'brutto', 'monat'); - $tempSales2 = array_column($entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop($selectedShop->getUid(), $year2), 'brutto', 'monat'); - $tempSales3 = array_column($entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop($selectedShop->getUid(), $year3), 'brutto', 'monat'); + $year1 = date('Y'); + $year2 = date('Y') - 1; + $year3 = date('Y') - 2; + $tempSales1 = array_column( + $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop( + $selectedShop->getUid(), + $year1, + ), + 'brutto', + 'monat', + ); + $tempSales2 = array_column( + $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop( + $selectedShop->getUid(), + $year2, + ), + 'brutto', + 'monat', + ); + $tempSales3 = array_column( + $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop( + $selectedShop->getUid(), + $year3, + ), + 'brutto', + 'monat', + ); $fmt = new \NumberFormatter(locale_get_default(), \NumberFormatter::CURRENCY); - $sales1 = array(); - $sales2 = array(); - $sales3 = array(); + $sales1 = []; + $sales2 = []; + $sales3 = []; for ($i = 1; $i <= 12; $i++) { if (isset($tempSales1[$i])) { $sales1[] = round($tempSales1[$i]); @@ -84,7 +112,20 @@ class DashboardController extends AbstractController } $chart = $chartBuilder->createChart(Chart::TYPE_LINE); $chart->setData([ - 'labels' => ['Januar', 'Februar', 'März', 'April', 'May', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], + 'labels' => [ + 'Januar', + 'Februar', + 'März', + 'April', + 'May', + 'Juni', + 'Juli', + 'August', + 'September', + 'Oktober', + 'November', + 'Dezember', + ], 'datasets' => [ [ 'label' => $year1, @@ -113,19 +154,18 @@ class DashboardController extends AbstractController 'maintainAspectRatio' => false, ]); - if ($migration->checkIfMigrationMustRun()) { return $this->redirectToRoute('psc_system_update_migration_do'); } - return array( + return [ 'user' => $this->getUser(), 'shop' => $selectedShop, 'lastContacts' => $contactRepository->getLastCreatedContacts($selectedShop, 10), 'lastOrders' => $orderService->getLastOrders(), 'queueErrorCount' => $queueService->getErrorJobCount(), 'instance' => $instanceService->getInstance(), - 'chart' => $chart - ); + 'chart' => $chart, + ]; } } diff --git a/src/new/src/PSC/Backend/DashboardBundle/Controller/DefaultController.php b/src/new/src/PSC/Backend/DashboardBundle/Controller/DefaultController.php index 46ab93a65..2ef96b6f1 100755 --- a/src/new/src/PSC/Backend/DashboardBundle/Controller/DefaultController.php +++ b/src/new/src/PSC/Backend/DashboardBundle/Controller/DefaultController.php @@ -16,8 +16,8 @@ namespace PSC\Backend\DashboardBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; /** * DefaultController fürs ProductionBundle @@ -34,7 +34,7 @@ class DefaultController extends AbstractController * @return View */ #[Route(path: '/', name: 'psc_backend_default_index')] - #[Template] + #[Template('@PSCBackendDashboard/default/index.html.twig')] public function indexAction() { return $this->redirect($this->generateUrl("psc_backend_dashboard_index")); diff --git a/src/new/src/PSC/Backend/DashboardBundle/Controller/LoginController.php b/src/new/src/PSC/Backend/DashboardBundle/Controller/LoginController.php index 174c35a8d..60c4d9e2d 100755 --- a/src/new/src/PSC/Backend/DashboardBundle/Controller/LoginController.php +++ b/src/new/src/PSC/Backend/DashboardBundle/Controller/LoginController.php @@ -17,15 +17,15 @@ use Http\Message\Authentication; use PSC\System\UpdateBundle\Service\Migration; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; class LoginController extends AbstractController { #[Route(path: '/login', name: 'psc_backend_login')] - #[Template] + #[Template('@PSCBackendDashboard/login/index.html.twig')] public function indexAction(Migration $migration, AuthenticationUtils $authenticationUtils) { if ($migration->checkIfMigrationMustRun()) { diff --git a/src/new/src/PSC/Backend/DashboardBundle/Controller/ShopController.php b/src/new/src/PSC/Backend/DashboardBundle/Controller/ShopController.php index 4ad55ede4..ad0a0c1e2 100755 --- a/src/new/src/PSC/Backend/DashboardBundle/Controller/ShopController.php +++ b/src/new/src/PSC/Backend/DashboardBundle/Controller/ShopController.php @@ -17,12 +17,12 @@ use Doctrine\ORM\EntityManagerInterface; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; use PSC\Shop\EntityBundle\Entity\Domain; use PSC\System\SettingsBundle\Service\Shop; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; use Symfony\Component\Routing\Attribute\Route; +use Symfony\Component\Security\Http\Attribute\IsGranted; /** * ShopController fürs ProductionBundle @@ -32,47 +32,62 @@ use Symfony\Component\Routing\Attribute\Route; */ class ShopController extends AbstractController { - #[Security("is_granted('ROLE_SHOP')")] - #[Template] - public function myEditableShopsAction(Request $request, Shop $shop, JWTTokenManagerInterface $jwtManager, EntityManagerInterface $entityManager) - { - + #[IsGranted('ROLE_SHOP')] + #[Template('@PSCBackendDashboard/shop/my_editable_shops.html.twig')] + public function myEditableShopsAction( + Request $request, + Shop $shop, + JWTTokenManagerInterface $jwtManager, + EntityManagerInterface $entityManager, + ) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ $selectedShop = $shop->getSelectedShop(); $shops = $shop->getMyEditableShops(); - $domains = $entityManager - ->getRepository(Domain::class)->getAllByShopId($selectedShop); + $domains = $entityManager->getRepository(Domain::class)->getAllByShopId($selectedShop); if (count($domains) > 0) { $domain = array_pop($domains)->getHost(); } else { $domain = false; } - return array('domain' => $domain, 'shops' => $shops, 'jwt' => $jwtManager->create($this->getUser()), 'selectedShop' => $selectedShop, 'displayDeletedShop' => $request->getSession()->get('displayDeletedShop', false)); + return [ + 'domain' => $domain, + 'shops' => $shops, + 'jwt' => $jwtManager->create($this->getUser()), + 'selectedShop' => $selectedShop, + 'displayDeletedShop' => $request->getSession()->get('displayDeletedShop', false), + ]; } - #[Security("is_granted('ROLE_SHOP')")] - #[Template] - public function myEditableShopsTailwindAction(Request $request, Shop $shop, JWTTokenManagerInterface $jwtManager, EntityManagerInterface $entityManager) - { - + #[IsGranted('ROLE_SHOP')] + #[Template('@PSCBackendDashboard/shop/my_editable_shops_tailwind.html.twig')] + public function myEditableShopsTailwindAction( + Request $request, + Shop $shop, + JWTTokenManagerInterface $jwtManager, + EntityManagerInterface $entityManager, + ) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ $selectedShop = $shop->getSelectedShop(); $shops = $shop->getMyEditableShops(); - $domains = $entityManager - ->getRepository(Domain::class)->getAllByShopId($selectedShop); + $domains = $entityManager->getRepository(Domain::class)->getAllByShopId($selectedShop); if (count($domains) > 0) { $domain = array_pop($domains)->getHost(); } else { $domain = false; } - return array('domain' => $domain, 'shops' => $shops, 'jwt' => $jwtManager->create($this->getUser()), 'selectedShop' => $selectedShop, 'displayDeletedShop' => $request->getSession()->get('displayDeletedShop', false)); + return [ + 'domain' => $domain, + 'shops' => $shops, + 'jwt' => $jwtManager->create($this->getUser()), + 'selectedShop' => $selectedShop, + 'displayDeletedShop' => $request->getSession()->get('displayDeletedShop', false), + ]; } - /** * Change Shop * @@ -83,13 +98,18 @@ class ShopController extends AbstractController * @param $shop_uuid * @return RedirectResponse */ - #[Security("is_granted('ROLE_SHOP')")] + #[IsGranted('ROLE_SHOP')] #[Route(path: '/shop/change/{shop_uuid}', name: 'psc_backend_dashboard_shop_change')] - public function changeShopAction(Request $request, EntityManagerInterface $em, \Symfony\Component\Security\Core\Security $security, $shop_uuid) - { - $em - ->getRepository('PSC\Shop\EntityBundle\Entity\ShopContact') - ->changeSelectedShop($security->getUser(), $shop_uuid); + public function changeShopAction( + Request $request, + EntityManagerInterface $em, + \Symfony\Component\Security\Core\Security $security, + $shop_uuid, + ) { + $em->getRepository('PSC\Shop\EntityBundle\Entity\ShopContact')->changeSelectedShop( + $security->getUser(), + $shop_uuid, + ); $request->getSession()->set('selectedShop', $shop_uuid); return $this->redirect($this->generateUrl('psc_backend_dashboard_index')); } @@ -105,15 +125,20 @@ class ShopController extends AbstractController * @return RedirectResponse * @throws \Doctrine\ORM\ORMException */ - #[Security("is_granted('ROLE_SHOP')")] + #[IsGranted('ROLE_SHOP')] #[Route(path: '/shop/deleted/toogle', name: 'psc_backend_dashboard_toogle_deleted_shop')] - public function toogleDisplayDeletedShopAction(Request $request, EntityManagerInterface $em, \Symfony\Component\Security\Core\Security $security, Shop $shopService) - { + public function toogleDisplayDeletedShopAction( + Request $request, + EntityManagerInterface $em, + \Symfony\Component\Security\Core\Security $security, + Shop $shopService, + ) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ $selectedShop = $shopService->getSelectedShop(); if (!!$request->getSession()->get('displayDeletedShop', false) && $selectedShop->isDeleted()) { - $shops = $em - ->getRepository('PSC\Shop\EntityBundle\Entity\ShopContact')->myEditableShopsWithNoDeleted($security->getUser()); + $shops = $em->getRepository( + 'PSC\Shop\EntityBundle\Entity\ShopContact', + )->myEditableShopsWithNoDeleted($security->getUser()); $request->getSession()->set('selectedShop', $shops[0]->getUid()); } $request->getSession()->set('displayDeletedShop', !$request->getSession()->get('displayDeletedShop', false)); diff --git a/src/new/src/PSC/Backend/DomainBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Backend/DomainBundle/Controller/Backend/ListController.php index 1b0193001..e2cd9e173 100755 --- a/src/new/src/PSC/Backend/DomainBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Backend/DomainBundle/Controller/Backend/ListController.php @@ -31,8 +31,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Yaml\Yaml; @@ -65,8 +65,8 @@ class ListController extends \Symfony\Bundle\FrameworkBundle\Controller\Abstract * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/list/index', name: 'psc_backend_domain_list_index')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCBackendDomain/backend/list/index.html.twig')] + #[IsGranted('ROLE_SHOP')] public function indexAction(Request $request, Shop $shopService, DocumentManager $mongoService, EntityManagerInterface $em, DomainSync $sync) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ @@ -101,7 +101,7 @@ class ListController extends \Symfony\Bundle\FrameworkBundle\Controller\Abstract * */ #[Route(path: '/list/sync', name: 'psc_backend_domain_list_sync')] - #[Security("is_granted('ROLE_SHOP')")] + #[IsGranted('ROLE_SHOP')] public function syncAction(DomainSync $sync) { $sync->syncDomains(); @@ -120,7 +120,7 @@ class ListController extends \Symfony\Bundle\FrameworkBundle\Controller\Abstract * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/list/delete/{uid}', name: 'psc_backend_domain_list_delete')] - #[Security("is_granted('ROLE_SHOP')")] + #[IsGranted('ROLE_SHOP')] public function deleteAction(Shop $shopService, EntityManagerInterface $entityManager, DocumentManager $mongoManager, $uid) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ diff --git a/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ExporterController.php b/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ExporterController.php index c61615284..3e396c537 100755 --- a/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ExporterController.php +++ b/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ExporterController.php @@ -5,8 +5,8 @@ namespace PSC\Backend\ToolsBundle\Controller\Backend; use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface; use PSC\Backend\ToolsBundle\Service\ExporterRegistry; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\HttpFoundation\Request; @@ -25,9 +25,9 @@ class ExporterController extends AbstractController * @param ExporterRegistry $registry * @return array */ - #[Template] + #[Template('@PSCBackendTools/backend/exporter/list.html.twig')] #[Route(path: '/list', name: 'psc_backend_tools_exporter_list_index')] - #[Security("is_granted('ROLE_SHOP')")] + #[IsGranted('ROLE_SHOP')] public function listAction(ExporterRegistry $registry) { return array('exporters' => $registry->all()); @@ -41,8 +41,8 @@ class ExporterController extends AbstractController * @return array */ #[Route(path: '/{type}/export', name: 'psc_backend_tools_exporter_form')] - #[Security("is_granted('ROLE_SHOP')")] - #[Template] + #[IsGranted('ROLE_SHOP')] + #[Template('@PSCBackendTools/backend/exporter/form.html.twig')] public function formAction(Request $request, ExporterRegistry $registry, $type) { if (!$registry->has($type)) { diff --git a/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ImporterController.php b/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ImporterController.php index 95717048d..107d7b829 100755 --- a/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ImporterController.php +++ b/src/new/src/PSC/Backend/ToolsBundle/Controller/Backend/ImporterController.php @@ -6,8 +6,8 @@ use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface; use PSC\Backend\ToolsBundle\Service\ImporterRegistry; use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\HttpFoundation\Request; @@ -23,9 +23,9 @@ class ImporterController extends AbstractController dump($importer);die(); } - #[Template] + #[Template('@PSCBackendTools/backend/importer/list.html.twig')] #[Route(path: '/list', name: 'psc_backend_tools_importer_list_index')] - #[Security("is_granted('ROLE_SHOP')")] + #[IsGranted('ROLE_SHOP')] public function listAction(ImporterRegistry $registry) { return array('exporters' => $registry->all()); diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Account/GetParentByTitle.php b/src/new/src/PSC/Component/ApiBundle/Api/Account/GetParentByTitle.php index 962728dc7..ec1515741 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Account/GetParentByTitle.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Account/GetParentByTitle.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class GetParentByTitle extends AbstractController diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Cms/Get.php b/src/new/src/PSC/Component/ApiBundle/Api/Cms/Get.php index 0b3a1e0c8..35df94279 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Cms/Get.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Cms/Get.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; class Get extends AbstractController { diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Plugin/Get.php b/src/new/src/PSC/Component/ApiBundle/Api/Plugin/Get.php index 12721c1e9..cef728620 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Plugin/Get.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Plugin/Get.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; class Get extends AbstractController { diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Shop/Get.php b/src/new/src/PSC/Component/ApiBundle/Api/Shop/Get.php index 61622331e..bd814e332 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Shop/Get.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Shop/Get.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; class Get extends AbstractController { diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/CreateByNr.php b/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/CreateByNr.php index b5a6cc3c4..84872958b 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/CreateByNr.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/CreateByNr.php @@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class CreateByNr extends AbstractController diff --git a/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/GetByNr.php b/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/GetByNr.php index bc3d68265..4a8b75179 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/GetByNr.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/Stockbooking/GetByNr.php @@ -20,7 +20,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class GetByNr extends AbstractController diff --git a/src/new/src/PSC/Component/ApiBundle/Api/System/Info.php b/src/new/src/PSC/Component/ApiBundle/Api/System/Info.php index 57d136908..96a94c20f 100755 --- a/src/new/src/PSC/Component/ApiBundle/Api/System/Info.php +++ b/src/new/src/PSC/Component/ApiBundle/Api/System/Info.php @@ -13,7 +13,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; class Info extends AbstractController { diff --git a/src/new/src/PSC/Component/ConfigurationlayouterBundle/Controller/StoreController.php b/src/new/src/PSC/Component/ConfigurationlayouterBundle/Controller/StoreController.php index a8496050e..1255c7161 100755 --- a/src/new/src/PSC/Component/ConfigurationlayouterBundle/Controller/StoreController.php +++ b/src/new/src/PSC/Component/ConfigurationlayouterBundle/Controller/StoreController.php @@ -27,7 +27,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Translation\Exception\NotFoundResourceException; /** diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hoch.php b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hoch.php index aa71f7952..93ab4dedf 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hoch.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hoch.php @@ -15,8 +15,8 @@ namespace PSC\Component\SteplayouterBundle\Calendar\Type; use PSC\Component\SteplayouterBundle\Calendar\Type; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; /** * DefaultController fürs ProductionBundle diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hochvariable.php b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hochvariable.php index d6e9dd580..0d98a67e8 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hochvariable.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Hochvariable.php @@ -15,8 +15,8 @@ namespace PSC\Component\SteplayouterBundle\Calendar\Type; use PSC\Component\SteplayouterBundle\Calendar\Type; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; class Hochvariable extends Type { diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Quer.php b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Quer.php index d93e3a534..f20740f6b 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Quer.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Calendar/Type/Quer.php @@ -15,8 +15,8 @@ namespace PSC\Component\SteplayouterBundle\Calendar\Type; use PSC\Component\SteplayouterBundle\Calendar\Type; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; /** * DefaultController fürs ProductionBundle diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/CalendarController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/CalendarController.php index a232db975..589e6f291 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/CalendarController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/CalendarController.php @@ -21,8 +21,8 @@ use PSC\Component\SteplayouterBundle\Calendar\Generator; use Symfony\Component\Routing\Annotation\Route; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; /** * CalendarController fürs SteplayouterBundle diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/DefaultController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/DefaultController.php index b834eb33c..61018ab25 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/DefaultController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/DefaultController.php @@ -14,8 +14,8 @@ namespace PSC\Component\SteplayouterBundle\Controller; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; /** @@ -33,7 +33,7 @@ class DefaultController extends AbstractController * @return View */ #[Route(path: '/component/steplayouter', name: 'component_steplayouter')] - #[Template] + #[Template('@PSCComponentSteplayouter/default/index.html.twig')] public function indexAction() { return array('stylePath' => '{{stylePath}}'); diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/PdfController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/PdfController.php index a6fc5c533..7dce7a735 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/PdfController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/PdfController.php @@ -27,7 +27,7 @@ use PSC\Component\SteplayouterBundle\Service\Pdf; use PSC\Shop\EntityBundle\Document\Motiv; use PSC\Shop\EntityBundle\Entity\Layoutdesigndata; use PSC\Shop\EntityBundle\Entity\Product; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/ProductController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/ProductController.php index 9ff64ba0f..a98901a4e 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/ProductController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/ProductController.php @@ -24,7 +24,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Translation\Exception\NotFoundResourceException; use PSC\Component\SteplayouterBundle\Config\Converter\ToArray; diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/StoreController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/StoreController.php index 0f900a553..5c11511ea 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/StoreController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/StoreController.php @@ -26,7 +26,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Translation\Exception\NotFoundResourceException; /** diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/CheckController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/CheckController.php index 8c6228752..8c67912ba 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/CheckController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/CheckController.php @@ -25,8 +25,8 @@ use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -45,8 +45,8 @@ class CheckController extends AbstractController * @return View */ #[Route(path: '/check/index', name: 'psc_component_steplayouter_system_check_index')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCComponentSteplayouter/system/check/index.html.twig')] + #[IsGranted('ROLE_SHOP')] public function indexAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ diff --git a/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/SettingsController.php b/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/SettingsController.php index c1f2793c6..7d433a90e 100755 --- a/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/SettingsController.php +++ b/src/new/src/PSC/Component/SteplayouterBundle/Controller/System/SettingsController.php @@ -25,8 +25,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -49,8 +49,8 @@ class SettingsController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/settings/index', name: 'psc_component_steplayouter_system_settings_index')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCComponentSteplayouter/system/settings/index.html.twig')] + #[IsGranted('ROLE_SHOP')] public function indexAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, DocumentManager $documentManager) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ diff --git a/src/new/src/PSC/Libraries/DoctrineBundle/DBAL/Platform/MariaDBPlatform.php b/src/new/src/PSC/Libraries/DoctrineBundle/DBAL/Platform/MariaDBPlatform.php new file mode 100644 index 000000000..cc307b10d --- /dev/null +++ b/src/new/src/PSC/Libraries/DoctrineBundle/DBAL/Platform/MariaDBPlatform.php @@ -0,0 +1,16 @@ + 0], name: 'psc_shop_communication_backend_order_mail')] - #[Template] + #[Template('@PSCShopCommunication/backend/order/mail.html.twig')] public function mailAction(Request $request, SessionInterface $session, Manager $eventManager, Shop $shopService, DocumentManager $documentManager, Environment $twig, EntityManagerInterface $entityManager, $uuid = "") { diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/Address/Crud.php b/src/new/src/PSC/Shop/ContactBundle/Api/Address/Crud.php index d97d6c998..cb4e64989 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/Address/Crud.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/Address/Crud.php @@ -8,7 +8,7 @@ use PSC\Shop\ContactBundle\Dto\Address\Create\Input; use PSC\Shop\ContactBundle\Dto\Address\Create\Output; use PSC\Shop\ContactBundle\Repository\AddressRepository; use PSC\Shop\ContactBundle\Transformer\Model\Address; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/Address/GetAllForType.php b/src/new/src/PSC/Shop/ContactBundle/Api/Address/GetAllForType.php index 24ac15812..4b655504c 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/Address/GetAllForType.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/Address/GetAllForType.php @@ -10,7 +10,7 @@ use PSC\Shop\ContactBundle\Model\Address; use PSC\Shop\EntityBundle\Entity\Contact; use PSC\Shop\EntityBundle\Entity\ContactAddress; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/All.php b/src/new/src/PSC/Shop/ContactBundle/Api/All.php index 9dc5a5638..55f942df2 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/All.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/All.php @@ -9,7 +9,7 @@ use Nelmio\ApiDocBundle\Annotation\Model; use PSC\Shop\ContactBundle\Dto\All\Output; use PSC\Shop\ContactBundle\Model\Contact; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/AllByShop.php b/src/new/src/PSC/Shop/ContactBundle/Api/AllByShop.php index 931969574..e1f8fda17 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/AllByShop.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/AllByShop.php @@ -10,7 +10,7 @@ use Nelmio\ApiDocBundle\Annotation\Security; use PSC\Shop\ContactBundle\Dto\All\Output; use PSC\Shop\ContactBundle\Model\Contact; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/Crud.php b/src/new/src/PSC/Shop/ContactBundle/Api/Crud.php index 62dc63d87..b27e58fd9 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/Crud.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/Crud.php @@ -8,7 +8,7 @@ use Nelmio\ApiDocBundle\Annotation\Security; use PSC\Shop\ContactBundle\Dto\Create\Input; use PSC\Shop\ContactBundle\Dto\Create\Output; use PSC\Shop\ContactBundle\Repository\ContactRepository; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use setasign\Fpdi\PdfReader\DataStructure\Rectangle; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/Exists.php b/src/new/src/PSC/Shop/ContactBundle/Api/Exists.php index 47131ccac..6126bfce3 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/Exists.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/Exists.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class Exists extends AbstractController diff --git a/src/new/src/PSC/Shop/ContactBundle/Api/Refresh.php b/src/new/src/PSC/Shop/ContactBundle/Api/Refresh.php index e880d8b28..47c4feb07 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Api/Refresh.php +++ b/src/new/src/PSC/Shop/ContactBundle/Api/Refresh.php @@ -8,7 +8,7 @@ use PSC\Shop\ContactBundle\Dto\Refresh\Output; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; use OpenApi\Attributes as OA; diff --git a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressDetailController.php b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressDetailController.php index 915161e2b..56dd47b2c 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressDetailController.php +++ b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressDetailController.php @@ -16,7 +16,7 @@ use PSC\System\SettingsBundle\Service\Log; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\HttpFoundation\Request; class AddressDetailController extends AbstractController @@ -44,7 +44,7 @@ class AddressDetailController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/address/detail/edit/{uuid}', name: 'psc_shop_contact_backend_address_detail_edit')] - #[Template] + #[Template('@PSCShopContact/backend/addressdetail/edit.html.twig')] public function editAction( Request $request, EntityManagerInterface $entityManager, @@ -129,7 +129,7 @@ class AddressDetailController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/address/detail/create/{contactUUID}', name: 'psc_shop_contact_backend_address_detail_create')] - #[Template] + #[Template('@PSCShopContact/backend/addressdetail/create.html.twig')] public function createAction( Request $request, EntityManagerInterface $entityManager, @@ -192,7 +192,7 @@ class AddressDetailController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/edit/delete/{uuid}', name: 'psc_shop_contact_backend_address_detail_delete')] - #[Template] + #[Template('@PSCShopContact/backend/addressdetail/delete.html.twig')] public function deleteAction( Request $request, EntityManagerInterface $entityManager, diff --git a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressImportController.php b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressImportController.php index c7a18cedd..40d7fed0d 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressImportController.php +++ b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/AddressImportController.php @@ -34,8 +34,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -58,7 +58,7 @@ class AddressImportController extends AbstractController * @throws \PhpOffice\PhpSpreadsheet\Reader\Exception */ #[Route(path: '/address/import/step1/{uuid}', name: 'psc_shop_contact_backend_address_import_step1')] - #[Template] + #[Template('@PSCShopContact/backend/addressimport/step1.html.twig')] public function step1Action( Request $request, EntityManagerInterface $entityManager, @@ -111,7 +111,7 @@ class AddressImportController extends AbstractController * @return array|View|\Symfony\Component\HttpFoundation\RedirectResponse */ #[Route(path: '/address/import/step2/{uuid}', name: 'psc_shop_contact_backend_address_import_step2')] - #[Template] + #[Template('@PSCShopContact/backend/addressimport/step2.html.twig')] public function step2Action( Request $request, EntityManagerInterface $entityManager, @@ -151,7 +151,7 @@ class AddressImportController extends AbstractController * @throws \PhpOffice\PhpSpreadsheet\Reader\Exception */ #[Route(path: '/address/import/step3/{uuid}', name: 'psc_shop_contact_backend_address_import_step3')] - #[Template] + #[Template('@PSCShopContact/backend/addressimport/step3.html.twig')] public function step3Action( Request $request, EntityManagerInterface $entityManager, diff --git a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/EditController.php index f59feb870..ec2ac9125 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/EditController.php @@ -45,8 +45,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; use PSC\System\SettingsBundle\Service\Status; @@ -94,7 +94,7 @@ class EditController extends AbstractController } #[Route(path: '/edit/create', name: 'psc_shop_contact_backend_create')] - #[Template] + #[Template('@PSCShopContact/backend/edit/create.html.twig')] public function createAction( Request $request, Field $fieldService, @@ -229,7 +229,7 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/edit/edit/{uuid}', name: 'psc_shop_contact_backend_edit')] - #[Template] + #[Template('@PSCShopContact/backend/edit/edit.html.twig')] public function editAction( Request $request, Field $fieldService, @@ -506,7 +506,7 @@ class EditController extends AbstractController * @return array|\Symfony\Component\HttpFoundation\RedirectResponse */ #[Route(path: '/edit/anonymisieren/{uuid}', name: 'psc_shop_contact_backend_edit_anonymisieren')] - #[Template] + #[Template('@PSCShopContact/backend/edit/anonymisieren.html.twig')] public function anonymisierenAction( Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, diff --git a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/ListController.php index 0c23c9406..e222cf268 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/ContactBundle/Controller/Backend/ListController.php @@ -22,8 +22,8 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -41,9 +41,9 @@ class ListController extends AbstractController * * @return array */ - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] #[Route(path: '/list/index', name: 'psc_shop_contact_backend_list')] - #[Template] + #[Template('@PSCShopContact/backend/list/index.html.twig')] public function indexAction( Request $request, RequestStack $requestStack, diff --git a/src/new/src/PSC/Shop/ContactBundle/Repository/ContactRepository.php b/src/new/src/PSC/Shop/ContactBundle/Repository/ContactRepository.php index 2b8f67d63..8f3a47ca6 100755 --- a/src/new/src/PSC/Shop/ContactBundle/Repository/ContactRepository.php +++ b/src/new/src/PSC/Shop/ContactBundle/Repository/ContactRepository.php @@ -26,11 +26,13 @@ use Symfony\Component\Security\Core\User\UserInterface; class ContactRepository extends ServiceEntityRepository implements UserLoaderInterface { - public function __construct(ManagerRegistry $registry, private readonly \PSC\System\SettingsBundle\Service\Shop $shopService) - { + public function __construct( + ManagerRegistry $registry, + private readonly \PSC\System\SettingsBundle\Service\Shop $shopService, + ) { parent::__construct($registry, Contact::class); } - + public function loadUserByUid($uuid) { $user = $this->createQueryBuilder('c') @@ -54,7 +56,7 @@ class ContactRepository extends ServiceEntityRepository implements UserLoaderInt ->getQuery() ->getOneOrNullResult(); - if(null === $user) { + if (null === $user) { $user = $this->loadUserByUid($username); } if (null === $user) { @@ -77,10 +79,13 @@ class ContactRepository extends ServiceEntityRepository implements UserLoaderInt public function getContactByEmailAndPasswordAndShop($mail, $password, $shopId) { $query = $this->getEntityManager() - ->createQuery(' + ->createQuery( + ' SELECT s FROM PSC\Shop\EntityBundle\Entity\ShopContact s JOIN s.contact c - WHERE c.enable = 1 AND c.username = :username AND c.password = :password AND s.shop = :shop_id')->setParameter('username', $mail) + WHERE c.enable = 1 AND c.username = :username AND c.password = :password AND s.shop = :shop_id', + ) + ->setParameter('username', $mail) ->setParameter('password', $password) ->setParameter('shop_id', $shopId); try { @@ -104,7 +109,8 @@ class ContactRepository extends ServiceEntityRepository implements UserLoaderInt ->createQuery(' SELECT s FROM PSC\Shop\EntityBundle\Entity\ShopContact s JOIN s.contact c - WHERE c.enable = 1 AND c.username = :username AND s.shop = :shop_id')->setParameter('username', $mail) + WHERE c.enable = 1 AND c.username = :username AND s.shop = :shop_id') + ->setParameter('username', $mail) ->setParameter('shop_id', $shopId); try { return $query->getSingleResult(); @@ -123,11 +129,12 @@ class ContactRepository extends ServiceEntityRepository implements UserLoaderInt */ public function getContactsByShop(PSCShop $shop) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT s FROM PSCEntityBundle:ShopContact s + $query = $this->getEntityManager()->createQuery( + ' + SELECT s FROM PSC\Shop\EntityBundle\Entity\ShopContact s JOIN s.contact c - WHERE c.enable = 1 AND s.shop = :shop_id')->setParameter('shop_id', $shop->getId()); + WHERE c.enable = 1 AND s.shop = :shop_id', + )->setParameter('shop_id', $shop->getId()); try { return $query->getResult(); } catch (\Doctrine\ORM\NoResultException $e) { @@ -135,15 +142,14 @@ class ContactRepository extends ServiceEntityRepository implements UserLoaderInt } } - - public function mySelectedShop(Contact $contact) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT sc FROM PSCEntityBundle:ShopContact sc + $query = $this->getEntityManager()->createQuery( + ' + SELECT sc FROM PSC\Shop\EntityBundle\Entity\ShopContact sc JOIN sc.shop s - WHERE sc.contact = :id AND sc.selected = 1 ORDER BY sc.admin ASC, s.title ASC')->setParameter('id', $contact->getId()); + WHERE sc.contact = :id AND sc.selected = 1 ORDER BY sc.admin ASC, s.title ASC', + )->setParameter('id', $contact->getId()); try { $shop = $query->getOneOrNullResult(); } catch (\Doctrine\ORM\NoResultException $e) { @@ -153,18 +159,20 @@ class ContactRepository extends ServiceEntityRepository implements UserLoaderInt if (!$shop) { $query = $this->getEntityManager() ->createQuery(' - SELECT sc FROM PSCEntityBundle:ShopContact sc + SELECT sc FROM PSC\Shop\EntityBundle\Entity\ShopContact sc JOIN sc.shop s - WHERE sc.contact = :id ORDER BY sc.admin ASC, s.title ASC')->setParameter('id', $contact->getId()) + WHERE sc.contact = :id ORDER BY sc.admin ASC, s.title ASC') + ->setParameter('id', $contact->getId()) ->setMaxResults(1); $shop = $query->getOneOrNullResult(); if ($shop) { $this->getEntityManager() ->createQuery(' - UPDATE PSCEntityBundle:ShopContact sc SET sc.selected=1 - WHERE sc.contact = :id AND sc.shop = :shop_id')->setParameter('id', $contact->getId()) - ->setParameter('shop_id', $shop->getShop()->getUid()) - ->execute(); + UPDATE PSC\Shop\EntityBundle\Entity\ShopContact sc SET sc.selected=1 + WHERE sc.contact = :id AND sc.shop = :shop_id') + ->setParameter('id', $contact->getId()) + ->setParameter('shop_id', $shop->getShop()->getUid()) + ->execute(); return $shop->getShop(); } } @@ -172,14 +180,14 @@ class ContactRepository extends ServiceEntityRepository implements UserLoaderInt return $shop->getShop(); } - public function loadUserByIdentifier(string $identifier): ?UserInterface + public function loadUserByIdentifier(string $identifier): null|UserInterface { - $shop = $this->shopService->getShopByDomain(); - $user = $this->getEntityManager() - ->getRepository(Contact::class) - ->getContactByEmailAndShop($identifier, $shop->getUid()); + $user = $this->getEntityManager()->getRepository(Contact::class)->getContactByEmailAndShop( + $identifier, + $shop->getUid(), + ); if (!$user) { // fail authentication with a custom error @@ -190,12 +198,12 @@ class ContactRepository extends ServiceEntityRepository implements UserLoaderInt return $user; } + public function getLastCreatedContacts(PSCShop $selectedShop, int $limit): array { - $query = $this->getEntityManager() ->createQuery(' - SELECT c FROM PSCEntityBundle:Contact c + SELECT c FROM PSC\Shop\EntityBundle\Entity\Contact c JOIN c.shops s WHERE s.uid = :id ORDER BY c.createdAt DESC') ->setParameter('id', $selectedShop->getUid()) diff --git a/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/CopyController.php b/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/CopyController.php index 32d79a5f3..28953d6e8 100755 --- a/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/CopyController.php +++ b/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/CopyController.php @@ -23,8 +23,8 @@ use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\System\SettingsBundle\Service\Shop; use Ramsey\Uuid\Uuid; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\Request; @@ -39,9 +39,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; #[Route(path: '/create/copy')] class CopyController extends AbstractController { - #[Template] + #[Template('@PSCShopCreate/backend/copy/index.html.twig')] #[Route(path: '/index', name: 'psc_shop_create_backend_copy_index')] - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] public function indexAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, DocumentManager $documentManager, Registry $registrys) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ diff --git a/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/StartController.php b/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/StartController.php index 213d95df1..1a491725c 100755 --- a/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/StartController.php +++ b/src/new/src/PSC/Shop/CreateBundle/Controller/Backend/StartController.php @@ -15,8 +15,8 @@ use PSC\Shop\EntityBundle\Entity\ShopAccount; use PSC\Shop\EntityBundle\Entity\ShopContact; use Ramsey\Uuid\Uuid; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\Request; @@ -31,9 +31,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; #[Route(path: '/start')] class StartController extends AbstractController { - #[Template] + #[Template('@PSCShopCreate/backend/start/index.html.twig')] #[Route(path: '/index', name: 'psc_shop_create_backend_start_index')] - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] public function indexAction( Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, diff --git a/src/new/src/PSC/Shop/EntityBundle/Repository/AccountRepository.php b/src/new/src/PSC/Shop/EntityBundle/Repository/AccountRepository.php index 968da5ddf..d4e834e8a 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Repository/AccountRepository.php +++ b/src/new/src/PSC/Shop/EntityBundle/Repository/AccountRepository.php @@ -23,7 +23,7 @@ class AccountRepository extends ServiceEntityRepository public function getAccountsByShop(Shop $shop) { $query = $this->getEntityManager()->createQuery(' - SELECT s FROM PSCEntityBundle:ShopAccount s + SELECT s FROM PSC\Shop\EntityBundle\Entity\ShopAccount s JOIN s.account a WHERE s.shop = :shop_id')->setParameter( 'shop_id', diff --git a/src/new/src/PSC/Shop/EntityBundle/Repository/CmsRepository.php b/src/new/src/PSC/Shop/EntityBundle/Repository/CmsRepository.php index 01b2a0a87..df3118ebd 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Repository/CmsRepository.php +++ b/src/new/src/PSC/Shop/EntityBundle/Repository/CmsRepository.php @@ -28,10 +28,12 @@ class CmsRepository extends EntityRepository { public function findAllByShop(Shop $shop) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT c FROM PSCEntityBundle:Cms c - WHERE c.shop = :shop_id')->setParameter('shop_id', $shop->getId()); + $query = $this->getEntityManager()->createQuery(' + SELECT c FROM PSC\Shop\EntityBundle\Entity\Cms c + WHERE c.shop = :shop_id')->setParameter( + 'shop_id', + $shop->getId(), + ); try { return $query->execute(); } catch (\Doctrine\ORM\NoResultException $e) { diff --git a/src/new/src/PSC/Shop/EntityBundle/Repository/DomainRepository.php b/src/new/src/PSC/Shop/EntityBundle/Repository/DomainRepository.php index 80938337b..9fbe45acd 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Repository/DomainRepository.php +++ b/src/new/src/PSC/Shop/EntityBundle/Repository/DomainRepository.php @@ -37,10 +37,12 @@ class DomainRepository extends EntityRepository */ public function getAllByShopId(Shop $shop) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT p FROM PSCEntityBundle:Domain p - WHERE p.shop = :shop_id')->setParameter('shop_id', $shop->getId()); + $query = $this->getEntityManager()->createQuery(' + SELECT p FROM PSC\Shop\EntityBundle\Entity\Domain p + WHERE p.shop = :shop_id')->setParameter( + 'shop_id', + $shop->getId(), + ); try { return $query->execute(); } catch (\Doctrine\ORM\NoResultException $e) { diff --git a/src/new/src/PSC/Shop/EntityBundle/Repository/MotivRepository.php b/src/new/src/PSC/Shop/EntityBundle/Repository/MotivRepository.php index 5d2f2f58a..88fee171f 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Repository/MotivRepository.php +++ b/src/new/src/PSC/Shop/EntityBundle/Repository/MotivRepository.php @@ -40,7 +40,7 @@ class MotivRepository extends EntityRepository { $query = $this->getEntityManager() ->createQuery(' - SELECT m FROM PSCEntityBundle:Motiv m + SELECT m FROM PSC\Shop\EntityBundle\Entity\Motiv m JOIN m.shop s WHERE m.resale_shop = 1 AND s.uuid = :shop_uuid') ->setParameter('shop_uuid', $shopUuId) @@ -62,12 +62,12 @@ class MotivRepository extends EntityRepository */ public function countMotiveByShopUuid($shopUuId) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT count(m.uuid) FROM PSCEntityBundle:Motiv m + $query = $this->getEntityManager()->createQuery( + ' + SELECT count(m.uuid) FROM PSC\Shop\EntityBundle\Entity\Motiv m JOIN m.shop s - WHERE m.resale_shop = 1 AND s.uuid = :shop_uuid') - ->setParameter('shop_uuid', $shopUuId); + WHERE m.resale_shop = 1 AND s.uuid = :shop_uuid', + )->setParameter('shop_uuid', $shopUuId); try { return $query->getSingleScalarResult(); } catch (\Doctrine\ORM\NoResultException $e) { @@ -89,7 +89,7 @@ class MotivRepository extends EntityRepository { $query = $this->getEntityManager() ->createQuery(' - SELECT m FROM PSCEntityBundle:Motiv m + SELECT m FROM PSC\Shop\EntityBundle\Entity\Motiv m JOIN m.shop s WHERE s.uuid = :shop_uuid AND m.contact = :contact') diff --git a/src/new/src/PSC/Shop/EntityBundle/Repository/OrderRepository.php b/src/new/src/PSC/Shop/EntityBundle/Repository/OrderRepository.php index 0d1cf92ef..8d4adb783 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Repository/OrderRepository.php +++ b/src/new/src/PSC/Shop/EntityBundle/Repository/OrderRepository.php @@ -36,13 +36,15 @@ class OrderRepository extends ServiceEntityRepository public function getIncomeByShop($shopUuId, $year) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT sum(o.brutto) as brutto, MONTH(o.created) as monat FROM PSCEntityBundle:Order o + $query = $this->getEntityManager()->createQuery(' + SELECT sum(o.brutto) as brutto, MONTH(o.created) as monat FROM PSC\Shop\EntityBundle\Entity\Order o JOIN o.shop s - WHERE o.status <> 170 AND s.uid = :shop_uuid AND o.type = 1 AND o.created >= \'' . $year . '-01-01\' AND o.created <= \'' . $year . '-12-31\' - GROUP BY monat ORDER BY o.created ASC') - ->setParameter('shop_uuid', $shopUuId); + WHERE o.status <> 170 AND s.uid = :shop_uuid AND o.type = 1 AND o.created >= \'' . + $year . + '-01-01\' AND o.created <= \'' . + $year . + '-12-31\' + GROUP BY monat ORDER BY o.created ASC')->setParameter('shop_uuid', $shopUuId); try { return $query->getArrayResult(); } catch (\Doctrine\ORM\NoResultException $e) { @@ -52,10 +54,10 @@ class OrderRepository extends ServiceEntityRepository public function getLastEntity() { - return $this->createQueryBuilder('o')-> - orderBy('o.created', 'DESC')-> - setMaxResults(1)-> - getQuery()-> - getOneOrNullResult(); + return $this->createQueryBuilder('o') + ->orderBy('o.created', 'DESC') + ->setMaxResults(1) + ->getQuery() + ->getOneOrNullResult(); } } diff --git a/src/new/src/PSC/Shop/EntityBundle/Repository/ProductProductgroupRepository.php b/src/new/src/PSC/Shop/EntityBundle/Repository/ProductProductgroupRepository.php index ff6ecb4d6..1126ebc47 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Repository/ProductProductgroupRepository.php +++ b/src/new/src/PSC/Shop/EntityBundle/Repository/ProductProductgroupRepository.php @@ -37,7 +37,9 @@ class ProductProductgroupRepository extends EntityRepository { $this->getEntityManager() ->createQuery(' - DELETE FROM PSCEntityBundle:ProductProductgroup p - WHERE p.product = :product_id')->setParameter('product_id', $productId)->execute(); + DELETE FROM PSC\Shop\EntityBundle\Entity\ProductProductgroup p + WHERE p.product = :product_id') + ->setParameter('product_id', $productId) + ->execute(); } } diff --git a/src/new/src/PSC/Shop/EntityBundle/Repository/ProductRepository.php b/src/new/src/PSC/Shop/EntityBundle/Repository/ProductRepository.php index d3d67ed03..6e14ec4e6 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Repository/ProductRepository.php +++ b/src/new/src/PSC/Shop/EntityBundle/Repository/ProductRepository.php @@ -33,6 +33,7 @@ class ProductRepository extends ServiceEntityRepository { parent::__construct($registry, Product::class); } + /** * Gibt alle Produkte zurück; * @@ -46,26 +47,27 @@ class ProductRepository extends ServiceEntityRepository */ public function getAllByShopIdWithPagination($shopId, $start, $limit, $sort, $filters) { - $sortTemp = ""; - $clauses = array(); + $sortTemp = ''; + $clauses = []; if (!empty($sort)) { - $sortTemp = " ORDER BY"; + $sortTemp = ' ORDER BY'; foreach ($sort as $field) { $sortTemp .= ' p.' . $field['property'] . ' ' . $field['direction']; } } foreach ($filters as $filter) { - $clauses[] = "p." . $filter['expression'] . ' ' . $filter['value']; + $clauses[] = 'p.' . $filter['expression'] . ' ' . $filter['value']; } if (count($clauses) > 0) { - $sortTemp = " AND " . implode(' AND ', $clauses) . $sortTemp; + $sortTemp = ' AND ' . implode(' AND ', $clauses) . $sortTemp; } $query = $this->getEntityManager() ->createQuery(' - SELECT p FROM PSCEntityBundle:Product p - WHERE p.shop = :shop_id' . $sortTemp)->setParameter('shop_id', $shopId) + SELECT p FROM PSC\Shop\EntityBundle\Entity\Product p + WHERE p.shop = :shop_id' . $sortTemp) + ->setParameter('shop_id', $shopId) ->setMaxResults($limit) ->setFirstResult($start); try { @@ -84,10 +86,12 @@ class ProductRepository extends ServiceEntityRepository */ public function getAllByShopId($shopId) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT p FROM PSCEntityBundle:Product p - WHERE p.shop = :shop_id')->setParameter('shop_id', $shopId); + $query = $this->getEntityManager()->createQuery(' + SELECT p FROM PSC\Shop\EntityBundle\Entity\Product p + WHERE p.shop = :shop_id')->setParameter( + 'shop_id', + $shopId, + ); try { return count($query->execute()); } catch (\Doctrine\ORM\NoResultException $e) { @@ -104,18 +108,19 @@ class ProductRepository extends ServiceEntityRepository */ public function getAllByProductgroup(Productgroup $group, $json) { - $query = 'SELECT p FROM PSCEntityBundle:Product p + $query = 'SELECT p FROM PSC\Shop\EntityBundle\Entity\Product p JOIN p.product_groups c WHERE c.uid = :articlegroup_id AND p.enable = 1 AND p.private = 0'; if (isset($json['upload_steplayouter2'])) { $query .= ' AND p.uploadSteplayouter2 = :upload_steplayouter2'; } - $query = $this->getEntityManager() - ->createQuery($query . ' ORDER BY p.pos ASC') - ->setParameter('articlegroup_id', $group->getUid()); + $query = $this->getEntityManager()->createQuery($query . ' ORDER BY p.pos ASC')->setParameter( + 'articlegroup_id', + $group->getUid(), + ); if (isset($json['upload_steplayouter2'])) { - $query = $query->setParameter("upload_steplayouter2", $json['upload_steplayouter2']); + $query = $query->setParameter('upload_steplayouter2', $json['upload_steplayouter2']); } try { @@ -127,10 +132,9 @@ class ProductRepository extends ServiceEntityRepository public function updateTaxes($shop, $from, $to) { - $this->getEntityManager() ->createQuery(' - UPDATE PSCEntityBundle:Product p SET p.mwert=:to + UPDATE PSC\Shop\EntityBundle\Entity\Product p SET p.mwert=:to WHERE p.mwert = :from AND p.shop = :shop_id') ->setParameter('from', $from) ->setParameter('to', $to) diff --git a/src/new/src/PSC/Shop/EntityBundle/Repository/ProductgroupRepository.php b/src/new/src/PSC/Shop/EntityBundle/Repository/ProductgroupRepository.php index 69b78c6b8..c7425a34a 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Repository/ProductgroupRepository.php +++ b/src/new/src/PSC/Shop/EntityBundle/Repository/ProductgroupRepository.php @@ -36,10 +36,12 @@ class ProductgroupRepository extends EntityRepository */ public function getAllByShopId($shopId) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT p FROM PSCEntityBundle:Productgroup p - WHERE p.shop = :shop_id')->setParameter('shop_id', $shopId); + $query = $this->getEntityManager()->createQuery(' + SELECT p FROM PSC\Shop\EntityBundle\Entity\Productgroup p + WHERE p.shop = :shop_id')->setParameter( + 'shop_id', + $shopId, + ); try { return $query->getArrayResult(); } catch (\Doctrine\ORM\NoResultException $e) { @@ -57,19 +59,21 @@ class ProductgroupRepository extends EntityRepository */ public function getAllByShopAndParent(Shop $shop, $parent, $enabled = null) { - - if($parent === 0) { + if ($parent === 0) { + $query = $this->getEntityManager()->createQuery( + ' + SELECT p FROM PSC\Shop\EntityBundle\Entity\Productgroup p + WHERE p.shop = :shop_id AND (p.parent = 0 OR p.parent IS NULL) AND p.enable in (:enabled) ORDER BY p.pos ASC', + )->setParameter('shop_id', $shop->getId()); + } else { $query = $this->getEntityManager() - ->createQuery(' - SELECT p FROM PSCEntityBundle:Productgroup p - WHERE p.shop = :shop_id AND (p.parent = 0 OR p.parent IS NULL) AND p.enable in (:enabled) ORDER BY p.pos ASC')->setParameter('shop_id', $shop->getId()); - - }else{ - $query = $this->getEntityManager() - ->createQuery(' - SELECT p FROM PSCEntityBundle:Productgroup p - WHERE p.shop = :shop_id AND p.parent = :parent AND p.enable in (:enabled) ORDER BY p.pos ASC')->setParameter('shop_id', $shop->getId())->setParameter('parent', $parent); - + ->createQuery( + ' + SELECT p FROM PSC\Shop\EntityBundle\Entity\Productgroup p + WHERE p.shop = :shop_id AND p.parent = :parent AND p.enable in (:enabled) ORDER BY p.pos ASC', + ) + ->setParameter('shop_id', $shop->getId()) + ->setParameter('parent', $parent); } if ($enabled == null) { diff --git a/src/new/src/PSC/Shop/EntityBundle/Repository/ShopContactRepository.php b/src/new/src/PSC/Shop/EntityBundle/Repository/ShopContactRepository.php index 50e9c019c..739eafc70 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Repository/ShopContactRepository.php +++ b/src/new/src/PSC/Shop/EntityBundle/Repository/ShopContactRepository.php @@ -42,11 +42,12 @@ class ShopContactRepository extends EntityRepository public function myEditableShops(Contact $contact) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT sc FROM PSCEntityBundle:ShopContact sc + $query = $this->getEntityManager()->createQuery( + ' + SELECT sc FROM PSC\Shop\EntityBundle\Entity\ShopContact sc JOIN sc.shop s - WHERE sc.contact = :id AND sc.admin = 1 ORDER BY sc.admin ASC, s.title ASC')->setParameter('id', $contact->getId()); + WHERE sc.contact = :id AND sc.admin = 1 ORDER BY sc.admin ASC, s.title ASC', + )->setParameter('id', $contact->getId()); try { $result = $query->execute(); $tmpCollection = new ArrayCollection(); @@ -61,11 +62,12 @@ class ShopContactRepository extends EntityRepository public function myEditableShopsWithNoDeleted(Contact $contact) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT sc FROM PSCEntityBundle:ShopContact sc + $query = $this->getEntityManager()->createQuery( + ' + SELECT sc FROM PSC\Shop\EntityBundle\Entity\ShopContact sc JOIN sc.shop s - WHERE sc.contact = :id AND s.deleted = 0 AND sc.admin = 1 ORDER BY sc.admin ASC, s.title ASC')->setParameter('id', $contact->getId()); + WHERE sc.contact = :id AND s.deleted = 0 AND sc.admin = 1 ORDER BY sc.admin ASC, s.title ASC', + )->setParameter('id', $contact->getId()); try { $result = $query->execute(); $tmpCollection = new ArrayCollection(); @@ -82,15 +84,19 @@ class ShopContactRepository extends EntityRepository { $this->getEntityManager() ->createQuery(' - UPDATE PSCEntityBundle:ShopContact sc + UPDATE PSC\Shop\EntityBundle\Entity\ShopContact sc SET sc.selected = 0 - WHERE sc.contact = :id AND sc.selected = 1')->setParameter('id', $contact->getId())->execute(); + WHERE sc.contact = :id AND sc.selected = 1') + ->setParameter('id', $contact->getId()) + ->execute(); $this->getEntityManager() ->createQuery(' - UPDATE PSCEntityBundle:ShopContact sc + UPDATE PSC\Shop\EntityBundle\Entity\ShopContact sc SET sc.selected = 1 - WHERE sc.contact = :id AND sc.shop = :shop_id')->setParameter('id', $contact->getId()) - ->setParameter('shop_id', $shop_uuid)->execute(); + WHERE sc.contact = :id AND sc.shop = :shop_id') + ->setParameter('id', $contact->getId()) + ->setParameter('shop_id', $shop_uuid) + ->execute(); } public function updateAdmin($contactId, $shopId, $admin = true) @@ -102,7 +108,8 @@ class ShopContactRepository extends EntityRepository ->where('sc.contact = ?2 and sc.shop = ?3') ->setParameter(2, $contactId) ->setParameter(3, $shopId) - ->getQuery()->execute(); + ->getQuery() + ->execute(); } public function resetAdmin($contactId, $admin = true) @@ -113,6 +120,7 @@ class ShopContactRepository extends EntityRepository ->setParameter(1, $admin) ->where('sc.contact = ?2') ->setParameter(2, $contactId) - ->getQuery()->execute(); + ->getQuery() + ->execute(); } } diff --git a/src/new/src/PSC/Shop/EntityBundle/Repository/StockbookingRepository.php b/src/new/src/PSC/Shop/EntityBundle/Repository/StockbookingRepository.php index 221c445f6..e3d144c7f 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Repository/StockbookingRepository.php +++ b/src/new/src/PSC/Shop/EntityBundle/Repository/StockbookingRepository.php @@ -39,26 +39,27 @@ class StockbookingRepository extends EntityRepository */ public function getAllByProductId($productId, $start, $limit, $sort, $filters) { - $sortTemp = ""; - $clauses = array(); + $sortTemp = ''; + $clauses = []; if (!empty($sort)) { - $sortTemp = " ORDER BY"; + $sortTemp = ' ORDER BY'; foreach ($sort as $field) { $sortTemp .= ' s.' . $field['property'] . ' ' . $field['direction']; } } foreach ($filters as $filter) { - $clauses[] = "s." . $filter['expression'] . ' ' . $filter['value']; + $clauses[] = 's.' . $filter['expression'] . ' ' . $filter['value']; } if (count($clauses) > 0) { - $sortTemp = " AND " . implode(' AND ', $clauses) . $sortTemp; + $sortTemp = ' AND ' . implode(' AND ', $clauses) . $sortTemp; } $query = $this->getEntityManager() ->createQuery(' - SELECT s FROM PSCEntityBundle:Stockbooking s - WHERE s.product = :product' . $sortTemp)->setParameter('product', $productId) + SELECT s FROM PSC\Shop\EntityBundle\Entity\Stockbooking s + WHERE s.product = :product' . $sortTemp) + ->setParameter('product', $productId) ->setMaxResults($limit) ->setFirstResult($start); try { @@ -77,10 +78,12 @@ class StockbookingRepository extends EntityRepository */ public function getCountByProductId($productId) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT s FROM PSCEntityBundle:Stockbooking s - WHERE s.product = :product')->setParameter('product', $productId); + $query = $this->getEntityManager()->createQuery(' + SELECT s FROM PSC\Shop\EntityBundle\Entity\Stockbooking s + WHERE s.product = :product')->setParameter( + 'product', + $productId, + ); try { return count($query->execute()); } catch (\Doctrine\ORM\NoResultException $e) { diff --git a/src/new/src/PSC/Shop/MediaBundle/Api/UploadVariant.php b/src/new/src/PSC/Shop/MediaBundle/Api/UploadVariant.php index c5e6ec4c7..30a98c3fb 100644 --- a/src/new/src/PSC/Shop/MediaBundle/Api/UploadVariant.php +++ b/src/new/src/PSC/Shop/MediaBundle/Api/UploadVariant.php @@ -13,7 +13,7 @@ use PSC\Shop\MediaBundle\Model\Media as MediaModel; use PSC\Shop\MediaBundle\Service\MediaManager as PSCMediaManager; use PSC\Shop\MediaBundle\Transformer\Media as PSCMedia; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; diff --git a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/ChooserController.php b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/ChooserController.php index 86e8e94d8..fd590c6f3 100755 --- a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/ChooserController.php +++ b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/ChooserController.php @@ -15,7 +15,7 @@ use PSC\Shop\MediaBundle\Helper\Media\AbstractMediaHandler; use PSC\Shop\MediaBundle\Helper\MediaManager; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; @@ -92,7 +92,7 @@ class ChooserController extends AbstractController * @return array */ #[Route(path: '/chooser/{folderId}', name: 'psc_shop_media_backend_chooser_show_folder')] - #[Template] + #[Template('@PSCShopMedia/backend/chooser/choosershowfolder.html.twig')] public function chooserShowFolderAction(Request $request, PaginatorInterface $paginator, Shop $shopService, DocumentManager $documentManager, MediaManager $mediaManager, FolderManager $folderManager, $folderId) { $session = $request->getSession(); diff --git a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/FolderController.php b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/FolderController.php index 663fb2f7f..64048d14c 100755 --- a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/FolderController.php +++ b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/FolderController.php @@ -38,8 +38,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -51,7 +51,7 @@ use Symfony\Component\HttpFoundation\Request; class FolderController extends AbstractController { #[Route(path: '/list/folder/cke/{htmlId}/{uuid}', defaults: ['uuid' => false, 'htmlId' => false], name: 'psc_shop_media_backend_folder_cke')] - #[Template] + #[Template('@PSCShopMedia/backend/folder/cke.html.twig')] public function ckeAction( Request $request, \PSC\Shop\MediaBundle\Helper\MediaManager $mediaManager, @@ -240,7 +240,7 @@ class FolderController extends AbstractController #[Route(path: '/list/folder/tw/{uuid}/{modal}/{htmlId}', defaults: ['uuid' => false, 'modal' => false, 'htmlId' => false], name: 'psc_shop_media_backend_folder_tw')] - #[Template] + #[Template('@PSCShopMedia/backend/folder/tw.html.twig')] public function twAction( Request $request, \PSC\Shop\MediaBundle\Helper\MediaManager $mediaManager, @@ -437,7 +437,7 @@ class FolderController extends AbstractController * @return array */ #[Route(path: '/list/folder/show/{uuid}/{modal}/{htmlId}', defaults: ['uuid' => false, 'modal' => false, 'htmlId' => false], name: 'psc_shop_media_backend_folder_show')] - #[Template] + #[Template('@PSCShopMedia/backend/folder/show.html.twig')] public function showAction( Request $request, \PSC\Shop\MediaBundle\Helper\MediaManager $mediaManager, @@ -626,7 +626,7 @@ class FolderController extends AbstractController } #[Route(path: '/list/folder/delete/{uuid}/{modal}/{htmlId}', defaults: ['uuid' => false, 'modal' => false, 'htmlId' => false], name: 'psc_shop_media_backend_folder_delete')] - #[Template] + #[Template('@PSCShopMedia/backend/folder/delete.html.twig')] public function deleteAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, DocumentManager $documentManager, $uuid, $modal, $htmlId) { /** @@ -669,7 +669,7 @@ class FolderController extends AbstractController * @return array */ #[Route(path: '/list/folder/create', name: 'psc_shop_media_backend_folder_sub_create')] - #[Template] + #[Template('@PSCShopMedia/backend/folder/subcreate.html.twig')] public function subCreateAction(Request $request, $folderId) { } diff --git a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/MediaController.php b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/MediaController.php index a42bf3cf5..e70a171d6 100755 --- a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/MediaController.php +++ b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/MediaController.php @@ -31,8 +31,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -55,7 +55,7 @@ class MediaController extends AbstractController * @return array */ #[Route(path: '/detail/show/{uuid}/{folder}/{modal}/{htmlId}', defaults: ['uuid' => false, 'modal' => false, 'folder' => false, 'htmlId' => false], name: 'psc_shop_media_backend_media_detail')] - #[Template] + #[Template('@PSCShopMedia/backend/media/detail.html.twig')] public function detailAction(SessionInterface $session, Request $request, DocumentManager $documentManager, MediaManager $mediaManager, EntityManagerInterface $entityManager, $uuid, $folder, $modal, $htmlId) { @@ -164,7 +164,7 @@ class MediaController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/delete/{uuid}/{folder}/{modal}/{htmlId}', defaults: ['uuid' => false, 'modal' => false, 'folder' => false, 'htmlId' => false], name: 'psc_shop_media_backend_media_delete')] - #[Template] + #[Template('@PSCShopMedia/backend/media/delete.html.twig')] public function deleteAction(Request $request, DocumentManager $documentManager, $uuid, $folder, $modal, $htmlId) { $media = $documentManager diff --git a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/UploadController.php b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/UploadController.php index 243be5e4b..ec721100d 100755 --- a/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/UploadController.php +++ b/src/new/src/PSC/Shop/MediaBundle/Controller/Backend/UploadController.php @@ -33,8 +33,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -53,7 +53,7 @@ class UploadController extends AbstractController * @return array */ #[Route(path: '/upload/create/{provider}', defaults: ['provider' => false], name: 'psc_shop_media_backend_upload_create')] - #[Template] + #[Template('@PSCShopMedia/backend/upload/create.html.twig')] public function createAction(Request $request = null, Pool $pool) { @@ -83,7 +83,7 @@ class UploadController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/upload/swap/{folder}/{media}/{modal}/{htmlId}', defaults: ['uuid' => false, 'uuid' => false, 'modal' => false, 'htmlId' => false], name: 'psc_shop_media_backend_upload_swap')] - #[Template] + #[Template('@PSCShopMedia/backend/upload/swap.html.twig')] public function swapAction(Request $request, SessionInterface $session, DocumentManager $documentManager, MediaManager $mediaManager, $folder, $media, CacheManager $cacheManager, $modal, $htmlId) { /** @var Media $media */ @@ -128,7 +128,7 @@ class UploadController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/upload/add/{uuid}/{modal}/{htmlId}', defaults: ['uuid' => false, 'modal' => false, 'htmlId' => false], name: 'psc_shop_media_backend_upload_add')] - #[Template] + #[Template('@PSCShopMedia/backend/upload/add.html.twig')] public function addAction(Request $request, Shop $shopService, SessionInterface $session, DocumentManager $documentManager, MediaManager $mediaManager, $uuid, $modal, $htmlId) { diff --git a/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/EditController.php index 59e21d43b..13e2cd5f8 100755 --- a/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/EditController.php @@ -31,8 +31,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -66,7 +66,7 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/edit/create', name: 'psc_shop_news_backend_create')] - #[Template] + #[Template('@PSCShopNews/backend/edit/create.html.twig')] public function createAction(Request $request, SessionInterface $session, Field $field, EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService) { $customFields = $field->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::News); @@ -108,7 +108,7 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/edit/edit/{uid}', name: 'psc_shop_news_backend_edit')] - #[Template] + #[Template('@PSCShopNews/backend/edit/edit.html.twig')] public function editAction(Request $request, Field $field, SessionInterface $session, EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService, $uid) { $customFields = $field->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::News); @@ -154,7 +154,7 @@ class EditController extends AbstractController * @return array|\Symfony\Component\HttpFoundation\RedirectResponse */ #[Route(path: '/edit/delete/{uid}', name: 'psc_shop_news_backend_delete')] - #[Template] + #[Template('@PSCShopNews/backend/edit/delete.html.twig')] public function deleteAction(Request $request, SessionInterface $session, EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService, $uid) { $news = $entityManager->getRepository('PSC\Shop\NewsBundle\Entity\News')->findOneBy(['uid' => $uid]); diff --git a/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/ListController.php index 0efa05403..289fe48ab 100755 --- a/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/NewsBundle/Controller/Backend/ListController.php @@ -22,8 +22,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -46,7 +46,7 @@ class ListController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/list/index', name: 'psc_shop_news_backend_list')] - #[Template] + #[Template('@PSCShopNews/backend/list/index.html.twig')] public function indexAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, PaginatorInterface $paginator) { diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Action/Create.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Action/Create.php index 92ce147bf..411c1f56c 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Action/Create.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Action/Create.php @@ -15,7 +15,7 @@ use PSC\System\SettingsBundle\Service\Shop; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Routing\Annotation\Route; class Create extends AbstractController diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Calc.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Calc.php index f15500f48..06697b3c1 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Calc.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Calc.php @@ -15,7 +15,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class Calc extends AbstractController diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/ChangeContact.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/ChangeContact.php index fa3f075de..b95794847 100644 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/ChangeContact.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/ChangeContact.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class ChangeContact extends AbstractController diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Copy.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Copy.php index cc028b195..2e4584e77 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Copy.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Copy.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class Copy extends AbstractController diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Create.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Create.php index 5b2964d17..51013e6d8 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Create.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Create.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class Create extends AbstractController diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/GetOneByUuid.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/GetOneByUuid.php index 9f03bb562..4b1b48e63 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/GetOneByUuid.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/GetOneByUuid.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class GetOneByUuid extends AbstractController diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Package/Nr.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Package/Nr.php index d60989491..2e1dfb141 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Package/Nr.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Package/Nr.php @@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class Nr extends AbstractController diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/GetAllByStatus.php b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/GetAllByStatus.php index 2ef3ca557..541089b1b 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/GetAllByStatus.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Order/Status/GetAllByStatus.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class GetAllByStatus extends AbstractController diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Position/GetPluginListDisplay.php b/src/new/src/PSC/Shop/OrderBundle/Api/Position/GetPluginListDisplay.php index ab51943ae..c0beb6e27 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Position/GetPluginListDisplay.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Position/GetPluginListDisplay.php @@ -12,7 +12,7 @@ use Symfony\Component\Routing\Annotation\Route; use OpenApi\Annotations as OA; use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; class GetPluginListDisplay extends AbstractController { diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/Change.php b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/Change.php index 115c5433a..4601b9aa1 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/Change.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/Change.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class Change extends AbstractController diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/ChangeAll.php b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/ChangeAll.php index 8c7caa63a..a85dc909e 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/ChangeAll.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Status/ChangeAll.php @@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class ChangeAll extends AbstractController diff --git a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Upload/Delete.php b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Upload/Delete.php index 5fb946369..ce8e46b7b 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Api/Position/Upload/Delete.php +++ b/src/new/src/PSC/Shop/OrderBundle/Api/Position/Upload/Delete.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; class Delete extends AbstractController diff --git a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/DetailController.php b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/DetailController.php index 497a6e13a..4486ad1c8 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/DetailController.php +++ b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/DetailController.php @@ -48,7 +48,7 @@ use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\HttpFoundation\Request; require_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Basket_Item.php'; @@ -66,7 +66,7 @@ class DetailController extends AbstractController } #[Route(path: '/detail/show/{uuid}/{enableDelivery}', defaults: ['enableDelivery' => 0], name: 'psc_shop_order_backend_detail_show')] - #[Template] + #[Template('@PSCShopOrder/backend/detail/show.html.twig')] public function showAction( Request $request, Field $fieldService, @@ -351,7 +351,7 @@ class DetailController extends AbstractController * @internal param Request $request */ #[Route(path: '/detail/switchposstatus/{order}/{pos}/{status}', name: 'psc_shop_order_backend_detail_switchposstatus')] - #[Template] + #[Template('@PSCShopOrder/backend/detail/switchposstatus.html.twig')] public function switchPosStatusAction(EntityManagerInterface $entityManagerService, Manager $eventManagerService, Shop $shopService, $order = "", $pos = "", $status = 10) { /** @@ -383,7 +383,7 @@ class DetailController extends AbstractController * @return RedirectResponse */ #[Route(path: '/package/exported/{uuid}', name: 'psc_shop_order_backend_change_exported')] - #[Template] + #[Template('@PSCShopOrder/backend/detail/setpackageexported.html.twig')] public function setPackageExportedAction(DocumentManager $mongoService, EntityManagerInterface $entityManagerService, Manager $eventManagerService, Shop $shopService, $uuid = "") { /** @@ -427,7 +427,7 @@ class DetailController extends AbstractController * @return RedirectResponse */ #[Route(path: '/detail/create/new/order/status/{uuid}', name: 'psc_shop_order_backend_create_new_order_status')] - #[Template] + #[Template('@PSCShopOrder/backend/detail/createneworderstatus.html.twig')] public function createNewOrderStatus(DocumentManager $mongoService, EntityManagerInterface $entityManagerService, Manager $eventManagerService, Shop $shopService, $uuid = "") { /** @@ -482,7 +482,7 @@ class DetailController extends AbstractController * @return RedirectResponse */ #[Route(path: '/detail/delete/{uuid}', name: 'psc_shop_order_backend_detail_delete')] - #[Template] + #[Template('@PSCShopOrder/backend/detail/deleteorder.html.twig')] public function deleteOrder(DocumentManager $mongoService, EntityManagerInterface $entityManagerService, Manager $eventManagerService, Shop $shopService, $uuid = "") { /** diff --git a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/ListController.php index f475a84ac..5372d7d0b 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/ListController.php @@ -34,8 +34,8 @@ use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -66,9 +66,9 @@ class ListController extends AbstractController * @return array * @throws \Doctrine\ORM\ORMException */ - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] #[Route(path: '/list/index', name: 'psc_shop_order_backend_list_index')] - #[Template] + #[Template('@PSCShopOrder/backend/list/index.html.twig')] public function indexAction( Request $request, PaginatorInterface $paginator, @@ -146,7 +146,7 @@ class ListController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/list/switchstatus/{order}/{status}', name: 'psc_shop_order_backend_list_switchstatus')] - #[Template] + #[Template('@PSCShopOrder/backend/list/switchstatus.html.twig')] public function switchStatusAction(\PSC\System\SettingsBundle\Service\Shop $shopService, SessionInterface $session, EntityManagerInterface $emService, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManagerService, $order = "", $status = 10) { $selectedShop = $shopService->getSelectedShop(); @@ -184,7 +184,7 @@ class ListController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/list/switchstatuspos/{position}/{status}', name: 'psc_shop_order_backend_list_switchstatus_pos')] - #[Template] + #[Template('@PSCShopOrder/backend/list/switchstatuspos.html.twig')] public function switchStatusPosAction(\PSC\System\SettingsBundle\Service\Shop $shopService, SessionInterface $session, EntityManagerInterface $emService, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManagerService, $position = "", $status = 10) { $selectedShop = $shopService->getSelectedShop(); diff --git a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PackageController.php b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PackageController.php index d2dcb63c1..ac4b4315f 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PackageController.php +++ b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PackageController.php @@ -38,8 +38,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; use ZipArchive; @@ -107,7 +107,7 @@ class PackageController extends AbstractController * @throws \Twig_Error_Syntax */ #[Route(path: '/detail/package/printpartner/{uuid}', name: 'psc_shop_order_backend_detail_package_printpartner')] - #[Template] + #[Template('@PSCShopOrder/backend/package/printpartner.html.twig')] public function printpartnerAction(Printing $printingService, EntityManagerInterface $entityManager, $uuid = "") { diff --git a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PrintController.php b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PrintController.php index d53e15487..dafb1e1cc 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PrintController.php +++ b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/PrintController.php @@ -38,8 +38,8 @@ use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; require_once(__DIR__ . '/../../../EntityBundle/Lagacy/TP_Basket_Item.php'); @@ -47,7 +47,7 @@ require_once(__DIR__ . '/../../../EntityBundle/Lagacy/TP_Basket_Item.php'); class PrintController extends AbstractController { #[Route(path: '/detail/print/{type}/{uuid}', name: 'psc_shop_order_backend_detail_print')] - #[Template] + #[Template('@PSCShopOrder/backend/print/print.html.twig')] public function printAction( Request $request, Printing $printingService, @@ -90,7 +90,7 @@ class PrintController extends AbstractController } #[Route(path: '/detail/printpos/{type}/{uuid}/{posuuid}', name: 'psc_shop_order_backend_detail_print_pos')] - #[Template] + #[Template('@PSCShopOrder/backend/print/printpos.html.twig')] public function printPosAction( Request $request, Printing $printingService, @@ -181,7 +181,7 @@ class PrintController extends AbstractController } #[Route(path: '/detail/xrechnung/{uuid}', name: 'psc_shop_order_backend_detail_xrechnung')] - #[Template] + #[Template('@PSCShopOrder/backend/print/xrechnung.html.twig')] public function xrechnung( Request $request, Printing $printingService, diff --git a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/UploadController.php b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/UploadController.php index 537f7bc8c..ff3f72122 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/UploadController.php +++ b/src/new/src/PSC/Shop/OrderBundle/Controller/Backend/UploadController.php @@ -21,8 +21,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -45,7 +45,7 @@ class UploadController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/upload/deleteAll/{uuid}', name: 'psc_shop_order_backend_upload_deleteAll')] - #[Template] + #[Template('@PSCShopOrder/backend/upload/deleteall.html.twig')] public function deleteAllAction( Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, diff --git a/src/new/src/PSC/Shop/OrderBundle/Normalizer/SpecialProductDenormalizer.php b/src/new/src/PSC/Shop/OrderBundle/Normalizer/SpecialProductDenormalizer.php index 901fe28da..c4d0188b7 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Normalizer/SpecialProductDenormalizer.php +++ b/src/new/src/PSC/Shop/OrderBundle/Normalizer/SpecialProductDenormalizer.php @@ -45,5 +45,6 @@ class SpecialProductDenormalizer implements DenormalizerInterface, DenormalizerA public function getSupportedTypes(null|string $format): array { + return [IProductTypeObject::class]; } } diff --git a/src/new/src/PSC/Shop/OrderBundle/Service/Order.php b/src/new/src/PSC/Shop/OrderBundle/Service/Order.php index 9d4fd0e45..8a7b394a6 100755 --- a/src/new/src/PSC/Shop/OrderBundle/Service/Order.php +++ b/src/new/src/PSC/Shop/OrderBundle/Service/Order.php @@ -56,8 +56,17 @@ class Order private Address $addressService; - public function __construct(Alias $aliasService, EntityManagerInterface $em, DocumentManager $mongoManager, Shop $shopService, \PSC\Shop\OrderBundle\Transformer\Order $orderTransformer, Position $positionTransformer, Manager $eventManager, Calc $calcService, Address $addressService) - { + public function __construct( + Alias $aliasService, + EntityManagerInterface $em, + DocumentManager $mongoManager, + Shop $shopService, + \PSC\Shop\OrderBundle\Transformer\Order $orderTransformer, + Position $positionTransformer, + Manager $eventManager, + Calc $calcService, + Address $addressService, + ) { $this->entityManager = $em; $this->mongoManager = $mongoManager; $this->shopService = $shopService; @@ -74,11 +83,11 @@ class Order $this->calcService->calcOrder($order); if ($order->getUid() != 0) { $this->updateOrder($order); - } elseif ($order->getUuid() != "" && $uid = $this->checkIfOrderUuidExists($order)) { + } elseif ($order->getUuid() != '' && ($uid = $this->checkIfOrderUuidExists($order))) { $order->setUid($uid); $this->updateOrder($order); } else { - if ($order->getAlias() != "") { + if ($order->getAlias() != '') { $result = $this->checkIfOrderExists($order); if ($result === false) { $this->newOrder($order); @@ -105,7 +114,10 @@ class Order $shopRepo = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Shop::class); $orderRepo = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Order::class); - $order = $orderRepo->findOneBy(['alias' => $order->getAlias(), 'shop' => $shopRepo->findOneBy(['uuid' => $order->getShop()->uuid])]); + $order = $orderRepo->findOneBy([ + 'alias' => $order->getAlias(), + 'shop' => $shopRepo->findOneBy(['uuid' => $order->getShop()->uuid]), + ]); if ($order) { return true; } @@ -116,21 +128,24 @@ class Order public function updateOrder(\PSC\Shop\OrderBundle\Model\Base $order) { if ($this->load_only_order) { - die("Do Not Update"); + die('Do Not Update'); } $orderRepo = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Order::class); $orderDocRepo = $this->mongoManager->getRepository(\PSC\Shop\EntityBundle\Document\Order::class); /** - * @var \PSC\Shop\EntityBundle\Entity\Order $orderEntity -*/ - $orderEntity = $orderRepo->findOneBy(array('uuid' => (string)$order->getUuid())); - $orderDoc = $orderDocRepo->findOneBy(array('uid' => (string)$orderEntity->getUID())); + * @var \PSC\Shop\EntityBundle\Entity\Order $orderEntity + */ + $orderEntity = $orderRepo->findOneBy(['uuid' => (string) $order->getUuid()]); + $orderDoc = $orderDocRepo->findOneBy(['uid' => (string) $orderEntity->getUID()]); $this->orderTransformer->toDb($order, $orderEntity, $orderDoc); - if ($orderEntity->getAlias() == "" && !$order->isDraft()) { - $orderEntity->setAlias($this->aliasService->generateAlias($orderEntity->getType(), $order->getShop()->getUuid())); + if ($orderEntity->getAlias() == '' && !$order->isDraft()) { + $orderEntity->setAlias($this->aliasService->generateAlias( + $orderEntity->getType(), + $order->getShop()->getUuid(), + )); } $this->entityManager->persist($orderEntity); @@ -146,14 +161,14 @@ class Order foreach ($order->getPositions() as $position) { if ($position->getUuid()) { /** - * @var Orderpos $positionEntity -*/ - $positionEntity = $posRepo->findOneBy(array('uuid' => (string)$position->getUuid())); + * @var Orderpos $positionEntity + */ + $positionEntity = $posRepo->findOneBy(['uuid' => (string) $position->getUuid()]); } else { /** - * @var Orderpos $positionEntity -*/ - $positionEntity = $posRepo->findOneBy(array('id' => (string)$position->getUid())); + * @var Orderpos $positionEntity + */ + $positionEntity = $posRepo->findOneBy(['id' => (string) $position->getUid()]); } $position->setPos($i); if (!$positionEntity) { @@ -166,13 +181,11 @@ class Order $positionDoc->setUid($positionEntity->getUid()); $this->mongoManager->persist($positionDoc); - - } else { /** - * @var \PSC\Shop\EntityBundle\Document\Position $positionDoc -*/ - $positionDoc = $posDocRepo->findOneBy(array('uid' => (string)$positionEntity->getUid())); + * @var \PSC\Shop\EntityBundle\Document\Position $positionDoc + */ + $positionDoc = $posDocRepo->findOneBy(['uid' => (string) $positionEntity->getUid()]); if (!$positionDoc) { $positionDoc = new \PSC\Shop\EntityBundle\Document\Position(); $positionDoc->setUid($positionEntity->getUid()); @@ -187,21 +200,20 @@ class Order $i++; } - $positions = $posRepo->findBy(array('order' => $orderEntity)); + $positions = $posRepo->findBy(['order' => $orderEntity]); foreach ($positions as $position) { if (!in_array($position->getUuid(), $positionUsed)) { /** - * @var \PSC\Shop\EntityBundle\Document\Position $positionDoc -*/ - $positionDoc = $posDocRepo->findOneBy(array('uid' => (string)$position->getUid())); + * @var \PSC\Shop\EntityBundle\Document\Position $positionDoc + */ + $positionDoc = $posDocRepo->findOneBy(['uid' => (string) $position->getUid()]); if ($positionDoc) { $this->mongoManager->remove($positionDoc); } $this->entityManager->remove($position); } - } $this->entityManager->flush(); @@ -213,8 +225,11 @@ class Order $orderEntity = new \PSC\Shop\EntityBundle\Entity\Order(); $orderDoc = new \PSC\Shop\EntityBundle\Document\Order(); $this->orderTransformer->toDb($order, $orderEntity, $orderDoc); - if ($orderEntity->getAlias() == "" && !$order->isDraft()) { - $orderEntity->setAlias($this->aliasService->generateAlias($orderEntity->getType(), $order->getShop()->getUuid())); + if ($orderEntity->getAlias() == '' && !$order->isDraft()) { + $orderEntity->setAlias($this->aliasService->generateAlias( + $orderEntity->getType(), + $order->getShop()->getUuid(), + )); } $this->entityManager->persist($orderEntity); $this->entityManager->flush(); @@ -254,7 +269,7 @@ class Order $order = $this->getOrderByUuid($uuid); $order->setUuid(Uuid::uuid7()); $order->setUid(0); - $order->setAlias(""); + $order->setAlias(''); if ($typ != 0) { $order->setType($typ); } @@ -269,7 +284,6 @@ class Order public function changeContact(string $uuid, string $contactUuid): PSCBase { - $order = $this->getOrderByUuid($uuid); $order->setContact(new Contact()); $order->getContact()->setUuid($contactUuid); @@ -280,18 +294,15 @@ class Order $this->currentOrder = null; $order = $this->getOrderByUuid($order->getUuid()); return $order; - } public function getLastOrders(int $limit = 10): array { $query = $this->entityManager - ->createQuery( - ' - SELECT c FROM PSCEntityBundle:Order c + ->createQuery(' + SELECT c FROM PSC\Shop\EntityBundle\Entity\Order c JOIN c.shop s - WHERE s.uid = :id ORDER BY c.created DESC' - ) + WHERE s.uid = :id ORDER BY c.created DESC') ->setParameter('id', $this->shopService->getSelectedShop()->getUid()) ->setMaxResults($limit); try { @@ -312,9 +323,9 @@ class Order $orderRepo = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order'); /** - * @var \PSC\Shop\EntityBundle\Entity\Order $orderEntity -*/ - $orderEntity = $orderRepo->findOneBy(array('uuid' => $uuid)); + * @var \PSC\Shop\EntityBundle\Entity\Order $orderEntity + */ + $orderEntity = $orderRepo->findOneBy(['uuid' => $uuid]); if ($this->currentOrder && $this->currentOrder->getUuid() === $uuid) { return $this->currentOrder; } @@ -329,7 +340,7 @@ class Order { $orderRepo = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order'); - $orderEntity = $orderRepo->findOneBy(array('uid' => $uid)); + $orderEntity = $orderRepo->findOneBy(['uid' => $uid]); return $this->parseToModel($orderEntity); } @@ -343,9 +354,9 @@ class Order $orderRepo = $this->entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Orderpos'); /** - * @var Orderpos $orderposEntity -*/ - $orderposEntity = $orderRepo->findOneBy(array('uuid' => $positionUuid)); + * @var Orderpos $orderposEntity + */ + $orderposEntity = $orderRepo->findOneBy(['uuid' => $positionUuid]); $this->parseToModel($orderposEntity->getOrder()); @@ -375,7 +386,6 @@ class Order */ private function parseToModel($orderEntity) { - $this->currentOrder = new \PSC\Shop\OrderBundle\Model\Order(); if ($orderEntity->getType() == 2) { $this->currentOrder = new \PSC\Shop\OrderBundle\Model\Offer(); @@ -397,32 +407,36 @@ class Order } /** - * @var \PSC\Shop\EntityBundle\Document\Order $orderObj -*/ + * @var \PSC\Shop\EntityBundle\Document\Order $orderObj + */ $orderDoc = $this->mongoManager ->getRepository('PSC\Shop\EntityBundle\Document\Order') - ->findOneBy(array('uid' => (string)$orderEntity->getUid())); + ->findOneBy(['uid' => (string) $orderEntity->getUid()]); if ($orderDoc) { $this->orderTransformer->fromDb($this->currentOrder, $orderEntity, $orderDoc); } else { - $this->orderTransformer->fromDb($this->currentOrder, $orderEntity, new \PSC\Shop\EntityBundle\Document\Order()); + $this->orderTransformer->fromDb( + $this->currentOrder, + $orderEntity, + new \PSC\Shop\EntityBundle\Document\Order(), + ); } if (!$this->load_only_order) { $orderPos = $this->entityManager->getRepository(Orderpos::class)->findBy(['order' => $orderEntity]); /** - * @var Orderpos $pos -*/ + * @var Orderpos $pos + */ foreach ($orderPos as $pos) { $position = new \PSC\Shop\OrderBundle\Model\Order\Position(); /** - * @var \PSC\Shop\EntityBundle\Document\Position $positionDoc -*/ + * @var \PSC\Shop\EntityBundle\Document\Position $positionDoc + */ $positionDoc = $this->mongoManager ->getRepository('PSC\Shop\EntityBundle\Document\Position') - ->findOneBy(array('uid' => (string)$pos->getUid())); + ->findOneBy(['uid' => (string) $pos->getUid()]); if ($positionDoc) { $this->positionTransformer->fromDb($position, $pos, $positionDoc); } else { diff --git a/src/new/src/PSC/Shop/PaymentBundle/Api/All.php b/src/new/src/PSC/Shop/PaymentBundle/Api/All.php index 328779e14..09a1a9ff0 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Api/All.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Api/All.php @@ -12,7 +12,7 @@ use PSC\Shop\EntityBundle\Entity\Payment; use PSC\Shop\PaymentBundle\Dto\All\Output; use PSC\Shop\PaymentBundle\Model\Payment as PSCPayment; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Attribute\Route; diff --git a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/EditController.php index 9de476d44..aa6e6d15e 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/EditController.php @@ -33,8 +33,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -71,7 +71,7 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/edit/create', name: 'psc_shop_payment_backend_create')] - #[Template] + #[Template('@PSCShopPayment/backend/edit/create.html.twig')] public function createAction(Request $request, Field $fieldService, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, SessionInterface $session, DocumentManager $documentManager) { $customFields = $fieldService->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::Shipping); @@ -124,7 +124,7 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/edit/edit/{uid}', name: 'psc_shop_payment_backend_edit')] - #[Template] + #[Template('@PSCShopPayment/backend/edit/edit.html.twig')] public function editAction( Request $request, Field $fieldService, @@ -204,7 +204,7 @@ class EditController extends AbstractController * @return array|\Symfony\Component\HttpFoundation\RedirectResponse */ #[Route(path: '/edit/delete/{uid}', name: 'psc_shop_payment_backend_delete')] - #[Template] + #[Template('@PSCShopPayment/backend/edit/delete.html.twig')] public function deleteAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, SessionInterface $session, EntityManagerInterface $entityManager, $uid) { /** @var Payment $payment */ diff --git a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/GatewayController.php b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/GatewayController.php index d27a41870..d3f639202 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/GatewayController.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/GatewayController.php @@ -27,8 +27,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -53,7 +53,7 @@ class GatewayController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/gateway/settings', name: 'psc_shop_payment_backend_gateway_settings')] - #[Template] + #[Template('@PSCShopPayment/backend/gateway/settings.html.twig')] public function settingsAction(Request $request, FormFactoryInterface $formFactory, \PSC\System\SettingsBundle\Service\Shop $shopService, Registry $registry, DocumentManager $documentManager) { diff --git a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/ListController.php index 6a1b7561a..3d3d72a18 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Controller/Backend/ListController.php @@ -22,8 +22,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -46,7 +46,7 @@ class ListController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/list/index', name: 'psc_shop_payment_backend_list')] - #[Template] + #[Template('@PSCShopPayment/backend/list/index.html.twig')] public function indexAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, PaginatorInterface $paginator) { diff --git a/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/NotifyController.php b/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/NotifyController.php index 793de07e3..91da5ab3e 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/NotifyController.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/NotifyController.php @@ -27,8 +27,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -53,7 +53,7 @@ class NotifyController extends AbstractController * @throws \Exception */ #[Route(path: '/notify/{apiKey}/{typ}', name: 'psc_shop_payment_backend_notify')] - #[Template] + #[Template('@PSCShopPayment/frontend/notify/index.html.twig')] public function indexAction(Request $request, Registry $registry, DocumentManager $documentManager, EntityManagerInterface $entityManager, $apiKey, $typ) { if ($typ == '') { diff --git a/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/PayController.php b/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/PayController.php index e3937994c..7c92c728d 100755 --- a/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/PayController.php +++ b/src/new/src/PSC/Shop/PaymentBundle/Controller/Frontend/PayController.php @@ -27,8 +27,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByProductGroup.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByProductGroup.php index 50df146da..b2c9ad976 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByProductGroup.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByProductGroup.php @@ -17,7 +17,7 @@ use Symfony\Component\Routing\Annotation\Route; use OpenApi\Annotations as OA; use Nelmio\ApiDocBundle\Annotation\Model; use PSC\System\SettingsBundle\Model\Paper as PSCPaper; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Nelmio\ApiDocBundle\Annotation\Security; class GetAllByProductGroup extends AbstractController diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByTerm.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByTerm.php index 7cfcf52d5..d34b5869a 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByTerm.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/GetAllByTerm.php @@ -15,7 +15,7 @@ use PSC\Shop\ProductBundle\Hydrate\Product as PSCProduct; use PSC\System\SettingsBundle\Model\Paper as PSCPaper; use PSC\System\SettingsBundle\Model\Papercontainer; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/One.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/One.php index abc17ab5f..198129b4b 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/One.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/One.php @@ -15,7 +15,7 @@ use Symfony\Component\Routing\Annotation\Route; use OpenApi\Annotations as OA; use Nelmio\ApiDocBundle\Annotation\Model; use PSC\System\SettingsBundle\Model\Paper as PSCPaper; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Nelmio\ApiDocBundle\Annotation\Security; class One extends AbstractController diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Add.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Add.php index f351b631e..7d4c79236 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Add.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Add.php @@ -8,7 +8,7 @@ use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\ProductBundle\Dto\Product\Set\Add\Input; use PSC\Shop\ProductBundle\Dto\Product\Set\Get\Output; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Delete.php b/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Delete.php index 125bed948..09fe29b50 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Delete.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/Product/Set/Delete.php @@ -8,7 +8,7 @@ use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\ProductBundle\Dto\Product\Set\Add\Input; use PSC\Shop\ProductBundle\Dto\Product\Set\Get\Output; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetTree.php b/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetTree.php index f05fae3e2..225c3050f 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetTree.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetTree.php @@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; class GetTree extends AbstractController { diff --git a/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetWithProducts.php b/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetWithProducts.php index 2ea364ab3..30258b178 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetWithProducts.php +++ b/src/new/src/PSC/Shop/ProductBundle/Api/ProductGroup/GetWithProducts.php @@ -19,7 +19,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Yaml\Yaml; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; class GetWithProducts extends AbstractController { diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/EditController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/EditController.php index a92d848df..2e47cb87d 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/EditController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/EditController.php @@ -25,8 +25,8 @@ use PSC\System\SettingsBundle\Service\History; use PSC\System\SettingsBundle\Service\Log; use PSC\System\SettingsBundle\Service\Status; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -720,8 +720,8 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/{uuid}/delete', name: 'psc_shop_product_backend_edit_delete')] - #[Security("is_granted('ROLE_SHOP')")] - #[Template] + #[IsGranted('ROLE_SHOP')] + #[Template('@PSCShopProduct/backend/product/edit/delete.html.twig')] public function deleteAction( Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, @@ -790,7 +790,7 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\OptimisticLockException */ #[Route(path: '/{uuid}/copy', name: 'psc_shop_product_backend_edit_copy')] - #[Template] + #[Template('@PSCShopProduct/backend/product/edit/copy.html.twig')] public function copyAction( Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/ListController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/ListController.php index cc68e4dfa..245eddc63 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/ListController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/ListController.php @@ -31,8 +31,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -57,9 +57,9 @@ class ListController extends AbstractController * @return array * @throws \Doctrine\ORM\ORMException */ - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] #[Route(path: '/list', name: 'psc_shop_product_backend_list')] - #[Template] + #[Template('@PSCShopProduct/backend/product/list/index.html.twig')] public function indexAction(Request $request, ProductType $productType, Shop $shopService, EntityManagerInterface $entityManager, PaginatorInterface $paginator, FilterBuilderUpdaterInterface $filterBuilderUpdater) { $selectedShop = $shopService->getSelectedShop(); @@ -96,7 +96,7 @@ class ListController extends AbstractController * @return array|JsonResponse * @throws \Doctrine\ORM\ORMException */ - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] #[Route(path: '/toggle/{field}/{uuid}', name: 'psc_shop_product_backend_toogle')] public function toggleAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, $field, $uuid) { diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/PermissionController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/PermissionController.php index 2adfb5da1..87b953f1b 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/PermissionController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/PermissionController.php @@ -29,8 +29,8 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/SetController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/SetController.php index c01d48838..7b021bfa6 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/SetController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/SetController.php @@ -22,14 +22,14 @@ use PSC\System\SettingsBundle\Service\Shop; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\HttpFoundation\Request; class SetController extends AbstractController { #[Route(path: '/set/{product}', name: 'backend_production_product_product_set')] - #[Template] + #[Template('@PSCShopProduct/backend/product/set/index.html.twig')] public function indexAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, SessionInterface $session, $product): array { diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/StockController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/StockController.php index e43520e3b..4f2db2f46 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/StockController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/StockController.php @@ -26,8 +26,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/TemplateprintController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/TemplateprintController.php index 7fc0a13b1..0504b0ba2 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/TemplateprintController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/TemplateprintController.php @@ -33,8 +33,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/UploadController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/UploadController.php index 2c9d3bf79..81673e57f 100644 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/UploadController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Product/UploadController.php @@ -9,7 +9,7 @@ use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\ProductBundle\Form\Backend\Upload\Uploads; use PSC\Shop\ProductBundle\Model\Upload\Setting; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Attribute\Route; @@ -23,7 +23,7 @@ class UploadController extends AbstractController } - #[Template] + #[Template('@PSCShopProduct/backend/product/upload/index.html.twig')] #[Route(path: '/upload/index/{uuid}', name: 'backend_production_product_upload_index')] public function indexAction( Request $request, diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/EditController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/EditController.php index 607120812..86c77f510 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/EditController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/EditController.php @@ -38,8 +38,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -191,7 +191,7 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/edit/create', name: 'psc_shop_productgroup_backend_create')] - #[Template] + #[Template('@PSCShopProduct/backend/productgroup/edit/create.html.twig')] public function createAction(Request $request, Field $fieldService, EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService, DocumentManager $documentManager, SessionInterface $session, MediaManager $mediaManager) { $customFields = $fieldService->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::Productgroup); @@ -246,7 +246,7 @@ class EditController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/edit/edit/{uid}', name: 'psc_shop_productgroup_backend_edit')] - #[Template] + #[Template('@PSCShopProduct/backend/productgroup/edit/edit.html.twig')] public function editAction( Request $request, Field $fieldService, @@ -320,7 +320,7 @@ class EditController extends AbstractController * @return array|\Symfony\Component\HttpFoundation\RedirectResponse */ #[Route(path: '/edit/delete/{uid}', name: 'psc_shop_productgroup_backend_delete')] - #[Template] + #[Template('@PSCShopProduct/backend/productgroup/edit/delete.html.twig')] public function deleteAction(Request $request, SessionInterface $session, EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService, $uid) { /** @var Productgroup $productgroup */ diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/ListController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/ListController.php index 86d7a646f..ff83b2f26 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/ListController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Backend/Productgroup/ListController.php @@ -30,8 +30,8 @@ use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -55,9 +55,9 @@ class ListController extends AbstractController * @return array|View * @throws \Doctrine\ORM\ORMException */ - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] #[Route(path: '/list/index', name: 'psc_shop_productgroup_backend_list')] - #[Template] + #[Template('@PSCShopProduct/backend/productgroup/list/index.html.twig')] public function indexAction(Request $request, SessionInterface $session, Shop $shopService, EntityManagerInterface $entityManager, PaginatorInterface $paginator, FilterBuilderUpdaterInterface $queryBuilder) { $selectedShop = $shopService->getSelectedShop(); diff --git a/src/new/src/PSC/Shop/ProductBundle/Controller/Frontend/Product/OfferController.php b/src/new/src/PSC/Shop/ProductBundle/Controller/Frontend/Product/OfferController.php index d79083d9b..7702ec609 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Controller/Frontend/Product/OfferController.php +++ b/src/new/src/PSC/Shop/ProductBundle/Controller/Frontend/Product/OfferController.php @@ -34,8 +34,8 @@ use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; use Twig\Environment; diff --git a/src/new/src/PSC/Shop/ProductBundle/Form/Backend/Product/PermissionType.php b/src/new/src/PSC/Shop/ProductBundle/Form/Backend/Product/PermissionType.php index a0ced336c..58ec4dea0 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Form/Backend/Product/PermissionType.php +++ b/src/new/src/PSC/Shop/ProductBundle/Form/Backend/Product/PermissionType.php @@ -44,8 +44,15 @@ class PermissionType extends AbstractType protected $generalService; protected $entity_manager; - public function __construct(Shop $shop, Status $statusService, Field $fields, FormFactory $formFactory, General $generalService, EntityManagerInterface $entityManager) - { + + public function __construct( + Shop $shop, + Status $statusService, + Field $fields, + FormFactory $formFactory, + General $generalService, + EntityManagerInterface $entityManager, + ) { $this->shop = $shop; $this->statusService = $statusService; $this->fields = $fields; @@ -56,9 +63,9 @@ class PermissionType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { - - $contacts = $this->entity_manager->createQuery(' - SELECT c.uid,c.firstname,c.lastname FROM PSCEntityBundle:Contact c + $contacts = $this->entity_manager + ->createQuery(' + SELECT c.uid,c.firstname,c.lastname FROM PSC\Shop\EntityBundle\Entity\Contact c JOIN c.shops s WHERE s.uid = :shop_id') ->setParameter('shop_id', $this->shop->getSelectedShop()->getUid()) ->getResult(Query::HYDRATE_ARRAY); @@ -70,9 +77,9 @@ class PermissionType extends AbstractType } $builder - ->add('confirm', CheckboxType::class, array('required' => false, 'label' => 'Requiresapproval')) - ->add('confirmOne', CheckboxType::class, array('required' => false, 'label' => 'Onlycontact')) - ->add('confirmAccount', EntityType::class, array( + ->add('confirm', CheckboxType::class, ['required' => false, 'label' => 'Requiresapproval']) + ->add('confirmOne', CheckboxType::class, ['required' => false, 'label' => 'Onlycontact']) + ->add('confirmAccount', EntityType::class, [ 'class' => 'PSC\Shop\EntityBundle\Entity\Account', 'choice_label' => 'title', 'multiple' => false, @@ -80,43 +87,49 @@ class PermissionType extends AbstractType 'label' => 'Company', 'placeholder' => 'nothingselected', 'query_builder' => function (EntityRepository $er) { - return $er->createQueryBuilder('u') + return $er + ->createQueryBuilder('u') ->leftJoin('u.shops', 's') - ->where('s.uid = :shop')->setParameter('shop', $this->shop->getSelectedShop()->getId()); - } - )) - ->add('confirm_contacts', ChoiceType::class, array( + ->where('s.uid = :shop') + ->setParameter('shop', $this->shop->getSelectedShop()->getId()); + }, + ]) + ->add('confirm_contacts', ChoiceType::class, [ 'choices' => $tmpContacts, 'multiple' => true, 'label' => 'Persons', - )); + ]); - - $builder->get('confirm_contacts') - ->addModelTransformer(new CallbackTransformer( - function ($collection) { - if ($collection != null) { - $temp = []; - foreach ($collection as $item) { - $temp[$item->getFirstname() . ' ' . $item->getLastname()] = $item->getUid(); + $builder + ->get('confirm_contacts') + ->addModelTransformer( + new CallbackTransformer( + function ($collection) { + if ($collection != null) { + $temp = []; + foreach ($collection as $item) { + $temp[$item->getFirstname() . ' ' . $item->getLastname()] = $item->getUid(); + } + return $temp; } - return $temp; - } - }, - function ($arrayValues) { - $contacts = $this->entity_manager->createQuery(' - SELECT c FROM PSCEntityBundle:Contact c - JOIN c.shops s WHERE s.uid = :shop_id AND c.uid in (:contact_uid)') - ->setParameter('shop_id', $this->shop->getSelectedShop()->getUid()) - ->setParameter('contact_uid', array_values($arrayValues)) - ->execute(); + }, + function ($arrayValues) { + $contacts = $this->entity_manager + ->createQuery( + ' + SELECT c FROM PSC\Shop\EntityBundle\Entity\Contact c + JOIN c.shops s WHERE s.uid = :shop_id AND c.uid in (:contact_uid)', + ) + ->setParameter('shop_id', $this->shop->getSelectedShop()->getUid()) + ->setParameter('contact_uid', array_values($arrayValues)) + ->execute(); + return $contacts; + }, + ), + ); - return $contacts; - } - )); - - $builder->add('save', SubmitType::class, array('label' => 'save')); + $builder->add('save', SubmitType::class, ['label' => 'save']); } public function getName() @@ -126,10 +139,10 @@ class PermissionType extends AbstractType public function configureOptions(OptionsResolver $resolver) { - $resolver->setDefaults(array( + $resolver->setDefaults([ 'data_class' => 'PSC\Shop\EntityBundle\Entity\Product', 'productType' => 0, - 'translation_domain' => 'core_product_list' - )); + 'translation_domain' => 'core_product_list', + ]); } } diff --git a/src/new/src/PSC/Shop/ProductBundle/Form/Backend/Productgroup/SearchType.php b/src/new/src/PSC/Shop/ProductBundle/Form/Backend/Productgroup/SearchType.php index 8630be2a6..48374d607 100755 --- a/src/new/src/PSC/Shop/ProductBundle/Form/Backend/Productgroup/SearchType.php +++ b/src/new/src/PSC/Shop/ProductBundle/Form/Backend/Productgroup/SearchType.php @@ -1,16 +1,5 @@ - * @copyright 2012-2013 PrintshopCreator GmbH - * @license Private - * @link http://www.printshopcreator.de - */ - namespace PSC\Shop\ProductBundle\Form\Backend\Productgroup; use Doctrine\ORM\EntityRepository; @@ -31,8 +20,9 @@ class SearchType extends AbstractType { /** @var Shop */ protected $shop; -/** @var Session */ + /** @var Session */ protected $session; + public function __construct(RequestStack $requestStack, Shop $shop) { $this->shop = $shop; @@ -44,12 +34,12 @@ class SearchType extends AbstractType $session = $this->session; $builder ->setMethod('POST') - ->add('parent', EntityType::class, array( + ->add('parent', EntityType::class, [ 'class' => Productgroup::class, 'choice_value' => 'uid', 'query_builder' => function (EntityRepository $er) { - - return $er->createQueryBuilder('g') + return $er + ->createQueryBuilder('g') ->andWhere('g.shop = :shop') ->setParameter('shop', $this->shop->getSelectedShop()->getUid()) ->orderBy('g.title', 'ASC'); @@ -57,50 +47,51 @@ class SearchType extends AbstractType 'choice_label' => 'title', 'data' => $session->get('productgroup_search_parent'), 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) use ($session) { - $session->set('productgroup_search_parent', $values['value']); if (empty($values['value'])) { return null; } - $filterQuery->getQueryBuilder() - ->andWhere("$field = '" . $values['value']->getUid() . "'"); + $filterQuery->getQueryBuilder()->andWhere("{$field} = '" . $values['value']->getUid() . "'"); }, 'required' => false, - 'label' => 'predecessor' - )) - ->add('enable', CheckboxType::class, array( + 'label' => 'predecessor', + ]) + ->add('enable', CheckboxType::class, [ 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) use ($session) { - $session->set('productgroup_search_enable', $values['value']); if ($values['value'] == 1) { - $filterQuery->getQueryBuilder() - ->andWhere("$field = '" . $values['value'] . "'"); + $filterQuery->getQueryBuilder()->andWhere("{$field} = '" . $values['value'] . "'"); } }, 'required' => false, 'data' => $session->get('productgroup_search_enable', true), - 'label' => 'Showactiveonly' - )) - ->add('term', TextFilterType::class, array( + 'label' => 'Showactiveonly', + ]) + ->add('term', TextFilterType::class, [ 'data' => $session->get('productgroup_search_term'), 'attr' => ['placeholder' => 'keyword'], 'apply_filter' => function (QueryInterface $filterQuery, $field, $values) use ($session) { - $session->set('productgroup_search_term', $values['value']); if (empty($values['value'])) { return null; } - $filterQuery->getQueryBuilder() + $filterQuery + ->getQueryBuilder() ->andWhere(" - productgroup.uid LIKE '%" . $values['value'] . "%' OR - productgroup.title LIKE '%" . $values['value'] . "%' + productgroup.uid LIKE '%" . + $values['value'] . + "%' OR + productgroup.title LIKE '%" . + $values['value'] . + "%' "); - })) + }, + ]) ->add('filter', SubmitType::class, [ 'icon_before' => 'fas fa-search', 'label' => 'Filtern', - 'attr' => array('class' => 'btn btn-sm btn-success') + 'attr' => ['class' => 'btn btn-sm btn-success'], ]); } @@ -111,9 +102,9 @@ class SearchType extends AbstractType public function configureOptions(OptionsResolver $resolver) { - $resolver->setDefaults(array( - 'csrf_protection' => false, - 'translation_domain' => 'core_productgroup_list' - )); + $resolver->setDefaults([ + 'csrf_protection' => false, + 'translation_domain' => 'core_productgroup_list', + ]); } } diff --git a/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/EditController.php index 07dcb3106..3375d502a 100755 --- a/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/EditController.php @@ -31,8 +31,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -55,8 +55,8 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/{type}/create', name: 'psc_shop_queue_backend_edit_create')] - #[Security("is_granted('ROLE_SHOP')")] - #[Template] + #[IsGranted('ROLE_SHOP')] + #[Template('@PSCShopQueue/backend/edit/create.html.twig')] public function createAction( Request $request, Shop $shopService, @@ -118,8 +118,8 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/{uuid}/edit', name: 'psc_shop_queue_backend_edit_edit')] - #[Security("is_granted('ROLE_SHOP')")] - #[Template] + #[IsGranted('ROLE_SHOP')] + #[Template('@PSCShopQueue/backend/edit/edit.html.twig')] public function editAction( Request $request, Shop $shopService, @@ -195,8 +195,8 @@ class EditController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/{uuid}/delete', name: 'psc_shop_queue_backend_edit_delete')] - #[Security("is_granted('ROLE_SHOP')")] - #[Template] + #[IsGranted('ROLE_SHOP')] + #[Template('@PSCShopQueue/backend/edit/delete.html.twig')] public function deleteAction(Request $request, DocumentManager $documentManager, $uuid) { $objQueue = $documentManager @@ -218,7 +218,7 @@ class EditController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/{uuid}/copy', name: 'psc_shop_queue_backend_edit_copy')] - #[Template] + #[Template('@PSCShopQueue/backend/edit/copy.html.twig')] public function copyAction(Request $request, DocumentManager $documentManager, $uuid) { diff --git a/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/ListController.php index 5939dee91..263e47958 100755 --- a/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/QueueBundle/Controller/Backend/ListController.php @@ -29,8 +29,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -49,7 +49,7 @@ class ListController extends AbstractController * @return array */ #[Route(path: '/list/index', name: 'psc_shop_queue_backend_list_index')] - #[Template] + #[Template('@PSCShopQueue/backend/list/index.html.twig')] public function indexAction( Request $request, Shop $shopService, diff --git a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/CountryController.php b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/CountryController.php index 02485fbbc..b441cbefb 100755 --- a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/CountryController.php +++ b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/CountryController.php @@ -29,8 +29,8 @@ use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -53,8 +53,8 @@ class CountryController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/country/index', name: 'psc_backend_shop_settings_country_index')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCShopSettings/backend/country/index.html.twig')] + #[IsGranted('ROLE_SHOP')] public function indexAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, DocumentManager $documentManager) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ @@ -90,7 +90,7 @@ class CountryController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException * @throws \Doctrine\ORM\ORMException */ - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] #[Route(path: '/country/delete/{id}', name: 'psc_backend_shop_settings_country_delete')] public function deleteAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, DocumentManager $documentManager, $id) { @@ -112,7 +112,7 @@ class CountryController extends AbstractController * * @return array|JsonResponse */ - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] #[Route(path: '/country/toggle/{field}/{id}', name: 'psc_backend_shop_settings_country_toogle')] public function toggleAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, DocumentManager $documentManager, $field, $id) { diff --git a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/RoutingController.php b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/RoutingController.php index 39168b05a..b98085d61 100755 --- a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/RoutingController.php +++ b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/RoutingController.php @@ -27,8 +27,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; use PSC\Shop\SettingsBundle\Form\Backend\RoutingConfigType; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -44,8 +44,8 @@ class RoutingController extends AbstractController * @return array */ #[Route(path: '/routing/index', name: 'psc_backend_shop_routing_index')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCShopSettings/backend/routing/index.html.twig')] + #[IsGranted('ROLE_SHOP')] public function indexAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, Routing $routingService, DocumentManager $documentManager) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ @@ -88,7 +88,7 @@ class RoutingController extends AbstractController * */ #[Route(path: '/routing/delete/{uuid}', name: 'psc_backend_shop_routing_delete')] - #[Security("is_granted('ROLE_SHOP')")] + #[IsGranted('ROLE_SHOP')] public function deleteAction(string $uuid, Routing $routingService): RedirectResponse { $routingService->deleteRoute($uuid); @@ -102,8 +102,8 @@ class RoutingController extends AbstractController * */ #[Route(path: '/routing/regenerate/{type}', name: 'psc_backend_shop_routing_regenerate')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCShopSettings/backend/routing/regenerate.html.twig')] + #[IsGranted('ROLE_SHOP')] public function regenerateAction( \Twig\Environment $template, Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, Routing $routingService, EntityManagerInterface $entityManager, int $type = 1): RedirectResponse { @@ -145,8 +145,8 @@ class RoutingController extends AbstractController * */ #[Route(path: '/routing/clear/{type}', name: 'psc_backend_shop_routing_clear')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCShopSettings/backend/routing/clear.html.twig')] + #[IsGranted('ROLE_SHOP')] public function clearAction(\Twig\Environment $template, Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, Routing $routingService, EntityManagerInterface $entityManager, int $type = 1): RedirectResponse { $selectedShop = $shopService->getSelectedShop(); diff --git a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/SettingsController.php b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/SettingsController.php index 22f2b6577..de20eda23 100755 --- a/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/SettingsController.php +++ b/src/new/src/PSC/Shop/SettingsBundle/Controller/Backend/SettingsController.php @@ -33,8 +33,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -67,8 +67,8 @@ class SettingsController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/settings/index', name: 'psc_backend_shop_settings_index')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCShopSettings/backend/settings/index.html.twig')] + #[IsGranted('ROLE_SHOP')] public function indexAction( Request $request, Field $fieldService, @@ -216,8 +216,8 @@ class SettingsController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/settings/renewapikey', name: 'psc_backend_shop_settings_renewapikey')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCShopSettings/backend/settings/renewapikey.html.twig')] + #[IsGranted('ROLE_SHOP')] public function renewApiKeyAction(\PSC\System\SettingsBundle\Service\Shop $shopService, DocumentManager $documentManager, EntityManagerInterface $entityManager) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ diff --git a/src/new/src/PSC/Shop/SettingsBundle/Controller/Json/ShopController.php b/src/new/src/PSC/Shop/SettingsBundle/Controller/Json/ShopController.php index 16adec934..e5a724c2f 100755 --- a/src/new/src/PSC/Shop/SettingsBundle/Controller/Json/ShopController.php +++ b/src/new/src/PSC/Shop/SettingsBundle/Controller/Json/ShopController.php @@ -26,7 +26,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Translation\Exception\NotFoundResourceException; use PSC\Shop\EntityBundle\Entity\Motiv; use PSC\Shop\EntityBundle\Document\Motiv as DocumentMotiv; diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/EditController.php index c2d667d2b..c475334f0 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/EditController.php @@ -34,8 +34,8 @@ use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -63,7 +63,7 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/edit/create', name: 'psc_shop_shipping_backend_create')] - #[Template] + #[Template('@PSCShopShipping/backend/edit/create.html.twig')] public function createAction( Request $request, Field $fieldService, @@ -103,7 +103,7 @@ class EditController extends AbstractController } #[Route(path: '/edit/edit/{uid}', name: 'psc_shop_shipping_backend_edit')] - #[Template] + #[Template('@PSCShopShipping/backend/edit/edit.html.twig')] public function editAction( Request $request, Field $fieldService, @@ -172,7 +172,7 @@ class EditController extends AbstractController * @return array|\Symfony\Component\HttpFoundation\RedirectResponse */ #[Route(path: '/edit/delete/{uid}', name: 'psc_shop_shipping_backend_delete')] - #[Template] + #[Template('@PSCShopShipping/backend/edit/delete.html.twig')] public function deleteAction(Request $request, SessionInterface $session, EntityManagerInterface $entityManager, $uid) { /** @var Shipping $shipping */ diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/GatewayController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/GatewayController.php index e8b8e5a14..a360549d7 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/GatewayController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/GatewayController.php @@ -27,8 +27,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -53,7 +53,7 @@ class GatewayController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/gateway/settings', name: 'psc_shop_shipping_backend_gateway_settings')] - #[Template] + #[Template('@PSCShopShipping/backend/gateway/settings.html.twig')] public function settingsAction( Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ImportController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ImportController.php index 6297d7fa8..6633f06a0 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ImportController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ImportController.php @@ -25,8 +25,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -50,7 +50,7 @@ class ImportController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/parcel_number/import/index', name: 'psc_shop_shipping_backend_parcel_number_import_index')] - #[Template] + #[Template('@PSCShopShipping/backend/import/index.html.twig')] public function indexAction(Request $request, Shop $shopService, DocumentManager $documentManager, PaginatorInterface $paginator) { $selectedShop = $shopService->getSelectedShop(); diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ListController.php index e097dac6e..581f166a1 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Backend/ListController.php @@ -22,8 +22,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -46,7 +46,7 @@ class ListController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/list/index', name: 'psc_shop_shipping_backend_list')] - #[Template] + #[Template('@PSCShopShipping/backend/list/index.html.twig')] public function indexAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, PaginatorInterface $paginator) { diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/CreateController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/CreateController.php index 2c46bfdfc..9247a72fa 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/CreateController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/CreateController.php @@ -26,8 +26,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** diff --git a/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/DownloadController.php b/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/DownloadController.php index 7db7a8236..8a254b83a 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/DownloadController.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Controller/Service/DownloadController.php @@ -29,8 +29,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** diff --git a/src/new/src/PSC/Shop/ShippingBundle/Repository/ShippingRepository.php b/src/new/src/PSC/Shop/ShippingBundle/Repository/ShippingRepository.php index a09d3a398..1b95f27ef 100755 --- a/src/new/src/PSC/Shop/ShippingBundle/Repository/ShippingRepository.php +++ b/src/new/src/PSC/Shop/ShippingBundle/Repository/ShippingRepository.php @@ -12,6 +12,7 @@ class ShippingRepository extends ServiceEntityRepository { parent::__construct($registry, Shipping::class); } + /** * Gibt alle Versandarten zurück; * @@ -21,10 +22,12 @@ class ShippingRepository extends ServiceEntityRepository */ public function getAllByShopIdWithPagination($shopId) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT s FROM PSCEntityBundle:Shipping s - WHERE s.shop = :shop_id')->setParameter('shop_id', $shopId); + $query = $this->getEntityManager()->createQuery(' + SELECT s FROM PSC\Shop\EntityBundle\Entity\Shipping s + WHERE s.shop = :shop_id')->setParameter( + 'shop_id', + $shopId, + ); try { return $query->getArrayResult(); } catch (\Doctrine\ORM\NoResultException $e) { @@ -41,10 +44,12 @@ class ShippingRepository extends ServiceEntityRepository */ public function getAllByShopId($shopId) { - $query = $this->getEntityManager() - ->createQuery(' - SELECT s FROM PSCEntityBundle:Shipping s - WHERE s.shop = :shop_id')->setParameter('shop_id', $shopId); + $query = $this->getEntityManager()->createQuery(' + SELECT s FROM PSC\Shop\EntityBundle\Entity\Shipping s + WHERE s.shop = :shop_id')->setParameter( + 'shop_id', + $shopId, + ); try { return count($query->execute()); } catch (\Doctrine\ORM\NoResultException $e) { @@ -54,10 +59,9 @@ class ShippingRepository extends ServiceEntityRepository public function updateTaxes($shop, $from, $to) { - $this->getEntityManager() ->createQuery(' - UPDATE PSCEntityBundle:Shipping s SET s.taxClass=:to + UPDATE PSC\Shop\EntityBundle\Entity\Shipping s SET s.taxClass=:to WHERE s.taxClass = :from AND s.shop = :shop_id') ->setParameter('from', $from) ->setParameter('to', $to) diff --git a/src/new/src/PSC/Shop/ThemeBundle/Controller/Backend/SettingsController.php b/src/new/src/PSC/Shop/ThemeBundle/Controller/Backend/SettingsController.php index bd485d60b..866b4d9e3 100755 --- a/src/new/src/PSC/Shop/ThemeBundle/Controller/Backend/SettingsController.php +++ b/src/new/src/PSC/Shop/ThemeBundle/Controller/Backend/SettingsController.php @@ -31,8 +31,8 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -51,7 +51,7 @@ class SettingsController extends AbstractController * @return array */ #[Route(path: '/settings', name: 'psc_shop_theme_backend_settings')] - #[Template] + #[Template('@PSCShopTheme/backend/settings/index.html.twig')] public function indexAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, DocumentManager $documentManager, EntityManagerInterface $entityManager, Field $fieldService) { diff --git a/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/EditController.php b/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/EditController.php index d0d802530..fd92203d5 100755 --- a/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/EditController.php +++ b/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/EditController.php @@ -31,8 +31,8 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -62,7 +62,7 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/edit/create', name: 'psc_shop_voucher_backend_create')] - #[Template] + #[Template('@PSCShopVoucher/backend/edit/create.html.twig')] public function createAction(Request $request, Field $fieldService, SessionInterface $session, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager) { $customFields = $fieldService->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::Voucher); @@ -102,7 +102,7 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/edit/edit/{uid}', name: 'psc_shop_voucher_backend_edit')] - #[Template] + #[Template('@PSCShopVoucher/backend/edit/edit.html.twig')] public function editAction(Request $request, Field $fieldService, SessionInterface $session, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, $uid) { $customFields = $fieldService->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::Voucher); @@ -145,7 +145,7 @@ class EditController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/edit/generate/{uid}', name: 'psc_shop_voucher_backend_generate')] - #[Template] + #[Template('@PSCShopVoucher/backend/edit/generate.html.twig')] public function generateAction(Request $request, SessionInterface $session, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, $uid) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ @@ -197,7 +197,7 @@ class EditController extends AbstractController * @return array|\Symfony\Component\HttpFoundation\RedirectResponse */ #[Route(path: '/edit/delete/{uid}', name: 'psc_shop_voucher_backend_delete')] - #[Template] + #[Template('@PSCShopVoucher/backend/edit/delete.html.twig')] public function deleteAction(Request $request, SessionInterface $session, EntityManagerInterface $entityManager, $uid) { $voucher = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Voucher')->findOneBy(['uid' => $uid]); @@ -232,7 +232,7 @@ class EditController extends AbstractController * @return StreamedResponse */ #[Route(path: '/edit/export/{uid}', name: 'psc_shop_voucher_backend_export')] - #[Template] + #[Template('@PSCShopVoucher/backend/edit/export.html.twig')] public function exportAction(Request $request, EntityManagerInterface $entityManager, $uid) { /** @var Voucher $voucher */ diff --git a/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/ListController.php b/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/ListController.php index 543dc0c28..bd1e420e4 100755 --- a/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/Shop/VoucherBundle/Controller/Backend/ListController.php @@ -22,8 +22,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -42,7 +42,7 @@ class ListController extends AbstractController * @return array */ #[Route(path: '/list/index', name: 'psc_shop_voucher_backend_list')] - #[Template] + #[Template('@PSCShopVoucher/backend/list/index.html.twig')] public function indexAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, PaginatorInterface $paginator) { diff --git a/src/new/src/PSC/System/PluginBundle/Controller/Backend/ListController.php b/src/new/src/PSC/System/PluginBundle/Controller/Backend/ListController.php index 7e1eba722..bcece1c8e 100755 --- a/src/new/src/PSC/System/PluginBundle/Controller/Backend/ListController.php +++ b/src/new/src/PSC/System/PluginBundle/Controller/Backend/ListController.php @@ -30,8 +30,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; use Jungi\Bundle\EnvironmentBundle\Theme\Tag as LocalTag; use Symfony\Component\Yaml\Yaml; @@ -52,7 +52,7 @@ class ListController extends AbstractController * @return void */ #[Route(path: '/cache/clear', name: 'psc_system_plugin_backend_clear_cache')] - #[Template] + #[Template('@PSCSystemPlugin/backend/list/clearcache.html.twig')] public function clearcacheAction(Assets $assetsService) { @@ -74,7 +74,7 @@ class ListController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/list', name: 'psc_system_plugin_backend_list')] - #[Template] + #[Template('@PSCSystemPlugin/backend/list/index.html.twig')] public function indexAction(Request $request, DocumentManager $documentManager, KernelInterface $kernel) { @@ -158,8 +158,8 @@ class ListController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/list/disable/{uuid}', name: 'psc_system_plugin_backend_list_disable')] - #[Security("is_granted('ROLE_SHOP')")] - #[Template] + #[IsGranted('ROLE_SHOP')] + #[Template('@PSCSystemPlugin/backend/list/disable.html.twig')] public function disableAction(Request $request, DocumentManager $documentManager, Manager $pluginManager, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManager, $uuid) { @@ -190,8 +190,8 @@ class ListController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/list/enable/{uuid}', name: 'psc_system_plugin_backend_list_enable')] - #[Security("is_granted('ROLE_SHOP')")] - #[Template] + #[IsGranted('ROLE_SHOP')] + #[Template('@PSCSystemPlugin/backend/list/enable.html.twig')] public function enableAction(Request $request, DocumentManager $documentManager, Manager $pluginManager, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManager, $uuid) { $qb = $documentManager diff --git a/src/new/src/PSC/System/SettingsBundle/Api/Paper/One.php b/src/new/src/PSC/System/SettingsBundle/Api/Paper/One.php index 7da87bbb4..97bdd2e99 100755 --- a/src/new/src/PSC/System/SettingsBundle/Api/Paper/One.php +++ b/src/new/src/PSC/System/SettingsBundle/Api/Paper/One.php @@ -12,7 +12,7 @@ use OpenApi\Attributes\Tag; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\EntityBundle\Entity\Paper; use PSC\System\SettingsBundle\Model\Paper as PSCPaper; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Attribute\Route; diff --git a/src/new/src/PSC/System/SettingsBundle/Api/Paper/Update.php b/src/new/src/PSC/System/SettingsBundle/Api/Paper/Update.php index 4e95ea2c9..b7bbe631b 100755 --- a/src/new/src/PSC/System/SettingsBundle/Api/Paper/Update.php +++ b/src/new/src/PSC/System/SettingsBundle/Api/Paper/Update.php @@ -12,7 +12,7 @@ use OpenApi\Attributes\Tag; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\EntityBundle\Entity\Paper as PSCPaper; use PSC\System\SettingsBundle\Model\Paper; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/HelpController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/HelpController.php index e54d6fad2..ceb6b5802 100644 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/HelpController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/HelpController.php @@ -11,15 +11,15 @@ use Ramsey\Uuid\Uuid; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; class HelpController extends AbstractController { #[Route(path: '/help/index', name: 'psc_system_help_list')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/help/index.html.twig')] + #[IsGranted('ROLE_SHOP')] public function indexAction(Request $request, DocumentManager $documentManager) { @@ -32,8 +32,8 @@ class HelpController extends AbstractController } #[Route(path: '/help/create', name: 'psc_system_help_create')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/help/create.html.twig')] + #[IsGranted('ROLE_SHOP')] public function createAction(Request $request, DocumentManager $documentManager, SessionInterface $session) { $help = new Help(); @@ -52,8 +52,8 @@ class HelpController extends AbstractController } #[Route(path: '/help/edit/{uuid}', name: 'psc_system_help_edit')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/help/edit.html.twig')] + #[IsGranted('ROLE_SHOP')] public function editAction(Request $request, DocumentManager $documentManager, SessionInterface $session, $uuid) { $help = $documentManager @@ -73,7 +73,7 @@ class HelpController extends AbstractController ); } #[Route(path: '/help/delete/{uuid}', name: 'psc_system_help_delete')] - #[Template] + #[Template('@PSCSystemSettings/backend/help/delete.html.twig')] public function deleteAction(Request $request, DocumentManager $documentManager, SessionInterface $session, $uuid) { diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/LogController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/LogController.php index 6ed58dc4e..03f388225 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/LogController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/LogController.php @@ -26,8 +26,8 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -44,8 +44,8 @@ class LogController extends AbstractController * */ #[Route(path: '/log/index', name: 'psc_backend_system_logs_index')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/log/index.html.twig')] + #[IsGranted('ROLE_SHOP')] public function indexAction(DocumentManager $mongoManager, PaginatorInterface $paginator, Request $request) { $logs = $mongoManager diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperContainerController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperContainerController.php index c9d2399a5..4550136d9 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperContainerController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperContainerController.php @@ -24,8 +24,8 @@ use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -48,8 +48,8 @@ class PaperContainerController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/papercontainer/settings', name: 'psc_system_paper_container_settings')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/papercontainer/settings.html.twig')] + #[IsGranted('ROLE_SHOP')] public function settingsAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, SessionInterface $session) { diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperController.php index c9da3cd3f..78c0255cf 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/PaperController.php @@ -25,8 +25,8 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -51,8 +51,8 @@ class PaperController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/paper/index', name: 'psc_system_paper_list')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/paper/index.html.twig')] + #[IsGranted('ROLE_SHOP')] public function indexAction( Request $request, SessionInterface $session, @@ -101,8 +101,8 @@ class PaperController extends AbstractController * @return array|\Symfony\Component\HttpFoundation\RedirectResponse */ #[Route(path: '/paper/edit/{uuid}', name: 'psc_system_paper_edit')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/paper/edit.html.twig')] + #[IsGranted('ROLE_SHOP')] public function editAction(Request $request, EntityManagerInterface $entityManager, DocumentManager $documentManager, $uuid) { @@ -194,8 +194,8 @@ class PaperController extends AbstractController * @throws \Doctrine\ORM\ORMException */ #[Route(path: '/paper/create', name: 'psc_system_paper_create')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/paper/create.html.twig')] + #[IsGranted('ROLE_SHOP')] public function createAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, DocumentManager $documentManager) { @@ -259,7 +259,7 @@ class PaperController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/paper/delete/{uuid}', name: 'psc_system_paper_delete')] - #[Template] + #[Template('@PSCSystemSettings/backend/paper/delete.html.twig')] public function deleteAction(Request $request, EntityManagerInterface $entityManager, DocumentManager $documentManager, SessionInterface $session, $uuid) { /** @var Paper $paper */ diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/SettingsController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/SettingsController.php index 2c0f2dbe0..166a20663 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/SettingsController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/SettingsController.php @@ -35,8 +35,8 @@ use Symfony\Component\Mailer\Transport; use Symfony\Component\Mime\Email; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -48,8 +48,8 @@ use Symfony\Component\HttpFoundation\Request; class SettingsController extends AbstractController { #[Route(path: '/settings/index', name: 'psc_backend_system_settings_index')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/settings/index.html.twig')] + #[IsGranted('ROLE_SHOP')] public function indexAction(Field $fieldService, Request $request, DocumentManager $documentManager, Log $logService) { @@ -102,8 +102,8 @@ class SettingsController extends AbstractController } #[Route(path: '/settings/smtptest', name: 'psc_backend_system_settings_smtptest')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/settings/smtptest.html.twig')] + #[IsGranted('ROLE_SHOP')] public function smtpTestAction(Request $request, DocumentManager $documentManager, MailerInterface $mailer, Shop $shopService) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ @@ -144,7 +144,7 @@ class SettingsController extends AbstractController * */ #[Route(path: '/settings/upgrade', name: 'psc_backend_system_settings_upgrade')] - #[Security("is_granted('ROLE_SHOP')")] + #[IsGranted('ROLE_SHOP')] public function upgradeAction(DomainSync $sync) { $sync->upgrade(); diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/StatusController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/StatusController.php index 0b6cc3101..8dcc3abef 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/StatusController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/StatusController.php @@ -23,8 +23,8 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -45,8 +45,8 @@ class StatusController extends AbstractController * @return array */ #[Route(path: '/status/index', name: 'psc_system_status_list')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/status/index.html.twig')] + #[IsGranted('ROLE_SHOP')] public function indexAction(Request $request, DocumentManager $documentManager, \PSC\System\SettingsBundle\Service\Status $statusService) { @@ -80,8 +80,8 @@ class StatusController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/status/create', name: 'psc_system_status_create')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/status/create.html.twig')] + #[IsGranted('ROLE_SHOP')] public function createAction(Request $request, DocumentManager $documentManager, SessionInterface $session) { $status = new Status(); @@ -111,8 +111,8 @@ class StatusController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/status/edit/{uuid}', name: 'psc_system_status_edit')] - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/status/edit.html.twig')] + #[IsGranted('ROLE_SHOP')] public function editAction(Request $request, DocumentManager $documentManager, SessionInterface $session, $uuid) { /** @var \PSC\System\SettingsBundle\Document\Status $status */ @@ -145,7 +145,7 @@ class StatusController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/status/delete/{uuid}', name: 'psc_system_status_delete')] - #[Template] + #[Template('@PSCSystemSettings/backend/status/delete.html.twig')] public function deleteAction(Request $request, DocumentManager $documentManager, SessionInterface $session, $uuid) { diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/TaxController.php b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/TaxController.php index 892468575..21e6f261b 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/Backend/TaxController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/Backend/TaxController.php @@ -30,8 +30,8 @@ use PSC\System\SettingsBundle\Service\Log; use Ramsey\Uuid\Uuid; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Session\Session; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\Annotation\Route; @@ -44,8 +44,8 @@ use Symfony\Component\Routing\Annotation\Route; */ class TaxController extends AbstractController { - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/tax/index.html.twig')] + #[IsGranted('ROLE_SHOP')] #[Route('/tax/index', name: "psc_system_tax_list")] public function indexAction(Request $request, EntityManagerInterface $entityManager, SessionInterface $session, \PSC\System\SettingsBundle\Service\Tax $taxService, Log $logService) { @@ -74,8 +74,8 @@ class TaxController extends AbstractController ); } - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/tax/create.html.twig')] + #[IsGranted('ROLE_SHOP')] #[Route('/tax/create', name: "psc_system_tax_create")] public function createAction(Request $request, DocumentManager $documentManager, SessionInterface $session) { @@ -94,8 +94,8 @@ class TaxController extends AbstractController ); } - #[Template] - #[Security("is_granted('ROLE_SHOP')")] + #[Template('@PSCSystemSettings/backend/tax/edit.html.twig')] + #[IsGranted('ROLE_SHOP')] #[Route('/tax/edit/{uuid}', name: "psc_system_tax_edit")] public function editAction(Request $request, DocumentManager $documentManager, SessionInterface $session, $uuid) { @@ -117,7 +117,7 @@ class TaxController extends AbstractController ); } - #[Template] + #[Template('@PSCSystemSettings/backend/tax/delete.html.twig')] #[Route('/tax/delete/{uuid}', name: "psc_system_tax_delete")] public function deleteAction(Request $request, DocumentManager $documentManager, SessionInterface $session, $uuid) { diff --git a/src/new/src/PSC/System/SettingsBundle/Controller/FtpController.php b/src/new/src/PSC/System/SettingsBundle/Controller/FtpController.php index a277b992b..e3aa0ecd1 100755 --- a/src/new/src/PSC/System/SettingsBundle/Controller/FtpController.php +++ b/src/new/src/PSC/System/SettingsBundle/Controller/FtpController.php @@ -14,31 +14,23 @@ namespace PSC\System\SettingsBundle\Controller; use Doctrine\ODM\MongoDB\DocumentManager; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Component\Security\Http\Attribute\IsGranted; -/** - * FtpController - * - * @package PSC\Backend\Production - * @subpackage Controller - */ class FtpController extends AbstractController { - #[Security("is_granted('ROLE_ADMIN')")] - #[Template] + #[IsGranted('ROLE_ADMIN')] + #[Template('@PSCSystemSettings/ftp/my_data.html.twig')] public function myDataAction(DocumentManager $mongoManager) { - - return array(); + return []; } - #[Security("is_granted('ROLE_ADMIN')")] - #[Template] + #[IsGranted('ROLE_ADMIN')] + #[Template('@PSCSystemSettings/ftp/my_data_tailwind.html.twig')] public function myDataTailwindAction(DocumentManager $mongoManager) { - - return array(); + return []; } } diff --git a/src/new/src/PSC/System/UpdateBundle/Controller/MigrationController.php b/src/new/src/PSC/System/UpdateBundle/Controller/MigrationController.php index a7b27bb8f..cb134001c 100755 --- a/src/new/src/PSC/System/UpdateBundle/Controller/MigrationController.php +++ b/src/new/src/PSC/System/UpdateBundle/Controller/MigrationController.php @@ -27,8 +27,8 @@ use Symfony\Component\Finder\SplFileInfo; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; /** @@ -48,7 +48,7 @@ class MigrationController extends AbstractController * @return array */ #[Route(path: '/migration/do', name: 'psc_system_update_migration_do')] - #[Template] + #[Template('@PSCSystemUpdate/migration/do.html.twig')] public function doAction(Request $request, Migration $migration) { diff --git a/src/new/templates/backend_tailwind_base.html.twig b/src/new/templates/backend_tailwind_base.html.twig index b723b3002..f8f5889e6 100644 --- a/src/new/templates/backend_tailwind_base.html.twig +++ b/src/new/templates/backend_tailwind_base.html.twig @@ -48,7 +48,7 @@ {% if is_granted('ROLE_ADMIN') %} - {{ render(controller('PSC\\System\\SettingsBundle\\Controller\\FtpController::myDataTailwindAction')) }} + {{ render(controller('\\PSC\\System\\SettingsBundle\\Controller\\FtpController::myDataTailwindAction')) }}
{% endif %}

{{ date("now")|date('d.m.Y H:i:s') }}

diff --git a/src/new/var/plugins/Custom/Ahrweiler/Contact/Controller/Backend/StartController.php b/src/new/var/plugins/Custom/Ahrweiler/Contact/Controller/Backend/StartController.php index 507dba126..2c6a4e471 100755 --- a/src/new/var/plugins/Custom/Ahrweiler/Contact/Controller/Backend/StartController.php +++ b/src/new/var/plugins/Custom/Ahrweiler/Contact/Controller/Backend/StartController.php @@ -11,7 +11,7 @@ use PSC\Shop\EntityBundle\Entity\ContactAddress; use PSC\Shop\EntityBundle\Repository\ContactAddressRepository; use PSC\System\PluginBundle\Form\Chain\Field; use Role; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/DeliveryController.php b/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/DeliveryController.php index 3ae842951..3c5935a1d 100755 --- a/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/DeliveryController.php +++ b/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/DeliveryController.php @@ -14,7 +14,7 @@ use PSC\Shop\EntityBundle\Entity\ContactAddress; use PSC\Shop\EntityBundle\Repository\ContactAddressRepository; use PSC\System\PluginBundle\Form\Chain\Field; use Role; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/ExcelController.php b/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/ExcelController.php index 9e2b4cfe3..d47b5b9d1 100755 --- a/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/ExcelController.php +++ b/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/ExcelController.php @@ -14,7 +14,7 @@ use PSC\Shop\EntityBundle\Entity\ContactAddress; use PSC\Shop\EntityBundle\Repository\ContactAddressRepository; use PSC\System\PluginBundle\Form\Chain\Field; use Role; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/StartController.php b/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/StartController.php index f620e4730..7aac3f2b2 100755 --- a/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/StartController.php +++ b/src/new/var/plugins/Custom/Albertbauer/Contact/Controller/Backend/StartController.php @@ -14,7 +14,7 @@ use PSC\Shop\EntityBundle\Entity\ContactAddress; use PSC\Shop\EntityBundle\Repository\ContactAddressRepository; use PSC\System\PluginBundle\Form\Chain\Field; use Role; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/var/plugins/Custom/Albertbauer/Useredit/Controller/UsereditController.php b/src/new/var/plugins/Custom/Albertbauer/Useredit/Controller/UsereditController.php index aebcf5e5f..7cf0215d0 100755 --- a/src/new/var/plugins/Custom/Albertbauer/Useredit/Controller/UsereditController.php +++ b/src/new/var/plugins/Custom/Albertbauer/Useredit/Controller/UsereditController.php @@ -8,7 +8,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use FOS\JsRoutingBundle\Controller\Controller as ControllerController; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use PSC\Shop\EntityBundle\Entity\Contact; use PSC\Shop\EntityBundle\Entity\ContactRole; @@ -21,7 +21,7 @@ use Symfony\Component\Routing\Annotation\Route; #[Route("/useredit")] class UsereditController extends AbstractController { - #[Template] + #[Template('@PluginCustomAlbertbauerUsereditController/useredit/update.html.twig')] #[Route("/update", name: "psc_plugin_update_load")] public function updateAction(Request $request, DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security) { @@ -50,7 +50,7 @@ class UsereditController extends AbstractController ); } - #[Template] + #[Template('@PluginCustomAlbertbauerUsereditController/useredit/index.html.twig')] #[Route("/edit/{uid}", name: "psc_plugin_useredit_load")] public function indexAction(Request $request, DocumentManager $documentManager, EntityManagerInterface $entityManager, $uid) { @@ -80,7 +80,7 @@ class UsereditController extends AbstractController ); } - #[Template] + #[Template('@PluginCustomAlbertbauerUsereditController/useredit/new.html.twig')] #[Route("/new", name: "psc_plugin_usernew_load")] public function newAction(Request $request, Shop $shopService, DocumentManager $documentManager, EntityManagerInterface $entityManager) { @@ -142,7 +142,7 @@ class UsereditController extends AbstractController ); } - #[Template] + #[Template('@PluginCustomAlbertbauerUsereditController/useredit/list.html.twig')] #[Route("/list/{filter}/{asc}/{sort}", name: "psc_plugin_userlist_load")] public function listAction(Request $request, Shop $shopService, DocumentManager $documentManager, EntityManagerInterface $entityManager, $filter, $asc, $sort, \Symfony\Component\Security\Core\Security $security) { @@ -234,7 +234,7 @@ class UsereditController extends AbstractController } } - #[Template] + #[Template('@PluginCustomAlbertbauerUsereditController/useredit/out.html.twig')] #[Route("/out/{uid}", name: "psc_plugin_userout_load")] public function outAction(EntityManagerInterface $entityManager, $uid) { diff --git a/src/new/var/plugins/Custom/Grafiker/Register/Controller/RegisterController.php b/src/new/var/plugins/Custom/Grafiker/Register/Controller/RegisterController.php index 765ea9c1b..3f6608984 100755 --- a/src/new/var/plugins/Custom/Grafiker/Register/Controller/RegisterController.php +++ b/src/new/var/plugins/Custom/Grafiker/Register/Controller/RegisterController.php @@ -11,7 +11,7 @@ use PSC\Shop\EntityBundle\Entity\Role; use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\Shop\QueueBundle\Service\Event\Manager; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; @@ -19,7 +19,7 @@ use Symfony\Component\Routing\Annotation\Route; #[Route("/register")] class RegisterController extends AbstractController { - #[Template] + #[Template('@PluginCustomGrafikerRegisterController/register/index.html.twig')] #[Route("/reseller", name: "psc_plugin_register")] public function indexAction(Request $request, EntityManagerInterface $entityManager, DocumentManager $documentManager, \PSC\System\SettingsBundle\Service\Shop $shopService, Manager $eventManager) { diff --git a/src/new/var/plugins/Custom/Huelswitt/Orderimport/Controller/TemplateprintController.php b/src/new/var/plugins/Custom/Huelswitt/Orderimport/Controller/TemplateprintController.php index fa3690ec3..9abf955f9 100755 --- a/src/new/var/plugins/Custom/Huelswitt/Orderimport/Controller/TemplateprintController.php +++ b/src/new/var/plugins/Custom/Huelswitt/Orderimport/Controller/TemplateprintController.php @@ -9,7 +9,7 @@ use PSC\Shop\OrderBundle\Service\Order; use PSC\Shop\QueueBundle\Event\EventManager; use PSC\Shop\QueueBundle\Event\Position\Status\Change; use PSC\Shop\QueueBundle\Service\Event\Manager; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use SimpleXMLElement; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\BinaryFileResponse; @@ -24,7 +24,7 @@ class TemplateprintController extends AbstractController { protected static $key = "p489r7nwpefsnfp0"; - #[Template] + #[Template('@PluginCustomHuelswittOrderimportController/templateprint/index.html.twig')] #[Route("/start/{positionUuid}", name:"psc_plugin_custom_huelswitt_tp_start")] public function indexAction(Order $orderService, $positionUuid) { @@ -63,7 +63,7 @@ class TemplateprintController extends AbstractController } #[Route("/redirect", name:"psc_plugin_custom_huelswitt_tp_redirect")] - #[Template] + #[Template('@PluginCustomHuelswittOrderimportController/templateprint/redirect.html.twig')] public function redirectAction(Request $request) { return []; diff --git a/src/new/var/plugins/Custom/Hug/Contact/Controller/Backend/StartController.php b/src/new/var/plugins/Custom/Hug/Contact/Controller/Backend/StartController.php index 922884d47..a219a850c 100644 --- a/src/new/var/plugins/Custom/Hug/Contact/Controller/Backend/StartController.php +++ b/src/new/var/plugins/Custom/Hug/Contact/Controller/Backend/StartController.php @@ -13,7 +13,7 @@ use PSC\Shop\EntityBundle\Entity\ContactAddress; use PSC\System\PluginBundle\Form\Chain\Field; use PSC\System\SettingsBundle\Service\Log; use Role; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; @@ -29,7 +29,7 @@ class StartController extends AbstractController private readonly DocumentManager $documentManager, ) {} - #[Template] + #[Template('@PluginCustomHugContactControllerBackend/start/start.html.twig')] #[Route('/start', name: 'plugin_custom_hug_contact_importer_start')] public function start( Request $request, diff --git a/src/new/var/plugins/Custom/Krueger/Artikelimport/Queue/Import.php b/src/new/var/plugins/Custom/Krueger/Artikelimport/Queue/Import.php index dce17cc58..fba2355c7 100755 --- a/src/new/var/plugins/Custom/Krueger/Artikelimport/Queue/Import.php +++ b/src/new/var/plugins/Custom/Krueger/Artikelimport/Queue/Import.php @@ -2,7 +2,6 @@ namespace Plugin\Custom\Krueger\Artikelimport\Queue; - use Ddeboer\DataImport\Reader\ArrayReader; use Ddeboer\DataImport\Workflow; use Doctrine\Bundle\MongoDBBundle\ManagerRegistry; @@ -14,17 +13,18 @@ use PSC\Shop\EntityBundle\Document\Queue; use PSC\Shop\EntityBundle\Entity\Account; use PSC\Shop\EntityBundle\Entity\Contact; use PSC\Shop\EntityBundle\Entity\ContactRole; -use PSC\Shop\EntityBundle\Entity\Role; -use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\EntityBundle\Entity\Productgroup; use PSC\Shop\EntityBundle\Entity\ProductProductgroup; +use PSC\Shop\EntityBundle\Entity\Role; +use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\Shop\EntityBundle\Repository\ProductProductgroupRepository; use PSC\Shop\QueueBundle\Event\EventInterface; use PSC\Shop\QueueBundle\Event\Position\Printpartner\Notify; use PSC\Shop\QueueBundle\Type\ConfigurableElementInterface; use PSC\Shop\QueueBundle\Type\QueueInterface; use Ramsey\Uuid\Uuid; +use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Form; use Symfony\Component\Form\FormBuilderInterface; @@ -33,7 +33,6 @@ use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; -use Symfony\Bundle\SecurityBundle\Security; class Import implements QueueInterface, ConfigurableElementInterface { @@ -44,8 +43,12 @@ class Import implements QueueInterface, ConfigurableElementInterface private $_doctrine_mongodb = null; private $_error = null; - function __construct(FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, TokenStorageInterface $securityContext, ManagerRegistry $doctrine_mongodb) - { + function __construct( + FormFactoryInterface $formFactory, + EntityManagerInterface $entityManager, + TokenStorageInterface $securityContext, + ManagerRegistry $doctrine_mongodb, + ) { $this->_formFactory = $formFactory; $this->_entityManager = $entityManager; $this->_securityContext = $securityContext; @@ -80,8 +83,16 @@ class Import implements QueueInterface, ConfigurableElementInterface public function getForm(FormBuilderInterface $builder, $form_options, EventInterface $event) { - $builder->add("file", TextType::class, array('empty_data' => '/data/www/old/data/packages/import/artikel.xml', 'label' => 'Import Datei', 'attr' => array('class' => 'form-element'))); - $builder->add("shop", TextType::class, array('empty_data' => '1', 'label' => 'Shop Id', 'attr' => array('class' => 'form-element'))); + $builder->add('file', TextType::class, [ + 'empty_data' => '/data/www/old/data/packages/import/artikel.xml', + 'label' => 'Import Datei', + 'attr' => ['class' => 'form-element'], + ]); + $builder->add('shop', TextType::class, [ + 'empty_data' => '1', + 'label' => 'Shop Id', + 'attr' => ['class' => 'form-element'], + ]); } public function injectDocument(Form $form, EventInterface $event, Queue $objQueue) @@ -109,33 +120,33 @@ class Import implements QueueInterface, ConfigurableElementInterface */ public function execute(EventInterface $event, Queue $doc) { -//$produktgroupcheck = new Productgroup; -//dump($produktgroupcheck); + //$produktgroupcheck = new Productgroup; + //dump($produktgroupcheck); try { /** @var \Plugin\Custom\Krueger\Artikelimport\Document\Import $queueSettings */ $queueSettings = $doc->getQueueDocument(); - if (file_exists($queueSettings->getFile() . "run_ai.txt")) return true; + if (file_exists($queueSettings->getFile() . 'run_ai.txt')) + return true; - file_put_contents($queueSettings->getFile() . "run_ai.txt", "import"); + file_put_contents($queueSettings->getFile() . 'run_ai.txt', 'import'); set_time_limit(0); if (file_exists($queueSettings->getFile())) { - $article = file_get_contents($queueSettings->getFile()); $xml = simplexml_load_string($article, 'SimpleXMLElement', LIBXML_NOWARNING); $counter = 0; - $group = "groups"; + $group = 'groups'; //sort($xml->tblMaterialGroup->Details_Collection->Details); //dump($xml->tblMaterialGroup->Details_Collection->Details->attributes()->MatGroup_DescDE); - $items = array(); + $items = []; foreach ($xml->tblMaterialGroup->Details_Collection->Details as $item) { //dump($item->attributes()->MatGroup_DescDE); $items[] .= $item->attributes()->MatGroup_DescDE; - }; + } // Custom sort on the names of the items: //usort ($items, function($a, $b) { @@ -143,7 +154,7 @@ class Import implements QueueInterface, ConfigurableElementInterface //}); natsort($items); - $itemsID = array(); + $itemsID = []; $counter = 1; foreach ($items as $item) { //echo $item; @@ -157,22 +168,27 @@ class Import implements QueueInterface, ConfigurableElementInterface //die("TEST"); foreach ($xml->tblMaterialGroup->Details_Collection->Details as $value) { - $selectedShop = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Shop')->findOneBy(array("uid" => intval($queueSettings->getShop()))); + $selectedShop = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Shop') + ->findOneBy(['uid' => intval($queueSettings->getShop())]); - $selectedContakt = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(array("company" => $value->attributes()->MainContactNo1)); + $selectedContakt = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Contact') + ->findOneBy(['company' => $value->attributes()->MainContactNo1]); $variMatGroupNo = $value->attributes()->MatGroup_MatGroupNo; $variGrDescDEName = strtolower($value->attributes()->MatGroup_DescDE); //dump($variMatGroupNo); $variGrDescDE = $value->attributes()->MatGroup_DescDE; - //var_dump( array_key_exists($variGrDescDE, $itemsID) ); $arraykey = array_keys($itemsID, $variGrDescDE); //echo $arraykey[0]; //die("TEST"); - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("metaOGType" => $variMatGroupNo, "shop" => $selectedShop)); + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['metaOGType' => $variMatGroupNo, 'shop' => $selectedShop]); //dump($allGroups); $variGrDescEN = $value->attributes()->GrDescEN; $variGrDescFR = $value->attributes()->GrDescFR; @@ -204,47 +220,44 @@ class Import implements QueueInterface, ConfigurableElementInterface $variSalesInd = $value->attributes()->SalesInd; $variFree9 = $value->attributes()->Free9; $variFree15 = $value->attributes()->PriceOld; - $variDescDE = \str_replace(" ", " ", $variDescDE); - $variFree15 = \str_replace(",", ".", $variFree15); + $variDescDE = \str_replace(' ', ' ', $variDescDE); + $variFree15 = \str_replace(',', '.', $variFree15); - if($variFree15 == "") { + if ($variFree15 == '') { $variFree15 = 0; } if (!$allGroups) { - $productgroup = new Productgroup(); $productgroup->setShop($selectedShop); - if ($variSalesInd == "True") { + if ($variSalesInd == 'True') { $productgroup->setEnable(true); } else { $productgroup->setEnable(false); } - + $productgroup->setMetaOGType($variMatGroupNo); $productgroup->setTitle($variGrDescDE); $productgroup->setUrl($this->clean(strtolower($value->attributes()->MatGroup_DescDE))); $productgroup->setPos($arraykey[0]); - $productgroup->setLanguage("all"); + $productgroup->setLanguage('all'); $this->_entityManager->persist($productgroup); } else { - $allGroups->setShop($selectedShop); - if ($variSalesInd == "True") { + if ($variSalesInd == 'True') { $allGroups->setEnable(true); } else { $allGroups->setEnable(false); } - + $allGroups->setMetaOGType($variMatGroupNo); $allGroups->setTitle($variGrDescDE); $allGroups->setUrl($this->clean(strtolower($value->attributes()->MatGroup_DescDE))); $allGroups->setPos($arraykey[0]); - $allGroups->setLanguage("all"); + $allGroups->setLanguage('all'); $this->_entityManager->persist($allGroups); - } - - if ($counter % 10 == 0) { + + if (($counter % 10) == 0) { $this->_entityManager->flush(); $this->_entityManager->clear(); $this->_doctrine_mongodb->getManager()->flush(); @@ -253,49 +266,55 @@ class Import implements QueueInterface, ConfigurableElementInterface $counter++; } - $counter = 0; - $setproduk = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop)); - foreach($setproduk as $setproduk) { - $setproduk->setMetaKeywords(0); - //$setproduk->setEnable(false); - } - - foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { - $variMaterialNo = $value->attributes()->MaterialNo; - $produktcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variMaterialNo)); - if($produktcheck) { - //dump(intval($produktcheck->getUid())); - $this->_entityManager - ->createQuery(' - DELETE FROM PSCEntityBundle:ProductProductgroup p - WHERE p.product = :product_id')->setParameter('product_id', $produktcheck->getUid())->execute(); - } - } -$inarraycheck = array(); -$inarraycheckb = array(); -/*$counter = 0; -foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { - $variMaterialNo = $value->attributes()->MaterialNo; - $produktcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variMaterialNo)); - - $produktcheck->setUrl(""); - - $this->_entityManager->persist($produktcheck); - if ($counter % 10 == 0) { - $this->_entityManager->flush(); - $this->_entityManager->clear(); - $this->_doctrine_mongodb->getManager()->flush(); - $this->_doctrine_mongodb->getManager()->clear(); - } - $counter++; -}*/ + $setproduk = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop]); + foreach ($setproduk as $setproduk) { + $setproduk->setMetaKeywords(0); + //$setproduk->setEnable(false); + } foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { - $selectedShop = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Shop')->findOneBy(array("uid" => intval($queueSettings->getShop()))); + $variMaterialNo = $value->attributes()->MaterialNo; + $produktcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findOneBy(['shop' => $selectedShop, 'nrIntern' => $variMaterialNo]); + if ($produktcheck) { + //dump(intval($produktcheck->getUid())); + $this->_entityManager + ->createQuery(' + DELETE FROM PSC\Shop\EntityBundle\Entity\ProductProductgroup p + WHERE p.product = :product_id') + ->setParameter('product_id', $produktcheck->getUid()) + ->execute(); + } + } + $inarraycheck = []; + $inarraycheckb = []; + /*$counter = 0; + * foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { + * $variMaterialNo = $value->attributes()->MaterialNo; + * $produktcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variMaterialNo)); + * + * $produktcheck->setUrl(""); + * + * $this->_entityManager->persist($produktcheck); + * if ($counter % 10 == 0) { + * $this->_entityManager->flush(); + * $this->_entityManager->clear(); + * $this->_doctrine_mongodb->getManager()->flush(); + * $this->_doctrine_mongodb->getManager()->clear(); + * } + * $counter++; + * }*/ + + foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { + $selectedShop = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Shop') + ->findOneBy(['uid' => intval($queueSettings->getShop())]); - $variMatGroupNo = $value->attributes()->MatGroupNo; $variGrDescDEName = strtolower($value->attributes()->GrDescDE); @@ -347,35 +366,33 @@ foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { $variFree9 = $value->attributes()->Free9; $variFree15 = $value->attributes()->PriceOld; - - $variDescDE = \str_replace("\n", '', $variDescDE); -/*if($variCustomizable != "") { -//\var_dump($variCustomizable); -$produktcheckcust = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variCustomizable)); -//\var_dump($produktcheckcust); -if($produktcheckcust) { -$produktcheckcust->setEnable(true); -$produktcheckcust->setMetaKeywords(1); -$this->_entityManager->persist($produktcheckcust); -$this->_entityManager->flush(); -//$this->_entityManager->clear(); -} -}*/ - $variFree15 = \str_replace(",", ".", $variFree15); - if($variFree15 == "") { + /*if($variCustomizable != "") { + * //\var_dump($variCustomizable); + * $produktcheckcust = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variCustomizable)); + * //\var_dump($produktcheckcust); + * if($produktcheckcust) { + * $produktcheckcust->setEnable(true); + * $produktcheckcust->setMetaKeywords(1); + * $this->_entityManager->persist($produktcheckcust); + * $this->_entityManager->flush(); + * //$this->_entityManager->clear(); + * } + * }*/ + $variFree15 = \str_replace(',', '.', $variFree15); + if ($variFree15 == '') { $variFree15 = 0; } /* - 0 = per 1 Stück - 1 = per 10 Stück - 2 = per 100 Stück - 3 = per 1000 Stück - 9 = Gesamtpreis - $variPrice - $variPriceInd - $variPalletAmount - */ + * 0 = per 1 Stück + * 1 = per 10 Stück + * 2 = per 100 Stück + * 3 = per 1000 Stück + * 9 = Gesamtpreis + * $variPrice + * $variPriceInd + * $variPalletAmount + */ if ($variPriceInd == 0) { $variPrice = $variPrice; @@ -386,29 +403,29 @@ $this->_entityManager->flush(); $variPriceStep4 = $variPriceStep1; $variPriceStep5 = $variPriceStep1; } else if ($variPriceInd == 1) { - $variPrice = $variPrice / 10 * $variPalletAmount; - $variFree15 = $variFree15 / 10 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 10 * $variPalletAmount; + $variPrice = ($variPrice / 10) * $variPalletAmount; + $variFree15 = ($variFree15 / 10) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 10) * $variPalletAmount; } else if ($variPriceInd == 2) { - $variPrice = $variPrice / 100 * $variPalletAmount; - $variFree15 = $variFree15 / 100 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 100 * $variPalletAmount; + $variPrice = ($variPrice / 100) * $variPalletAmount; + $variFree15 = ($variFree15 / 100) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 100) * $variPalletAmount; } else if ($variPriceInd == 3) { - $variPrice = $variPrice / 1000 * $variPalletAmount; - $variFree15 = $variFree15 / 1000 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 1000 * $variPalletAmount; + $variPrice = ($variPrice / 1000) * $variPalletAmount; + $variFree15 = ($variFree15 / 1000) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 1000) * $variPalletAmount; } else if ($variPriceInd == 9) { $variPrice = $variPrice; $variFree15 = $variFree15; @@ -418,46 +435,58 @@ $this->_entityManager->flush(); $variPriceStep4 = $variPriceStep1; $variPriceStep5 = $variPriceStep1; } - - if ($variDescDE != "") { - $produktcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variMaterialNo)); + + if ($variDescDE != '') { + $produktcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findOneBy(['shop' => $selectedShop, 'nrIntern' => $variMaterialNo]); if (!$produktcheck) { //echo $variDescDE; $product = new Product(); $product->setMetaKeywords(1); $product->setShop($selectedShop); - if ($variClientNo != "") { + if ($variClientNo != '') { $product->setPrivate(1); $product->setMetaAuthor($variClientNo); } $product->setInstall($selectedShop->getInstall()->getUid()); $product->setEnable(true); - $urlcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "title" => $variDescDE)); + $urlcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop, 'title' => $variDescDE]); if (!$urlcheck) { $product->setUrl($this->shortText($this->clean(strtolower($variDescDE)), 100)); - $inurl=$this->shortText($this->clean(strtolower($variDescDE)), 100); + $inurl = $this->shortText($this->clean(strtolower($variDescDE)), 100); } else { - $product->setUrl($this->shortText($this->clean(strtolower($variDescDE)), 100) . "-" . $this->clean(strtolower($variMaterialNo))); - $inurl=$this->shortText($this->clean(strtolower($variDescDE)), 100) . "-" . $this->clean(strtolower($variMaterialNo)); + $product->setUrl( + $this->shortText($this->clean(strtolower($variDescDE)), 100) . + '-' . + $this->clean(strtolower($variMaterialNo)), + ); + $inurl = + $this->shortText($this->clean(strtolower($variDescDE)), 100) . + '-' . + $this->clean(strtolower($variMaterialNo)); } - if ($variMaterialNo != "") { - $bestellnr = ''; + if ($variMaterialNo != '') { + $bestellnr = + ''; } else { - $bestellnr = ""; + $bestellnr = ''; } - if ($variColor != "") { - $farbe = "
Farbe:" . $variColor; + if ($variColor != '') { + $farbe = '
Farbe:' . $variColor; } else { - $farbe = ""; + $farbe = ''; } - if ($variWeight2 != "") { - $gewicht = "
Gewicht:" . $variWeight2; + if ($variWeight2 != '') { + $gewicht = '
Gewicht:' . $variWeight2; } else { - $gewicht = ""; + $gewicht = ''; } $product->setTitle($variDescDE); - $product->setCustomTabText(""); + $product->setCustomTabText(''); $product->setConfirm(false); $product->setNotEdit(false); $product->setConfirmOne(false); @@ -472,34 +501,64 @@ $this->_entityManager->flush(); $product->setMwert(19); $productmwst = 19; } - if($variPrice == NULL) { + if ($variPrice == null) { $product->setCanBuyWithNoPrice(true); } $product->setNrIntern($variMaterialNo); - $teile = explode(" ", $variMaterialNo); - $teile = explode("-", $teile[0]); - $teile = explode("/", $teile[0]); + $teile = explode(' ', $variMaterialNo); + $teile = explode('-', $teile[0]); + $teile = explode('/', $teile[0]); $number = str_replace(['+', '-'], '', filter_var($teile[0], FILTER_SANITIZE_NUMBER_INT)); $product->setPos($number); - $product->setUploadProduct(""); - $product->setUploadPost(""); - $product->setUploadEmail(""); - $product->setUploadCenter(""); - $product->setHintText(""); + $product->setUploadProduct(''); + $product->setUploadPost(''); + $product->setUploadEmail(''); + $product->setUploadCenter(''); + $product->setHintText(''); $product->setMetaOgImage($variImage); $product->setMetaOgUrl($variPreview); $product->setMetaOgType($variWeight2); $product->setMetaOgTitle($bestellnr); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $variISSFCertificateIn = $variISSFCertificate; } else { $variISSFCertificateIn = 0; } - $product->setMetaDescription("Color=>" . $variColor . ",Diameter=>" . $variDiameter . ",Length=>" . $variLength . ",Width=>" . $variWidth . ",PalletAmount=>" . $variPalletAmount . ",Weight2=>" . $variWeight2 . ",ISSFCertificate=>" . $variISSFCertificateIn . ",DSBSignum=>" . $variFree9 . ",NewPrice=>" .round($variPrice, 2) . ",OldPrice=>" .$variFree15 . ",PriceInd=>" . $variPriceInd . "," . "PriceOut=>" . round($variPriceout, 2) . "," . "Custom=>" . $variCustomizable . ","); + $product->setMetaDescription( + 'Color=>' . + $variColor . + ',Diameter=>' . + $variDiameter . + ',Length=>' . + $variLength . + ',Width=>' . + $variWidth . + ',PalletAmount=>' . + $variPalletAmount . + ',Weight2=>' . + $variWeight2 . + ',ISSFCertificate=>' . + $variISSFCertificateIn . + ',DSBSignum=>' . + $variFree9 . + ',NewPrice=>' . + round($variPrice, 2) . + ',OldPrice=>' . + $variFree15 . + ',PriceInd=>' . + $variPriceInd . + ',' . + 'PriceOut=>' . + round($variPriceout, 2) . + ',' . + 'Custom=>' . + $variCustomizable . + ',', + ); if ($variPalletAmount == 1) { - $stueckvari = "Stück"; + $stueckvari = 'Stück'; } else { - $stueckvari = $variPalletAmount . " Stück"; + $stueckvari = $variPalletAmount . ' Stück'; } if ($variTaxKey == 5) { $variPriceInklMwSt = $variPrice * 1.07; @@ -510,16 +569,35 @@ $this->_entityManager->flush(); } $bruttopreis = number_format(round($variPriceInklMwSt, 2), 2, ',', ''); $nettopreis = number_format(round($variPrice, 2), 2, ',', ''); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $product->setMetaAuthor($variISSFCertificate); } if ($variAsOfAmount1b != intval(0)) { - $product->setMetaOgDescription(' '); - $staffelpreis = 'Preisstaffel:
von 1 bis ' . $variAsOfAmount1 . ' = ' . $this->cutNumber(round($variPrice, 2)) . ' Euro
ab: ' . $variAsOfAmount1b . ' = ' . $this->cutNumber(round($variPriceStep1,2)) . ' Euro'; - $description = "" . $variAddDescDE . "
" . $variAdd2DescDE; + $product->setMetaOgDescription(' '); + $staffelpreis = + 'Preisstaffel:
von 1 bis ' . + $variAsOfAmount1 . + ' = ' . + $this->cutNumber(round($variPrice, 2)) . + ' Euro
ab: ' . + $variAsOfAmount1b . + ' = ' . + $this->cutNumber(round($variPriceStep1, 2)) . + ' Euro'; + $description = '' . $variAddDescDE . '
' . $variAdd2DescDE; $product->setMetaCustomTitle($staffelpreis); $product->setType(6); - if ($variWeight2 != "" AND $variWeight2 != NULL) { + if ($variWeight2 != '' and $variWeight2 != null) { $gewichtinkalk = $variWeight2 * 1000; $gewichtinkalk = intval($gewicht); } else { @@ -527,36 +605,66 @@ $this->_entityManager->flush(); } $product->setCalcXml(' - ' . str_replace(array("
", "
", "&", "$", " "), " ", $variDescDE) . '
+ ' . + str_replace(['
', '
', '&', '$', ' '], ' ', $variDescDE) . + '
'); } else { - if ($variISSFCertificate != NULL) { - $product->setMetaOgDescription(' '); + if ($variISSFCertificate != null) { + $product->setMetaOgDescription(' '); } else { - $product->setMetaOgDescription('
'); + $product->setMetaOgDescription('
'); } - $description = "
" . $variAddDescDE . "
" . $variAdd2DescDE . "
"; + $description = '
' . $variAddDescDE . '
' . $variAdd2DescDE . '
'; $product->setType(2); - $product->setCalcXml(NULL); + $product->setCalcXml(null); } $product->setDescription($description); $this->_entityManager->persist($product); - - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $variMatGroupNo)); + + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $variMatGroupNo]); //\dump(intval($product->getUid())); //\dump(intval($allGroups->getUid())); if ($allGroups) { @@ -566,20 +674,21 @@ $this->_entityManager->flush(); $this->_entityManager->persist($artikelingroup); } - - if ($variMatGroupNoPlus != NULL) { - $teile = explode(";", $variMatGroupNoPlus); + if ($variMatGroupNoPlus != null) { + $teile = explode(';', $variMatGroupNoPlus); foreach ($teile as $key => $teile) { - if($teile != $variMatGroupNo) { - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $teile)); - if ($allGroups) { - $artikelingroup = new ProductProductgroup(); - $artikelingroup->setProduct($product); - $artikelingroup->setGroup(intval($allGroups->getUid())); - $this->_entityManager->persist($artikelingroup); + if ($teile != $variMatGroupNo) { + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $teile]); + if ($allGroups) { + $artikelingroup = new ProductProductgroup(); + $artikelingroup->setProduct($product); + $artikelingroup->setGroup(intval($allGroups->getUid())); + $this->_entityManager->persist($artikelingroup); + } } } - } } } else { $produktcheck->setMetaKeywords(1); @@ -587,38 +696,48 @@ $this->_entityManager->flush(); $produktcheck->setInstall($selectedShop->getInstall()->getUid()); $produktcheck->setType(2); $produktcheck->setEnable(true); - $urlcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "title" => $variDescDE)); + $urlcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop, 'title' => $variDescDE]); if (count($urlcheck) == 1) { $produktcheck->setUrl($this->shortText($this->clean(strtolower($variDescDE)), 100)); - $inurl=$this->shortText($this->clean(strtolower($variDescDE)), 100); + $inurl = $this->shortText($this->clean(strtolower($variDescDE)), 100); } else { - $produktcheck->setUrl($this->shortText($this->clean(strtolower($variDescDE)), 100) . "-" . $this->clean(strtolower($variMaterialNo))); - $inurl=$this->shortText($this->clean(strtolower($variDescDE)), 100) . "-" . $this->clean(strtolower($variMaterialNo)); + $produktcheck->setUrl( + $this->shortText($this->clean(strtolower($variDescDE)), 100) . + '-' . + $this->clean(strtolower($variMaterialNo)), + ); + $inurl = + $this->shortText($this->clean(strtolower($variDescDE)), 100) . + '-' . + $this->clean(strtolower($variMaterialNo)); } - if ($variClientNo != "") { + if ($variClientNo != '') { $produktcheck->setPrivate(1); $produktcheck->setMetaAuthor($variClientNo); } //Je Verpackungseinheit //IF Abfragen für Farbe und Co. - if ($variMaterialNo != "") { - $bestellnr = ''; + if ($variMaterialNo != '') { + $bestellnr = + ''; } else { - $bestellnr = ""; + $bestellnr = ''; } - if ($variColor != "") { - $farbe = "
Farbe:" . $variColor; + if ($variColor != '') { + $farbe = '
Farbe:' . $variColor; } else { - $farbe = ""; + $farbe = ''; } - if ($variWeight2 != "") { - $gewicht = "
Gewicht:" . $variWeight2; + if ($variWeight2 != '') { + $gewicht = '
Gewicht:' . $variWeight2; } else { - $gewicht = ""; + $gewicht = ''; } $produktcheck->setTitle($variDescDE); - $produktcheck->setCustomTabText(""); + $produktcheck->setCustomTabText(''); $produktcheck->setConfirm(false); $produktcheck->setNotEdit(false); $produktcheck->setConfirmOne(false); @@ -633,43 +752,72 @@ $this->_entityManager->flush(); $produktcheck->setMwert(19); $productmwst = 19; } - if($variPrice == NULL) { + if ($variPrice == null) { $produktcheck->setCanBuyWithNoPrice(true); } $produktcheck->setNrIntern($variMaterialNo); - $teile = explode(" ", $variMaterialNo); - $teile = explode("-", $teile[0]); - $teile = explode("/", $teile[0]); + $teile = explode(' ', $variMaterialNo); + $teile = explode('-', $teile[0]); + $teile = explode('/', $teile[0]); $number = str_replace(['+', '-'], '', filter_var($teile[0], FILTER_SANITIZE_NUMBER_INT)); $produktcheck->setPos($number); - $produktcheck->setUploadProduct(""); - $produktcheck->setHintText(""); - $produktcheck->setUploadPost(""); - $produktcheck->setUploadEmail(""); - $produktcheck->setUploadCenter(""); + $produktcheck->setUploadProduct(''); + $produktcheck->setHintText(''); + $produktcheck->setUploadPost(''); + $produktcheck->setUploadEmail(''); + $produktcheck->setUploadCenter(''); $produktcheck->setMetaOgImage($variImage); $produktcheck->setMetaOgUrl($variPreview); $produktcheck->setMetaOgType($variWeight2); $produktcheck->setMetaOgTitle($bestellnr); + $urlcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop, 'title' => $variDescDE]); - $urlcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "title" => $variDescDE)); + $inurl = $produktcheck->getUrl(); - $inurl=$produktcheck->getUrl(); - - - - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $variISSFCertificateIn = $variISSFCertificate; } else { $variISSFCertificateIn = 0; } - $produktcheck->setMetaDescription("Color=>" . $variColor . ",Diameter=>" . $variDiameter . ",Length=>" . $variLength . ",Width=>" . $variWidth . ",PalletAmount=>" . $variPalletAmount . ",Weight2=>" . $variWeight2 . ",ISSFCertificate=>" . $variISSFCertificateIn . ",DSBSignum=>" . $variFree9 . ",NewPrice=>" .round($variPrice, 2) . ",OldPrice=>" .$variFree15 . ",PriceInd=>" . $variPriceInd . "," . "PriceOut=>" . round($variPriceout, 2) . "," . "Custom=>" . $variCustomizable . ","); + $produktcheck->setMetaDescription( + 'Color=>' . + $variColor . + ',Diameter=>' . + $variDiameter . + ',Length=>' . + $variLength . + ',Width=>' . + $variWidth . + ',PalletAmount=>' . + $variPalletAmount . + ',Weight2=>' . + $variWeight2 . + ',ISSFCertificate=>' . + $variISSFCertificateIn . + ',DSBSignum=>' . + $variFree9 . + ',NewPrice=>' . + round($variPrice, 2) . + ',OldPrice=>' . + $variFree15 . + ',PriceInd=>' . + $variPriceInd . + ',' . + 'PriceOut=>' . + round($variPriceout, 2) . + ',' . + 'Custom=>' . + $variCustomizable . + ',', + ); if ($variPalletAmount == 1) { - $stueckvari = "Stück"; + $stueckvari = 'Stück'; } else { - $stueckvari = $variPalletAmount . " Stück"; + $stueckvari = $variPalletAmount . ' Stück'; } if ($variTaxKey == 5) { $variPriceInklMwSt = $variPrice * 1.07; @@ -681,16 +829,35 @@ $this->_entityManager->flush(); $bruttopreis = number_format(round($variPriceInklMwSt, 2), 2, ',', ''); $nettopreis = number_format(round($variPrice, 2), 2, ',', ''); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $produktcheck->setMetaAuthor($variISSFCertificate); } if ($variAsOfAmount1b != intval(0)) { - $produktcheck->setMetaOgDescription(' '); - $staffelpreis = 'Preisstaffel:
von 1 bis ' . $variAsOfAmount1 . ' = ' . $this->cutNumber(round($variPrice, 2)) . ' Euro
ab: ' . $variAsOfAmount1b . ' = ' . $this->cutNumber(round($variPriceStep1, 2)) . ' Euro'; - $description = "" . $variAddDescDE . "
" . $variAdd2DescDE; + $produktcheck->setMetaOgDescription(' '); + $staffelpreis = + 'Preisstaffel:
von 1 bis ' . + $variAsOfAmount1 . + ' = ' . + $this->cutNumber(round($variPrice, 2)) . + ' Euro
ab: ' . + $variAsOfAmount1b . + ' = ' . + $this->cutNumber(round($variPriceStep1, 2)) . + ' Euro'; + $description = '' . $variAddDescDE . '
' . $variAdd2DescDE; $produktcheck->setMetaCustomTitle($staffelpreis); $produktcheck->setType(6); - if ($variWeight2 != "" AND $variWeight2 != NULL) { + if ($variWeight2 != '' and $variWeight2 != null) { $gewichtinkalk = $variWeight2 * 1000; $gewichtinkalk = intval($gewichtinkalk); } else { @@ -698,55 +865,83 @@ $this->_entityManager->flush(); } $produktcheck->setCalcXml(' - ' . str_replace(array("
", "
", "&", "$", " "), " ", $variDescDE) . '
+ ' . + str_replace(['
', '
', '&', '$', ' '], ' ', $variDescDE) . + '
'); } else { - if ($variISSFCertificate != NULL) { - $produktcheck->setMetaOgDescription(' '); - } else { - $produktcheck->setMetaOgDescription('
'); - } - $description = "
" . $variAddDescDE . "
" . $variAdd2DescDE . "
"; + if ($variISSFCertificate != null) { + $produktcheck->setMetaOgDescription(' '); + } else { + $produktcheck->setMetaOgDescription('
'); + } + $description = '
' . $variAddDescDE . '
' . $variAdd2DescDE . '
'; $produktcheck->setType(2); - $produktcheck->setCalcXml(NULL); + $produktcheck->setCalcXml(null); } $produktcheck->setDescription($description); $this->_entityManager->persist($produktcheck); - if ($variWeight2 != "" AND $variWeight2 != NULL) { + if ($variWeight2 != '' and $variWeight2 != null) { $gewicht = $variWeight2 * 1000; $gewicht = intval($gewicht); } else { $gewicht = 0; } -/* -if($variMaterialNo == "3200 S") -{ - \var_dump((string)$produktcheck->getUid()); - \var_dump($variWeight2); - \var_dump($gewicht); - \var_dump($productDoc); -} -*/ + /* + * if($variMaterialNo == "3200 S") + * { + * \var_dump((string)$produktcheck->getUid()); + * \var_dump($variWeight2); + * \var_dump($gewicht); + * \var_dump($productDoc); + * } + */ /** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */ $productDoc = $this->_doctrine_mongodb ->getRepository('PSC\Shop\EntityBundle\Document\Product') - ->findOneBy(array('uid' => (string)$produktcheck->getUid())); + ->findOneBy(['uid' => (string) $produktcheck->getUid()]); if ($productDoc) { $productDoc->setUid($produktcheck->getUid()); @@ -758,20 +953,27 @@ if($variMaterialNo == "3200 S") $productDoc->setWeight($gewicht); $this->_doctrine_mongodb->getManager()->persist($productDoc); } - - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $variMatGroupNo)); + + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $variMatGroupNo]); //\dump(intval($produktcheck->getUid())); //\dump(intval($allGroups->getUid())); - - if (in_array(intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()), $inarraycheck)) { + + if ( + in_array( + intval($produktcheck->getUid()) . ';' . intval($allGroups->getUid()), + $inarraycheck, + ) + ) { //dump("1 IST DRIN!!!"); $notinsert = true; } else { //dump("1 IST NICHT DRIN!!!"); $notinsert = false; - $inarraycheck[] .= intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()); + $inarraycheck[] .= intval($produktcheck->getUid()) . ';' . intval($allGroups->getUid()); } - if ($allGroups AND !$notinsert) { + if ($allGroups and !$notinsert) { //echo "HIER 1"; $artikelingroup = new ProductProductgroup(); $artikelingroup->setProduct($produktcheck); @@ -779,78 +981,109 @@ if($variMaterialNo == "3200 S") $this->_entityManager->persist($artikelingroup); } - - if ($variMatGroupNoPlus != NULL) { - $teile = explode(";", $variMatGroupNoPlus); + if ($variMatGroupNoPlus != null) { + $teile = explode(';', $variMatGroupNoPlus); foreach ($teile as $key => $teile) { - if($teile != $variMatGroupNo) { - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $teile)); + if ($teile != $variMatGroupNo) { + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $teile]); - if ($allGroups AND in_array(intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()), $inarraycheckb)) { - //dump("2 IST DRIN!!!"); - $notinsertb = true; - } else { - if($allGroups) { - //dump("2 IST NICHT DRIN!!!"); - $notinsertb = false; - $inarraycheckb[] .= intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()); + if ( + $allGroups and + in_array( + intval($produktcheck->getUid()) . + ';' . + intval($allGroups->getUid()), + $inarraycheckb, + ) + ) { + //dump("2 IST DRIN!!!"); + $notinsertb = true; + } else { + if ($allGroups) { + //dump("2 IST NICHT DRIN!!!"); + $notinsertb = false; + $inarraycheckb[] .= + intval($produktcheck->getUid()) . + ';' . + intval($allGroups->getUid()); + } + } + + if ($allGroups and !$notinsertb) { + //echo "HIER 2"; + $artikelingroup = new ProductProductgroup(); + $artikelingroup->setProduct($produktcheck); + $artikelingroup->setGroup(intval($allGroups->getUid())); + $this->_entityManager->persist($artikelingroup); } } - - if ($allGroups AND !$notinsertb) { - //echo "HIER 2"; - $artikelingroup = new ProductProductgroup(); - $artikelingroup->setProduct($produktcheck); - $artikelingroup->setGroup(intval($allGroups->getUid())); - $this->_entityManager->persist($artikelingroup); - } - } } } } } - if ($counter % 10 == 0) { + if (($counter % 10) == 0) { $this->_entityManager->flush(); $this->_entityManager->clear(); $this->_doctrine_mongodb->getManager()->flush(); $this->_doctrine_mongodb->getManager()->clear(); } - - $counter++; - - } - $produktcheckcust = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "nrIntern" => array("MS-260X260", "MS-140X135", "MS-200X200", "MS-100X100", "MS-110X110", "MS-120X120", "MS-170X170", "MS-320X450", "MS-450X320", "MS-210X297", "MS-450X320_Scheibenpuzzle"))); - //\var_dump($produktcheckcust); - foreach($produktcheckcust as $produktcheckcust) { - if($produktcheckcust) { - $produktcheckcust->setEnable(true); - $produktcheckcust->setMetaKeywords(1); - $this->_entityManager->persist($produktcheckcust); - $this->_entityManager->flush(); - //$this->_entityManager->clear(); - } - } - $produktchecknoActive = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop)); -$exportProdukte = []; -foreach($produktchecknoActive as $produktchecknoActive) { - //\dump($produktchecknoActive->getUid()); - if($produktchecknoActive->getMetaKeywords() == "1") { - $produktchecknoActive->setEnable(true); - $exportProdukte[] = $produkt; - $this->generateGoogleMerchantXml($xml, $queueSettings->getShop(), $exportProdukte); - } else { - $produktchecknoActive->setEnable(NULL); - } -} -$this->_entityManager->flush(); -$this->_entityManager->clear(); - + $counter++; + } + $produktcheckcust = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy([ + 'shop' => $selectedShop, + 'nrIntern' => [ + 'MS-260X260', + 'MS-140X135', + 'MS-200X200', + 'MS-100X100', + 'MS-110X110', + 'MS-120X120', + 'MS-170X170', + 'MS-320X450', + 'MS-450X320', + 'MS-210X297', + 'MS-450X320_Scheibenpuzzle', + ], + ]); + //\var_dump($produktcheckcust); + foreach ($produktcheckcust as $produktcheckcust) { + if ($produktcheckcust) { + $produktcheckcust->setEnable(true); + $produktcheckcust->setMetaKeywords(1); + $this->_entityManager->persist($produktcheckcust); + $this->_entityManager->flush(); + + //$this->_entityManager->clear(); + } + } + $produktchecknoActive = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop]); + $exportProdukte = []; + foreach ($produktchecknoActive as $produktchecknoActive) { + //\dump($produktchecknoActive->getUid()); + if ($produktchecknoActive->getMetaKeywords() == '1') { + $produktchecknoActive->setEnable(true); + $exportProdukte[] = $produkt; + $this->generateGoogleMerchantXml($xml, $queueSettings->getShop(), $exportProdukte); + } else { + $produktchecknoActive->setEnable(null); + } + } + + $this->_entityManager->flush(); + $this->_entityManager->clear(); + rename($queueSettings->getFile(), $queueSettings->getFile() . '.old'); } - unlink($queueSettings->getFile() . "run_ai.txt"); + unlink($queueSettings->getFile() . 'run_ai.txt'); } catch (\Exception $e) { echo $e->getMessage(); return false; @@ -876,137 +1109,159 @@ $this->_entityManager->clear(); { if (strlen($string) > $lenght) { $string = substr($string, 0, $lenght); - $string_ende = strrchr($string, ""); - $string = str_replace($string_ende, "-", $string); + $string_ende = strrchr($string, ''); + $string = str_replace($string_ende, '-', $string); } return $string; } - function cutNumber($number, $decimals=2) { - $number = explode(".", $number, 2); + + function cutNumber($number, $decimals = 2) + { + $number = explode('.', $number, 2); //print_r($number); - if(!isset($number[1])) { - return $number[0].".00"; + if (!isset($number[1])) { + return $number[0] . '.00'; } else { - return $number[0].".".substr($number[1].str_repeat("0", $decimals), 0, $decimals); + return $number[0] . '.' . substr($number[1] . str_repeat('0', $decimals), 0, $decimals); } - } - -private function generateGoogleMerchantXml($xml, $shopId, $produktchecknoActive) -{ - $outputFile = '/data/www/old/data/packages/import/google_merchants.xml'; - $baseImageUrl = 'https://www.krueger-scheiben.de/styles/vorlagen/kdv_b3_dev/product_images/'; - $placeholderImg = 'placeholder.jpg'; - $baseProductUrl = 'https://www.krueger-scheiben.de/article/show/'; - $currency = 'EUR'; - - $rssDom = new \DOMDocument('1.0', 'utf-8'); - $rssDom->formatOutput = true; - - $rss = $rssDom->createElement('rss'); - $rss->setAttribute('version', '2.0'); - $rss->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:g', 'http://base.google.com/ns/1.0'); - $rssDom->appendChild($rss); - - $channel = $rssDom->createElement('channel'); - $channel->appendChild($rssDom->createElement('title', 'Krüger Scheiben - Google Merchant Feed')); - $channel->appendChild($rssDom->createElement('link', 'https://www.krueger-scheiben.de')); - $channel->appendChild($rssDom->createElement('description', 'Automatisch generierter Produktfeed aus täglichem Artikelimport')); - $rss->appendChild($channel); - - $exportCount = 0; - $skipped = 0; - - foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { - - $variMaterialNo = (string)$value->attributes()->MaterialNo; - $variDescDE = (string)$value->attributes()->DescDE; - $variAddDescDE = (string)$value->attributes()->AddDescDE; - $variAdd2DescDE = (string)$value->attributes()->Add2DescDE; - $variImage = (string)$value->attributes()->Image; - $variClientNo = (string)$value->attributes()->ClientNo; - $variPrice = (float)$value->attributes()->Price; - $variPriceInd = (int)$value->attributes()->PriceInd; - $variPalletAmount = (int)$value->attributes()->PalletAmount; - $variAsOfAmount1 = (int)$value->attributes()->AsOfAmount1; - $variPriceStep1 = (float)$value->attributes()->PriceStep1; - $variTaxKey = (int)$value->attributes()->TaxKey; - $variEAN = (string)$value->attributes()->EAN; - - // --- Filter --- - if ($variClientNo !== '' || stripos($variDescDE, 'Gutschrift') !== false) { - $skipped++; - continue; - } - - // --- URL exakt wie im Import --- - $urlcheck = $this->_entityManager - ->getRepository('PSC\Shop\EntityBundle\Entity\Product') - ->findBy(['shop' => $shopId, 'title' => $variDescDE]); - - if (count($urlcheck) == 1) { - $inurl = $this->shortText($this->clean(strtolower($variDescDE)), 100); - } else { - $inurl = $this->shortText($this->clean(strtolower($variDescDE)), 100) . '-' . - $this->clean(strtolower($variMaterialNo)); - } - - $productUrl = $baseProductUrl . $inurl; - - // --- Preislogik --- - switch ($variPriceInd) { - case 1: $variPrice /= 10; $variPriceStep1 /= 10; break; - case 2: $variPrice /= 100; $variPriceStep1 /= 100; break; - case 3: $variPrice /= 1000; $variPriceStep1 /= 1000; break; - default: break; - } - $variPrice *= $variPalletAmount; - $variPriceStep1 *= $variPalletAmount; - - // --- MwSt --- - $mwstFactor = ($variTaxKey == 5 || $variTaxKey == 21) ? 1.07 : 1.19; - $priceGross = $variPrice * $mwstFactor; - $priceStep1Gross = $variPriceStep1 * $mwstFactor; - - // --- Beschreibung --- - $description = $variAddDescDE . "\n" . $variAdd2DescDE; - if ($variAsOfAmount1 > 0 && $variPriceStep1 > 0) { - $description .= "\nPreisstaffel: 1–{$variAsOfAmount1} = " - . number_format($priceGross, 2, ',', '') . " € / ab {$variAsOfAmount1} = " - . number_format($priceStep1Gross, 2, ',', '') . " €"; - } - - // --- Bild --- - $imgUrl = ($variImage && strtolower($variImage) !== 'none.jpg') - ? $baseImageUrl . rawurlencode($variImage) - : $baseImageUrl . $placeholderImg; - - // --- XML-Item --- - $item = $rssDom->createElement('item'); - $item->appendChild($rssDom->createElement('g:id', htmlspecialchars($variMaterialNo))); - $item->appendChild($rssDom->createElement('title', htmlspecialchars($variDescDE))); - $item->appendChild($rssDom->createElement('description', htmlspecialchars($description))); - $item->appendChild($rssDom->createElement('link', $productUrl)); - $item->appendChild($rssDom->createElement('g:image_link', $imgUrl)); - $item->appendChild($rssDom->createElement('g:price', number_format($priceGross, 2, '.', '') . ' ' . $currency)); - $item->appendChild($rssDom->createElement('g:unit_pricing_measure', max(1, $variPalletAmount) . ' Stück')); - $item->appendChild($rssDom->createElement('g:unit_pricing_base_measure', '1 Stück')); - - if ($variEAN !== '') { - $item->appendChild($rssDom->createElement('g:gtin', htmlspecialchars($variEAN))); - } - - $item->appendChild($rssDom->createElement('g:availability', 'in stock')); - $item->appendChild($rssDom->createElement('g:condition', 'new')); - $channel->appendChild($item); - - $exportCount++; } - $rssDom->save($outputFile); + private function generateGoogleMerchantXml($xml, $shopId, $produktchecknoActive) + { + $outputFile = '/data/www/old/data/packages/import/google_merchants.xml'; + $baseImageUrl = 'https://www.krueger-scheiben.de/styles/vorlagen/kdv_b3_dev/product_images/'; + $placeholderImg = 'placeholder.jpg'; + $baseProductUrl = 'https://www.krueger-scheiben.de/article/show/'; + $currency = 'EUR'; - echo "✅ Google Merchant Feed erzeugt: $outputFile\n"; - echo "📦 Exportiert: $exportCount Produkte\n"; - echo "🚫 Übersprungen: $skipped Produkte\n"; + $rssDom = new \DOMDocument('1.0', 'utf-8'); + $rssDom->formatOutput = true; + + $rss = $rssDom->createElement('rss'); + $rss->setAttribute('version', '2.0'); + $rss->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:g', 'http://base.google.com/ns/1.0'); + $rssDom->appendChild($rss); + + $channel = $rssDom->createElement('channel'); + $channel->appendChild($rssDom->createElement('title', 'Krüger Scheiben - Google Merchant Feed')); + $channel->appendChild($rssDom->createElement('link', 'https://www.krueger-scheiben.de')); + $channel->appendChild($rssDom->createElement( + 'description', + 'Automatisch generierter Produktfeed aus täglichem Artikelimport', + )); + $rss->appendChild($channel); + + $exportCount = 0; + $skipped = 0; + + foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { + $variMaterialNo = (string) $value->attributes()->MaterialNo; + $variDescDE = (string) $value->attributes()->DescDE; + $variAddDescDE = (string) $value->attributes()->AddDescDE; + $variAdd2DescDE = (string) $value->attributes()->Add2DescDE; + $variImage = (string) $value->attributes()->Image; + $variClientNo = (string) $value->attributes()->ClientNo; + $variPrice = (float) $value->attributes()->Price; + $variPriceInd = (int) $value->attributes()->PriceInd; + $variPalletAmount = (int) $value->attributes()->PalletAmount; + $variAsOfAmount1 = (int) $value->attributes()->AsOfAmount1; + $variPriceStep1 = (float) $value->attributes()->PriceStep1; + $variTaxKey = (int) $value->attributes()->TaxKey; + $variEAN = (string) $value->attributes()->EAN; + + // --- Filter --- + if ($variClientNo !== '' || stripos($variDescDE, 'Gutschrift') !== false) { + $skipped++; + continue; + } + + // --- URL exakt wie im Import --- + $urlcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $shopId, 'title' => $variDescDE]); + + if (count($urlcheck) == 1) { + $inurl = $this->shortText($this->clean(strtolower($variDescDE)), 100); + } else { + $inurl = + $this->shortText($this->clean(strtolower($variDescDE)), 100) . + '-' . + $this->clean(strtolower($variMaterialNo)); + } + + $productUrl = $baseProductUrl . $inurl; + + // --- Preislogik --- + switch ($variPriceInd) { + case 1: + $variPrice /= 10; + $variPriceStep1 /= 10; + break; + case 2: + $variPrice /= 100; + $variPriceStep1 /= 100; + break; + case 3: + $variPrice /= 1000; + $variPriceStep1 /= 1000; + break; + default: + break; + } + $variPrice *= $variPalletAmount; + $variPriceStep1 *= $variPalletAmount; + + // --- MwSt --- + $mwstFactor = $variTaxKey == 5 || $variTaxKey == 21 ? 1.07 : 1.19; + $priceGross = $variPrice * $mwstFactor; + $priceStep1Gross = $variPriceStep1 * $mwstFactor; + + // --- Beschreibung --- + $description = $variAddDescDE . "\n" . $variAdd2DescDE; + if ($variAsOfAmount1 > 0 && $variPriceStep1 > 0) { + $description .= + "\nPreisstaffel: 1–{$variAsOfAmount1} = " . + number_format($priceGross, 2, ',', '') . + " € / ab {$variAsOfAmount1} = " . + number_format($priceStep1Gross, 2, ',', '') . + ' €'; + } + + // --- Bild --- + $imgUrl = $variImage && strtolower($variImage) !== 'none.jpg' + ? ($baseImageUrl . rawurlencode($variImage)) + : ($baseImageUrl . $placeholderImg); + + // --- XML-Item --- + $item = $rssDom->createElement('item'); + $item->appendChild($rssDom->createElement('g:id', htmlspecialchars($variMaterialNo))); + $item->appendChild($rssDom->createElement('title', htmlspecialchars($variDescDE))); + $item->appendChild($rssDom->createElement('description', htmlspecialchars($description))); + $item->appendChild($rssDom->createElement('link', $productUrl)); + $item->appendChild($rssDom->createElement('g:image_link', $imgUrl)); + $item->appendChild($rssDom->createElement( + 'g:price', + number_format($priceGross, 2, '.', '') . ' ' . $currency, + )); + $item->appendChild($rssDom->createElement('g:unit_pricing_measure', max(1, $variPalletAmount) . ' Stück')); + $item->appendChild($rssDom->createElement('g:unit_pricing_base_measure', '1 Stück')); + + if ($variEAN !== '') { + $item->appendChild($rssDom->createElement('g:gtin', htmlspecialchars($variEAN))); + } + + $item->appendChild($rssDom->createElement('g:availability', 'in stock')); + $item->appendChild($rssDom->createElement('g:condition', 'new')); + $channel->appendChild($item); + + $exportCount++; + } + + $rssDom->save($outputFile); + + echo "✅ Google Merchant Feed erzeugt: {$outputFile}\n"; + echo "📦 Exportiert: {$exportCount} Produkte\n"; + echo "🚫 Übersprungen: {$skipped} Produkte\n"; + } } - } \ No newline at end of file diff --git a/src/new/var/plugins/Custom/Krueger/ArtikelimportEN/Queue/Import.php b/src/new/var/plugins/Custom/Krueger/ArtikelimportEN/Queue/Import.php index b00b47947..08cb96a93 100755 --- a/src/new/var/plugins/Custom/Krueger/ArtikelimportEN/Queue/Import.php +++ b/src/new/var/plugins/Custom/Krueger/ArtikelimportEN/Queue/Import.php @@ -2,7 +2,6 @@ namespace Plugin\Custom\Krueger\ArtikelimportEN\Queue; - use Ddeboer\DataImport\Reader\ArrayReader; use Ddeboer\DataImport\Workflow; use Doctrine\Bundle\MongoDBBundle\ManagerRegistry; @@ -14,17 +13,18 @@ use PSC\Shop\EntityBundle\Document\Queue; use PSC\Shop\EntityBundle\Entity\Account; use PSC\Shop\EntityBundle\Entity\Contact; use PSC\Shop\EntityBundle\Entity\ContactRole; -use PSC\Shop\EntityBundle\Entity\Role; -use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\EntityBundle\Entity\Productgroup; use PSC\Shop\EntityBundle\Entity\ProductProductgroup; +use PSC\Shop\EntityBundle\Entity\Role; +use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\Shop\EntityBundle\Repository\ProductProductgroupRepository; use PSC\Shop\QueueBundle\Event\EventInterface; use PSC\Shop\QueueBundle\Event\Position\Printpartner\Notify; use PSC\Shop\QueueBundle\Type\ConfigurableElementInterface; use PSC\Shop\QueueBundle\Type\QueueInterface; use Ramsey\Uuid\Uuid; +use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Form; use Symfony\Component\Form\FormBuilderInterface; @@ -33,7 +33,6 @@ use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; -use Symfony\Bundle\SecurityBundle\Security; class Import implements QueueInterface, ConfigurableElementInterface { @@ -44,8 +43,12 @@ class Import implements QueueInterface, ConfigurableElementInterface private $_doctrine_mongodb = null; private $_error = null; - function __construct(FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, TokenStorageInterface $securityContext, ManagerRegistry $doctrine_mongodb) - { + function __construct( + FormFactoryInterface $formFactory, + EntityManagerInterface $entityManager, + TokenStorageInterface $securityContext, + ManagerRegistry $doctrine_mongodb, + ) { $this->_formFactory = $formFactory; $this->_entityManager = $entityManager; $this->_securityContext = $securityContext; @@ -80,8 +83,16 @@ class Import implements QueueInterface, ConfigurableElementInterface public function getForm(FormBuilderInterface $builder, $form_options, EventInterface $event) { - $builder->add("file", TextType::class, array('empty_data' => '/data/www/old/data/packages/import/artikel_en.xml', 'label' => 'Import Datei', 'attr' => array('class' => 'form-element'))); - $builder->add("shop", TextType::class, array('empty_data' => '1', 'label' => 'Shop Id', 'attr' => array('class' => 'form-element'))); + $builder->add('file', TextType::class, [ + 'empty_data' => '/data/www/old/data/packages/import/artikel_en.xml', + 'label' => 'Import Datei', + 'attr' => ['class' => 'form-element'], + ]); + $builder->add('shop', TextType::class, [ + 'empty_data' => '1', + 'label' => 'Shop Id', + 'attr' => ['class' => 'form-element'], + ]); } public function injectDocument(Form $form, EventInterface $event, Queue $objQueue) @@ -109,33 +120,33 @@ class Import implements QueueInterface, ConfigurableElementInterface */ public function execute(EventInterface $event, Queue $doc) { -//$produktgroupcheck = new Productgroup; -//dump($produktgroupcheck); + //$produktgroupcheck = new Productgroup; + //dump($produktgroupcheck); try { /** @var \Plugin\Custom\Krueger\ArtikelimportEN\Document\Import $queueSettings */ $queueSettings = $doc->getQueueDocument(); - if (file_exists($queueSettings->getFile() . "run_ai.txt")) return true; + if (file_exists($queueSettings->getFile() . 'run_ai.txt')) + return true; - file_put_contents($queueSettings->getFile() . "run_ai.txt", "import"); + file_put_contents($queueSettings->getFile() . 'run_ai.txt', 'import'); set_time_limit(0); if (file_exists($queueSettings->getFile())) { - $article = file_get_contents($queueSettings->getFile()); $xml = simplexml_load_string($article, 'SimpleXMLElement', LIBXML_NOWARNING); $counter = 0; - $group = "groups"; + $group = 'groups'; //sort($xml->tblMaterialGroup->Details_Collection->Details); //dump($xml->tblMaterialGroup->Details_Collection->Details->attributes()->MatGroup_DescDE); - $items = array(); + $items = []; foreach ($xml->tblMaterialGroup->Details_Collection->Details as $item) { //dump($item->attributes()->MatGroup_DescDE); $items[] .= $item->attributes()->MatGroup_DescEN; - }; + } // Custom sort on the names of the items: //usort ($items, function($a, $b) { @@ -143,7 +154,7 @@ class Import implements QueueInterface, ConfigurableElementInterface //}); natsort($items); - $itemsID = array(); + $itemsID = []; $counter = 1; foreach ($items as $item) { //echo $item; @@ -157,22 +168,27 @@ class Import implements QueueInterface, ConfigurableElementInterface //die("TEST"); foreach ($xml->tblMaterialGroup->Details_Collection->Details as $value) { - $selectedShop = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Shop')->findOneBy(array("uid" => intval($queueSettings->getShop()))); + $selectedShop = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Shop') + ->findOneBy(['uid' => intval($queueSettings->getShop())]); - $selectedContakt = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(array("company" => $value->attributes()->MainContactNo1)); + $selectedContakt = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Contact') + ->findOneBy(['company' => $value->attributes()->MainContactNo1]); $variMatGroupNo = $value->attributes()->MatGroup_MatGroupNo; $variGrDescENName = strtolower($value->attributes()->MatGroup_DescEN); //dump($variMatGroupNo); $variGrDescEN = $value->attributes()->MatGroup_DescEN; - //var_dump( array_key_exists($variGrDescDE, $itemsID) ); $arraykey = array_keys($itemsID, $variGrDescEN); //echo $arraykey[0]; //die("TEST"); - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("metaOGType" => $variMatGroupNo, "shop" => $selectedShop)); + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['metaOGType' => $variMatGroupNo, 'shop' => $selectedShop]); //dump($allGroups); //$variGrDescEN = $value->attributes()->GrDescEN; //$variGrDescFR = $value->attributes()->GrDescFR; @@ -203,34 +219,32 @@ class Import implements QueueInterface, ConfigurableElementInterface $variSalesInd = $value->attributes()->SalesInd; $variFree9 = $value->attributes()->Free9; $variFree15 = $value->attributes()->PriceOld; - $variDescEN = \str_replace(" ", " ", $variDescEN); - $variFree15 = \str_replace(",", ".", $variFree15); + $variDescEN = \str_replace(' ', ' ', $variDescEN); + $variFree15 = \str_replace(',', '.', $variFree15); - if($variFree15 == "") { + if ($variFree15 == '') { $variFree15 = 0; } if (!$allGroups) { - $productgroup = new Productgroup(); $productgroup->setShop($selectedShop); - if ($variSalesInd == "True") { + if ($variSalesInd == 'True') { $productgroup->setEnable(true); } else { $productgroup->setEnable(false); } - if($variGrDescEN != "") { - //\var_dump($variGrDescEN); - $productgroup->setMetaOGType($variMatGroupNo); - $productgroup->setTitle($variGrDescEN); - $productgroup->setUrl($this->clean(strtolower($value->attributes()->MatGroup_DescEN))); - $productgroup->setPos($arraykey[0]); - $productgroup->setLanguage("all"); - $this->_entityManager->persist($productgroup); + if ($variGrDescEN != '') { + //\var_dump($variGrDescEN); + $productgroup->setMetaOGType($variMatGroupNo); + $productgroup->setTitle($variGrDescEN); + $productgroup->setUrl($this->clean(strtolower($value->attributes()->MatGroup_DescEN))); + $productgroup->setPos($arraykey[0]); + $productgroup->setLanguage('all'); + $this->_entityManager->persist($productgroup); } } else { - $allGroups->setShop($selectedShop); - if ($variSalesInd == "True") { + if ($variSalesInd == 'True') { $allGroups->setEnable(true); } else { $allGroups->setEnable(false); @@ -240,12 +254,11 @@ class Import implements QueueInterface, ConfigurableElementInterface $allGroups->setTitle($variGrDescEN); $allGroups->setUrl($this->clean(strtolower($value->attributes()->MatGroup_DescEN))); $allGroups->setPos($arraykey[0]); - $allGroups->setLanguage("all"); + $allGroups->setLanguage('all'); $this->_entityManager->persist($allGroups); - } - - if ($counter % 10 == 0) { + + if (($counter % 10) == 0) { $this->_entityManager->flush(); $this->_entityManager->clear(); $this->_doctrine_mongodb->getManager()->flush(); @@ -254,31 +267,38 @@ class Import implements QueueInterface, ConfigurableElementInterface $counter++; } - $counter = 0; - $setproduk = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop)); - foreach($setproduk as $setproduk) { - $setproduk->setMetaKeywords(0); - //$setproduk->setEnable(false); - } + $setproduk = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop]); + foreach ($setproduk as $setproduk) { + $setproduk->setMetaKeywords(0); - foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { - $variMaterialNo = $value->attributes()->MaterialNo; - $produktcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variMaterialNo)); - if($produktcheck) { - //dump(intval($produktcheck->getUid())); + //$setproduk->setEnable(false); + } + + foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { + $variMaterialNo = $value->attributes()->MaterialNo; + $produktcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findOneBy(['shop' => $selectedShop, 'nrIntern' => $variMaterialNo]); + if ($produktcheck) { + //dump(intval($produktcheck->getUid())); $this->_entityManager ->createQuery(' - DELETE FROM PSCEntityBundle:ProductProductgroup p - WHERE p.product = :product_id')->setParameter('product_id', $produktcheck->getUid())->execute(); - } - } -$inarraycheck = array(); -$inarraycheckb = array(); + DELETE FROM PSC\Shop\EntityBundle\Entity\ProductProductgroup p + WHERE p.product = :product_id') + ->setParameter('product_id', $produktcheck->getUid()) + ->execute(); + } + } + $inarraycheck = []; + $inarraycheckb = []; foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { - $selectedShop = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Shop')->findOneBy(array("uid" => intval($queueSettings->getShop()))); + $selectedShop = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Shop') + ->findOneBy(['uid' => intval($queueSettings->getShop())]); - $variMatGroupNo = $value->attributes()->MatGroupNo; $variGrDescDEName = strtolower($value->attributes()->GrDescDE); @@ -329,21 +349,21 @@ $inarraycheckb = array(); $variFree9 = $value->attributes()->Free9; $variFree15 = $value->attributes()->PriceOld; - $variDescEN = \str_replace(" ", " ", $variDescEN); - $variFree15 = \str_replace(",", ".", $variFree15); - if($variFree15 == "") { + $variDescEN = \str_replace(' ', ' ', $variDescEN); + $variFree15 = \str_replace(',', '.', $variFree15); + if ($variFree15 == '') { $variFree15 = 0; } /* - 0 = per 1 Stück - 1 = per 10 Stück - 2 = per 100 Stück - 3 = per 1000 Stück - 9 = Gesamtpreis - $variPrice - $variPriceInd - $variPalletAmount - */ + * 0 = per 1 Stück + * 1 = per 10 Stück + * 2 = per 100 Stück + * 3 = per 1000 Stück + * 9 = Gesamtpreis + * $variPrice + * $variPriceInd + * $variPalletAmount + */ if ($variPriceInd == 0) { $variPrice = $variPrice; @@ -354,29 +374,29 @@ $inarraycheckb = array(); $variPriceStep4 = $variPriceStep1; $variPriceStep5 = $variPriceStep1; } else if ($variPriceInd == 1) { - $variPrice = $variPrice / 10 * $variPalletAmount; - $variFree15 = $variFree15 / 10 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 10 * $variPalletAmount; + $variPrice = ($variPrice / 10) * $variPalletAmount; + $variFree15 = ($variFree15 / 10) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 10) * $variPalletAmount; } else if ($variPriceInd == 2) { - $variPrice = $variPrice / 100 * $variPalletAmount; - $variFree15 = $variFree15 / 100 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 100 * $variPalletAmount; + $variPrice = ($variPrice / 100) * $variPalletAmount; + $variFree15 = ($variFree15 / 100) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 100) * $variPalletAmount; } else if ($variPriceInd == 3) { - $variPrice = $variPrice / 1000 * $variPalletAmount; - $variFree15 = $variFree15 / 1000 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 1000 * $variPalletAmount; + $variPrice = ($variPrice / 1000) * $variPalletAmount; + $variFree15 = ($variFree15 / 1000) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 1000) * $variPalletAmount; } else if ($variPriceInd == 9) { $variPrice = $variPrice; $variFree15 = $variFree15; @@ -386,45 +406,57 @@ $inarraycheckb = array(); $variPriceStep4 = $variPriceStep1; $variPriceStep5 = $variPriceStep1; } - - if ($variDescEN != "") { - $produktcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variMaterialNo)); + + if ($variDescEN != '') { + $produktcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findOneBy(['shop' => $selectedShop, 'nrIntern' => $variMaterialNo]); if (!$produktcheck) { $product = new Product(); $product->setMetaKeywords(1); $product->setShop($selectedShop); - if ($variClientNo != "") { + if ($variClientNo != '') { $product->setPrivate(1); $product->setMetaAuthor($variClientNo); } $product->setInstall($selectedShop->getInstall()->getUid()); $product->setEnable(true); - $urlcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "title" => $variDescEN)); + $urlcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop, 'title' => $variDescEN]); if (!$urlcheck) { $product->setUrl($this->shortText($this->clean(strtolower($variDescEN)), 50)); - $inurl=$this->shortText($this->clean(strtolower($variDescEN)), 50); + $inurl = $this->shortText($this->clean(strtolower($variDescEN)), 50); } else { - $product->setUrl($this->shortText($this->clean(strtolower($variDescEN)), 50) . "-" . $this->clean(strtolower($variMaterialNo))); - $inurl=$this->shortText($this->clean(strtolower($variDescEN)), 50) . "-" . $this->clean(strtolower($variMaterialNo)); + $product->setUrl( + $this->shortText($this->clean(strtolower($variDescEN)), 50) . + '-' . + $this->clean(strtolower($variMaterialNo)), + ); + $inurl = + $this->shortText($this->clean(strtolower($variDescEN)), 50) . + '-' . + $this->clean(strtolower($variMaterialNo)); } - if ($variMaterialNo != "") { - $bestellnr = ''; + if ($variMaterialNo != '') { + $bestellnr = + ''; } else { - $bestellnr = ""; + $bestellnr = ''; } - if ($variColor != "") { - $farbe = "
Farbe:" . $variColor; + if ($variColor != '') { + $farbe = '
Farbe:' . $variColor; } else { - $farbe = ""; + $farbe = ''; } - if ($variWeight2 != "") { - $gewicht = "
Gewicht:" . $variWeight2; + if ($variWeight2 != '') { + $gewicht = '
Gewicht:' . $variWeight2; } else { - $gewicht = ""; + $gewicht = ''; } $product->setTitle($variDescEN); - $product->setCustomTabText(""); + $product->setCustomTabText(''); $product->setConfirm(false); $product->setNotEdit(false); $product->setConfirmOne(false); @@ -439,34 +471,59 @@ $inarraycheckb = array(); $product->setMwert(19); $productmwst = 19; } - if($variPrice == NULL) { + if ($variPrice == null) { $product->setCanBuyWithNoPrice(true); } $product->setNrIntern($variMaterialNo); - $teile = explode(" ", $variMaterialNo); - $teile = explode("-", $teile[0]); - $teile = explode("/", $teile[0]); + $teile = explode(' ', $variMaterialNo); + $teile = explode('-', $teile[0]); + $teile = explode('/', $teile[0]); $number = str_replace(['+', '-'], '', filter_var($teile[0], FILTER_SANITIZE_NUMBER_INT)); $product->setPos($number); - $product->setUploadProduct(""); - $product->setUploadPost(""); - $product->setUploadEmail(""); - $product->setUploadCenter(""); - $product->setHintText(""); + $product->setUploadProduct(''); + $product->setUploadPost(''); + $product->setUploadEmail(''); + $product->setUploadCenter(''); + $product->setHintText(''); $product->setMetaOgImage($variImage); $product->setMetaOgUrl($variPreview); $product->setMetaOgType($variWeight2); $product->setMetaOgTitle($bestellnr); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $variISSFCertificateIn = $variISSFCertificate; } else { $variISSFCertificateIn = 0; } - $product->setMetaDescription("Color=>" . $variColor . ",Diameter=>" . $variDiameter . ",Length=>" . $variLength . ",Width=>" . $variWidth . ",PalletAmount=>" . $variPalletAmount . ",Weight2=>" . $variWeight2 . ",ISSFCertificate=>" . $variISSFCertificateIn . ",DSBSignum=>" . $variFree9 . ",NewPrice=>" .$variPrice . ",OldPrice=>" .$variFree15 . ",PriceInd=>" . $variPriceInd . "," . "PriceOut=>" . $variPriceout . ","); + $product->setMetaDescription('Color=>' . + $variColor . + ',Diameter=>' . + $variDiameter . + ',Length=>' . + $variLength . + ',Width=>' . + $variWidth . + ',PalletAmount=>' . + $variPalletAmount . + ',Weight2=>' . + $variWeight2 . + ',ISSFCertificate=>' . + $variISSFCertificateIn . + ',DSBSignum=>' . + $variFree9 . + ',NewPrice=>' . + $variPrice . + ',OldPrice=>' . + $variFree15 . + ',PriceInd=>' . + $variPriceInd . + ',' . + 'PriceOut=>' . + $variPriceout . + ','); if ($variPalletAmount == 1) { - $stueckvari = "piece(s)"; + $stueckvari = 'piece(s)'; } else { - $stueckvari = $variPalletAmount . " piece(s)"; + $stueckvari = $variPalletAmount . ' piece(s)'; } if ($variTaxKey == 5) { $variPriceInklMwSt = $variPrice * 1.07; @@ -477,16 +534,33 @@ $inarraycheckb = array(); } $bruttopreis = number_format(round($variPriceInklMwSt, 2), 2, ',', ''); $nettopreis = number_format(round($variPrice, 2), 2, ',', ''); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $product->setMetaAuthor($variISSFCertificate); } if ($variAsOfAmount1b != intval(0)) { - $product->setMetaOgDescription(' '); - $staffelpreis = 'Price scale:
from 1 to ' . $variAsOfAmount1 . ' = ' . $this->cutNumber(round($variPrice, 2)) . ' Euro
ab: ' . $variAsOfAmount1b . ' = ' . $this->cutNumber(round($variPriceStep1,2)) . ' Euro'; - $description = "" . $variAddDescEN . "
" . $variAdd2DescEN; + $product->setMetaOgDescription(' '); + $staffelpreis = + 'Price scale:
from 1 to ' . + $variAsOfAmount1 . + ' = ' . + $this->cutNumber(round($variPrice, 2)) . + ' Euro
ab: ' . + $variAsOfAmount1b . + ' = ' . + $this->cutNumber(round($variPriceStep1, 2)) . + ' Euro'; + $description = '' . $variAddDescEN . '
' . $variAdd2DescEN; $product->setMetaCustomTitle($staffelpreis); $product->setType(6); - if ($variWeight2 != "" AND $variWeight2 != NULL) { + if ($variWeight2 != '' and $variWeight2 != null) { $gewichtinkalk = $variWeight2 * 1000; $gewichtinkalk = intval($gewichtinkalk); } else { @@ -494,36 +568,66 @@ $inarraycheckb = array(); } $product->setCalcXml(' - ' . str_replace(array("
", "
", "&", "$"), " ", $variDescEN) . '
+ ' . + str_replace(['
', '
', '&', '$'], ' ', $variDescEN) . + '
'); } else { - if ($variISSFCertificate != NULL) { - $product->setMetaOgDescription(' '); + if ($variISSFCertificate != null) { + $product->setMetaOgDescription(' '); } else { - $product->setMetaOgDescription('
'); + $product->setMetaOgDescription('
'); } - $description = "
" . $variAddDescEN . "
" . $variAdd2DescEN . "
"; + $description = '
' . $variAddDescEN . '
' . $variAdd2DescEN . '
'; $product->setType(2); - $product->setCalcXml(NULL); + $product->setCalcXml(null); } $product->setDescription($description); $this->_entityManager->persist($product); - - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $variMatGroupNo)); + + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $variMatGroupNo]); if ($allGroups) { $artikelingroup = new ProductProductgroup(); @@ -532,60 +636,71 @@ $inarraycheckb = array(); $this->_entityManager->persist($artikelingroup); } - - if ($variMatGroupNoPlus != NULL) { - $teile = explode(";", $variMatGroupNoPlus); + if ($variMatGroupNoPlus != null) { + $teile = explode(';', $variMatGroupNoPlus); foreach ($teile as $key => $teile) { - if($teile != $variMatGroupNo) { - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $teile)); - if ($allGroups) { - $artikelingroup = new ProductProductgroup(); - $artikelingroup->setProduct($product); - $artikelingroup->setGroup(intval($allGroups->getUid())); - $this->_entityManager->persist($artikelingroup); + if ($teile != $variMatGroupNo) { + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $teile]); + if ($allGroups) { + $artikelingroup = new ProductProductgroup(); + $artikelingroup->setProduct($product); + $artikelingroup->setGroup(intval($allGroups->getUid())); + $this->_entityManager->persist($artikelingroup); + } } } } - } } else { $produktcheck->setMetaKeywords(1); $produktcheck->setShop($selectedShop); $produktcheck->setInstall($selectedShop->getInstall()->getUid()); $produktcheck->setType(2); $produktcheck->setEnable(true); - $urlcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "title" => $variDescEN)); + $urlcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop, 'title' => $variDescEN]); if (count($urlcheck) == 1) { $produktcheck->setUrl($this->shortText($this->clean(strtolower($variDescEN)), 50)); - $inurl=$this->shortText($this->clean(strtolower($variDescEN)), 50); + $inurl = $this->shortText($this->clean(strtolower($variDescEN)), 50); } else { - $produktcheck->setUrl($this->shortText($this->clean(strtolower($variDescEN)), 50) . "-" . $this->clean(strtolower($variMaterialNo))); - $inurl=$this->shortText($this->clean(strtolower($variDescEN)), 50) . "-" . $this->clean(strtolower($variMaterialNo)); + $produktcheck->setUrl( + $this->shortText($this->clean(strtolower($variDescEN)), 50) . + '-' . + $this->clean(strtolower($variMaterialNo)), + ); + $inurl = + $this->shortText($this->clean(strtolower($variDescEN)), 50) . + '-' . + $this->clean(strtolower($variMaterialNo)); } - if ($variClientNo != "") { + if ($variClientNo != '') { $produktcheck->setPrivate(1); $produktcheck->setMetaAuthor($variClientNo); } //Je Verpackungseinheit //IF Abfragen für Farbe und Co. - if ($variMaterialNo != "") { - $bestellnr = ''; + if ($variMaterialNo != '') { + $bestellnr = + ''; } else { - $bestellnr = ""; + $bestellnr = ''; } - if ($variColor != "") { - $farbe = "
Farbe:" . $variColor; + if ($variColor != '') { + $farbe = '
Farbe:' . $variColor; } else { - $farbe = ""; + $farbe = ''; } - if ($variWeight2 != "") { - $gewicht = "
Gewicht:" . $variWeight2; + if ($variWeight2 != '') { + $gewicht = '
Gewicht:' . $variWeight2; } else { - $gewicht = ""; + $gewicht = ''; } $produktcheck->setTitle($variDescEN); - $produktcheck->setCustomTabText(""); + $produktcheck->setCustomTabText(''); $produktcheck->setConfirm(false); $produktcheck->setNotEdit(false); $produktcheck->setConfirmOne(false); @@ -600,35 +715,60 @@ $inarraycheckb = array(); $produktcheck->setMwert(19); $productmwst = 19; } - if($variPrice == NULL) { + if ($variPrice == null) { $produktcheck->setCanBuyWithNoPrice(true); } $produktcheck->setNrIntern($variMaterialNo); - $teile = explode(" ", $variMaterialNo); - $teile = explode("-", $teile[0]); - $teile = explode("/", $teile[0]); + $teile = explode(' ', $variMaterialNo); + $teile = explode('-', $teile[0]); + $teile = explode('/', $teile[0]); $number = str_replace(['+', '-'], '', filter_var($teile[0], FILTER_SANITIZE_NUMBER_INT)); $produktcheck->setPos($number); - $produktcheck->setUploadProduct(""); - $produktcheck->setHintText(""); - $produktcheck->setUploadPost(""); - $produktcheck->setUploadEmail(""); - $produktcheck->setUploadCenter(""); + $produktcheck->setUploadProduct(''); + $produktcheck->setHintText(''); + $produktcheck->setUploadPost(''); + $produktcheck->setUploadEmail(''); + $produktcheck->setUploadCenter(''); $produktcheck->setMetaOgImage($variImage); $produktcheck->setMetaOgUrl($variPreview); $produktcheck->setMetaOgType($variWeight2); $produktcheck->setMetaOgTitle($bestellnr); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $variISSFCertificateIn = $variISSFCertificate; } else { $variISSFCertificateIn = 0; } - $produktcheck->setMetaDescription("Color=>" . $variColor . ",Diameter=>" . $variDiameter . ",Length=>" . $variLength . ",Width=>" . $variWidth . ",PalletAmount=>" . $variPalletAmount . ",Weight2=>" . $variWeight2 . ",ISSFCertificate=>" . $variISSFCertificateIn . ",DSBSignum=>" . $variFree9 . ",NewPrice=>" .$variPrice . ",OldPrice=>" .$variFree15 . ",PriceInd=>" . $variPriceInd . "," . "PriceOut=>" . $variPriceout . ","); + $produktcheck->setMetaDescription('Color=>' . + $variColor . + ',Diameter=>' . + $variDiameter . + ',Length=>' . + $variLength . + ',Width=>' . + $variWidth . + ',PalletAmount=>' . + $variPalletAmount . + ',Weight2=>' . + $variWeight2 . + ',ISSFCertificate=>' . + $variISSFCertificateIn . + ',DSBSignum=>' . + $variFree9 . + ',NewPrice=>' . + $variPrice . + ',OldPrice=>' . + $variFree15 . + ',PriceInd=>' . + $variPriceInd . + ',' . + 'PriceOut=>' . + $variPriceout . + ','); if ($variPalletAmount == 1) { - $stueckvari = "piece(s)"; + $stueckvari = 'piece(s)'; } else { - $stueckvari = $variPalletAmount . " piece(s)"; + $stueckvari = $variPalletAmount . ' piece(s)'; } if ($variTaxKey == 5) { $variPriceInklMwSt = $variPrice * 1.07; @@ -640,16 +780,33 @@ $inarraycheckb = array(); $bruttopreis = number_format(round($variPriceInklMwSt, 2), 2, ',', ''); $nettopreis = number_format(round($variPrice, 2), 2, ',', ''); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $produktcheck->setMetaAuthor($variISSFCertificate); } if ($variAsOfAmount1b != intval(0)) { - $produktcheck->setMetaOgDescription(' '); - $staffelpreis = 'Price scale:
from 1 to ' . $variAsOfAmount1 . ' = ' . $this->cutNumber(round($variPrice, 2)) . ' Euro
from ' . $variAsOfAmount1b . ' = ' . $this->cutNumber(round($variPriceStep1, 2)) . ' Euro'; - $description = "" . $variAddDescEN . "
" . $variAdd2DescEN; + $produktcheck->setMetaOgDescription(' '); + $staffelpreis = + 'Price scale:
from 1 to ' . + $variAsOfAmount1 . + ' = ' . + $this->cutNumber(round($variPrice, 2)) . + ' Euro
from ' . + $variAsOfAmount1b . + ' = ' . + $this->cutNumber(round($variPriceStep1, 2)) . + ' Euro'; + $description = '' . $variAddDescEN . '
' . $variAdd2DescEN; $produktcheck->setMetaCustomTitle($staffelpreis); $produktcheck->setType(6); - if ($variWeight2 != "" AND $variWeight2 != NULL) { + if ($variWeight2 != '' and $variWeight2 != null) { $gewichtinkalk = $variWeight2 * 1000; $gewichtinkalk = intval($gewichtinkalk); } else { @@ -657,48 +814,75 @@ $inarraycheckb = array(); } $produktcheck->setCalcXml(' - ' . str_replace(array("
", "
", "&", "$"), " ", $variDescEN) . '
+ ' . + str_replace(['
', '
', '&', '$'], ' ', $variDescEN) . + '
'); } else { - if ($variISSFCertificate != NULL) { - $produktcheck->setMetaOgDescription(' '); - } else { - $produktcheck->setMetaOgDescription('
'); - } - $description = "
" . $variAddDescEN . "
" . $variAdd2DescEN . "
"; + if ($variISSFCertificate != null) { + $produktcheck->setMetaOgDescription(' '); + } else { + $produktcheck->setMetaOgDescription('
'); + } + $description = '
' . $variAddDescEN . '
' . $variAdd2DescEN . '
'; $produktcheck->setType(2); - $produktcheck->setCalcXml(NULL); + $produktcheck->setCalcXml(null); } $produktcheck->setDescription($description); $this->_entityManager->persist($produktcheck); - if ($variWeight2 != "" AND $variWeight2 != NULL) { + if ($variWeight2 != '' and $variWeight2 != null) { $gewicht = $variWeight2 * 1000; $gewicht = intval($gewicht); } else { $gewicht = 0; } - /** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */ $productDoc = $this->_doctrine_mongodb ->getRepository('PSC\Shop\EntityBundle\Document\Product') - ->findOneBy(array('uid' => (string)$produktcheck->getUid())); + ->findOneBy(['uid' => (string) $produktcheck->getUid()]); if ($productDoc) { $productDoc->setUid($produktcheck->getUid()); $productDoc->setWeight($gewicht); @@ -709,18 +893,25 @@ $inarraycheckb = array(); $productDoc->setWeight($gewicht); $this->_doctrine_mongodb->getManager()->persist($productDoc); } - - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $variMatGroupNo)); + + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $variMatGroupNo]); //\dump(intval($produktcheck->getUid())); //\dump(intval($allGroups->getUid())); - - if (in_array(intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()), $inarraycheck)) { + + if ( + in_array( + intval($produktcheck->getUid()) . ';' . intval($allGroups->getUid()), + $inarraycheck, + ) + ) { //dump("IST DRIN!!!"); $notinsert = true; } else { //dump("IST NICHT DRIN!!!"); $notinsert = false; - $inarraycheck[] .= intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()); + $inarraycheck[] .= intval($produktcheck->getUid()) . ';' . intval($allGroups->getUid()); } if (!$notinsert) { $artikelingroup = new ProductProductgroup(); @@ -729,61 +920,74 @@ $inarraycheckb = array(); $this->_entityManager->persist($artikelingroup); } - - if ($variMatGroupNoPlus != NULL) { - $teile = explode(";", $variMatGroupNoPlus); + if ($variMatGroupNoPlus != null) { + $teile = explode(';', $variMatGroupNoPlus); foreach ($teile as $key => $teile) { - if($teile != $variMatGroupNo) { - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $teile)); + if ($teile != $variMatGroupNo) { + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $teile]); - if ($allGroups AND in_array(intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()), $inarraycheckb)) { - //dump("IST DRIN!!!"); - $notinsertb = true; - } else { - if($allGroups) { - //dump("IST NICHT DRIN!!!"); - $notinsertb = false; - $inarraycheckb[] .= intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()); + if ( + $allGroups and + in_array( + intval($produktcheck->getUid()) . + ';' . + intval($allGroups->getUid()), + $inarraycheckb, + ) + ) { + //dump("IST DRIN!!!"); + $notinsertb = true; + } else { + if ($allGroups) { + //dump("IST NICHT DRIN!!!"); + $notinsertb = false; + $inarraycheckb[] .= + intval($produktcheck->getUid()) . + ';' . + intval($allGroups->getUid()); + } + } + + if ($allGroups and !$notinsertb) { + $artikelingroup = new ProductProductgroup(); + $artikelingroup->setProduct($produktcheck); + $artikelingroup->setGroup(intval($allGroups->getUid())); + $this->_entityManager->persist($artikelingroup); } } - - if ($allGroups AND !$notinsertb) { - $artikelingroup = new ProductProductgroup(); - $artikelingroup->setProduct($produktcheck); - $artikelingroup->setGroup(intval($allGroups->getUid())); - $this->_entityManager->persist($artikelingroup); - } } } - } } } - if ($counter % 10 == 0) { + if (($counter % 10) == 0) { $this->_entityManager->flush(); $this->_entityManager->clear(); $this->_doctrine_mongodb->getManager()->flush(); $this->_doctrine_mongodb->getManager()->clear(); } - + $counter++; - } - $produktchecknoActive = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "metaKeywords" => 0)); + $produktchecknoActive = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop, 'metaKeywords' => 0]); -foreach($produktchecknoActive as $produktchecknoActive) { - //\dump($produktchecknoActive->getUid()); - $produktchecknoActive->setEnable(NULL); -} + foreach ($produktchecknoActive as $produktchecknoActive) { + //\dump($produktchecknoActive->getUid()); + $produktchecknoActive->setEnable(null); + } + + $this->_entityManager->flush(); + $this->_entityManager->clear(); -$this->_entityManager->flush(); -$this->_entityManager->clear(); - rename($queueSettings->getFile(), $queueSettings->getFile() . '.old'); } - unlink($queueSettings->getFile() . "run_ai.txt"); + unlink($queueSettings->getFile() . 'run_ai.txt'); } catch (\Exception $e) { echo $e->getMessage(); return false; @@ -809,18 +1013,20 @@ $this->_entityManager->clear(); { if (strlen($string) > $lenght) { $string = substr($string, 0, $lenght); - $string_ende = strrchr($string, ""); - $string = str_replace($string_ende, "-", $string); + $string_ende = strrchr($string, ''); + $string = str_replace($string_ende, '-', $string); } return $string; } - function cutNumber($number, $decimals=2) { - $number = explode(".", $number, 2); + + function cutNumber($number, $decimals = 2) + { + $number = explode('.', $number, 2); //print_r($number); - if(!isset($number[1])) { - return $number[0].".00"; + if (!isset($number[1])) { + return $number[0] . '.00'; } else { - return $number[0].".".substr($number[1].str_repeat("0", $decimals), 0, $decimals); - } + return $number[0] . '.' . substr($number[1] . str_repeat('0', $decimals), 0, $decimals); } + } } diff --git a/src/new/var/plugins/Custom/Krueger/ArtikelimportFR/Queue/Import.php b/src/new/var/plugins/Custom/Krueger/ArtikelimportFR/Queue/Import.php index a0362e1eb..71db52221 100755 --- a/src/new/var/plugins/Custom/Krueger/ArtikelimportFR/Queue/Import.php +++ b/src/new/var/plugins/Custom/Krueger/ArtikelimportFR/Queue/Import.php @@ -2,7 +2,6 @@ namespace Plugin\Custom\Krueger\ArtikelimportFR\Queue; - use Ddeboer\DataImport\Reader\ArrayReader; use Ddeboer\DataImport\Workflow; use Doctrine\Bundle\MongoDBBundle\ManagerRegistry; @@ -14,17 +13,18 @@ use PSC\Shop\EntityBundle\Document\Queue; use PSC\Shop\EntityBundle\Entity\Account; use PSC\Shop\EntityBundle\Entity\Contact; use PSC\Shop\EntityBundle\Entity\ContactRole; -use PSC\Shop\EntityBundle\Entity\Role; -use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\EntityBundle\Entity\Productgroup; use PSC\Shop\EntityBundle\Entity\ProductProductgroup; +use PSC\Shop\EntityBundle\Entity\Role; +use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\Shop\EntityBundle\Repository\ProductProductgroupRepository; use PSC\Shop\QueueBundle\Event\EventInterface; use PSC\Shop\QueueBundle\Event\Position\Printpartner\Notify; use PSC\Shop\QueueBundle\Type\ConfigurableElementInterface; use PSC\Shop\QueueBundle\Type\QueueInterface; use Ramsey\Uuid\Uuid; +use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Form; use Symfony\Component\Form\FormBuilderInterface; @@ -33,7 +33,6 @@ use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; -use Symfony\Bundle\SecurityBundle\Security; class Import implements QueueInterface, ConfigurableElementInterface { @@ -44,8 +43,12 @@ class Import implements QueueInterface, ConfigurableElementInterface private $_doctrine_mongodb = null; private $_error = null; - function __construct(FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, TokenStorageInterface $securityContext, ManagerRegistry $doctrine_mongodb) - { + function __construct( + FormFactoryInterface $formFactory, + EntityManagerInterface $entityManager, + TokenStorageInterface $securityContext, + ManagerRegistry $doctrine_mongodb, + ) { $this->_formFactory = $formFactory; $this->_entityManager = $entityManager; $this->_securityContext = $securityContext; @@ -80,8 +83,16 @@ class Import implements QueueInterface, ConfigurableElementInterface public function getForm(FormBuilderInterface $builder, $form_options, EventInterface $event) { - $builder->add("file", TextType::class, array('empty_data' => '/data/www/old/data/packages/import/artikel_fr.xml', 'label' => 'Import Datei', 'attr' => array('class' => 'form-element'))); - $builder->add("shop", TextType::class, array('empty_data' => '1', 'label' => 'Shop Id', 'attr' => array('class' => 'form-element'))); + $builder->add('file', TextType::class, [ + 'empty_data' => '/data/www/old/data/packages/import/artikel_fr.xml', + 'label' => 'Import Datei', + 'attr' => ['class' => 'form-element'], + ]); + $builder->add('shop', TextType::class, [ + 'empty_data' => '1', + 'label' => 'Shop Id', + 'attr' => ['class' => 'form-element'], + ]); } public function injectDocument(Form $form, EventInterface $event, Queue $objQueue) @@ -109,33 +120,33 @@ class Import implements QueueInterface, ConfigurableElementInterface */ public function execute(EventInterface $event, Queue $doc) { -//$produktgroupcheck = new Productgroup; -//dump($produktgroupcheck); + //$produktgroupcheck = new Productgroup; + //dump($produktgroupcheck); try { /** @var \Plugin\Custom\Krueger\ArtikelimportFR\Document\Import $queueSettings */ $queueSettings = $doc->getQueueDocument(); - if (file_exists($queueSettings->getFile() . "run_ai.txt")) return true; + if (file_exists($queueSettings->getFile() . 'run_ai.txt')) + return true; - file_put_contents($queueSettings->getFile() . "run_ai.txt", "import"); + file_put_contents($queueSettings->getFile() . 'run_ai.txt', 'import'); set_time_limit(0); if (file_exists($queueSettings->getFile())) { - $article = file_get_contents($queueSettings->getFile()); $xml = simplexml_load_string($article, 'SimpleXMLElement', LIBXML_NOWARNING); $counter = 0; - $group = "groups"; + $group = 'groups'; //sort($xml->tblMaterialGroup->Details_Collection->Details); //dump($xml->tblMaterialGroup->Details_Collection->Details->attributes()->MatGroup_DescDE); - $items = array(); + $items = []; foreach ($xml->tblMaterialGroup->Details_Collection->Details as $item) { //dump($item->attributes()->MatGroup_DescDE); $items[] .= $item->attributes()->MatGroup_DescFR; - }; + } // Custom sort on the names of the items: //usort ($items, function($a, $b) { @@ -143,7 +154,7 @@ class Import implements QueueInterface, ConfigurableElementInterface //}); natsort($items); - $itemsID = array(); + $itemsID = []; $counter = 1; foreach ($items as $item) { //echo $item; @@ -157,22 +168,27 @@ class Import implements QueueInterface, ConfigurableElementInterface //die("TEST"); foreach ($xml->tblMaterialGroup->Details_Collection->Details as $value) { - $selectedShop = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Shop')->findOneBy(array("uid" => intval($queueSettings->getShop()))); + $selectedShop = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Shop') + ->findOneBy(['uid' => intval($queueSettings->getShop())]); - $selectedContakt = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(array("company" => $value->attributes()->MainContactNo1)); + $selectedContakt = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Contact') + ->findOneBy(['company' => $value->attributes()->MainContactNo1]); $variMatGroupNo = $value->attributes()->MatGroup_MatGroupNo; $variGrDescFRName = strtolower($value->attributes()->MatGroup_DescFR); //dump($variMatGroupNo); $variGrDescFR = $value->attributes()->MatGroup_DescFR; - //var_dump( array_key_exists($variGrDescDE, $itemsID) ); $arraykey = array_keys($itemsID, $variGrDescFR); //echo $arraykey[0]; //die("TEST"); - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("metaOGType" => $variMatGroupNo, "shop" => $selectedShop)); + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['metaOGType' => $variMatGroupNo, 'shop' => $selectedShop]); //dump($allGroups); //$variGrDescEN = $value->attributes()->GrDescEN; //$variGrDescFR = $value->attributes()->GrDescFR; @@ -204,34 +220,32 @@ class Import implements QueueInterface, ConfigurableElementInterface $variSalesInd = $value->attributes()->SalesInd; $variFree9 = $value->attributes()->Free9; $variFree15 = $value->attributes()->PriceOld; - $variDescFR = \str_replace(" ", " ", $variDescFR); - $variFree15 = \str_replace(",", ".", $variFree15); + $variDescFR = \str_replace(' ', ' ', $variDescFR); + $variFree15 = \str_replace(',', '.', $variFree15); - if($variFree15 == "") { + if ($variFree15 == '') { $variFree15 = 0; } if (!$allGroups) { - $productgroup = new Productgroup(); $productgroup->setShop($selectedShop); - if ($variSalesInd == "True") { + if ($variSalesInd == 'True') { $productgroup->setEnable(true); } else { $productgroup->setEnable(false); } - if($variGrDescFR != "") { - //\var_dump($variGrDescFR); - $productgroup->setMetaOGType($variMatGroupNo); - $productgroup->setTitle($variGrDescFR); - $productgroup->setUrl($this->clean(strtolower($value->attributes()->MatGroup_DescFR))); - $productgroup->setPos($arraykey[0]); - $productgroup->setLanguage("all"); - $this->_entityManager->persist($productgroup); + if ($variGrDescFR != '') { + //\var_dump($variGrDescFR); + $productgroup->setMetaOGType($variMatGroupNo); + $productgroup->setTitle($variGrDescFR); + $productgroup->setUrl($this->clean(strtolower($value->attributes()->MatGroup_DescFR))); + $productgroup->setPos($arraykey[0]); + $productgroup->setLanguage('all'); + $this->_entityManager->persist($productgroup); } } else { - $allGroups->setShop($selectedShop); - if ($variSalesInd == "True") { + if ($variSalesInd == 'True') { $allGroups->setEnable(true); } else { $allGroups->setEnable(false); @@ -241,12 +255,11 @@ class Import implements QueueInterface, ConfigurableElementInterface $allGroups->setTitle($variGrDescFR); $allGroups->setUrl($this->clean(strtolower($value->attributes()->MatGroup_DescFR))); $allGroups->setPos($arraykey[0]); - $allGroups->setLanguage("all"); + $allGroups->setLanguage('all'); $this->_entityManager->persist($allGroups); - } - - if ($counter % 10 == 0) { + + if (($counter % 10) == 0) { $this->_entityManager->flush(); $this->_entityManager->clear(); $this->_doctrine_mongodb->getManager()->flush(); @@ -255,31 +268,38 @@ class Import implements QueueInterface, ConfigurableElementInterface $counter++; } - $counter = 0; - $setproduk = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop)); - foreach($setproduk as $setproduk) { - $setproduk->setMetaKeywords(0); - //$setproduk->setEnable(false); - } + $setproduk = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop]); + foreach ($setproduk as $setproduk) { + $setproduk->setMetaKeywords(0); - foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { - $variMaterialNo = $value->attributes()->MaterialNo; - $produktcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variMaterialNo)); - if($produktcheck) { - //dump(intval($produktcheck->getUid())); + //$setproduk->setEnable(false); + } + + foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { + $variMaterialNo = $value->attributes()->MaterialNo; + $produktcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findOneBy(['shop' => $selectedShop, 'nrIntern' => $variMaterialNo]); + if ($produktcheck) { + //dump(intval($produktcheck->getUid())); $this->_entityManager ->createQuery(' - DELETE FROM PSCEntityBundle:ProductProductgroup p - WHERE p.product = :product_id')->setParameter('product_id', $produktcheck->getUid())->execute(); - } - } -$inarraycheck = array(); -$inarraycheckb = array(); + DELETE FROM PSC\Shop\EntityBundle\Entity\ProductProductgroup p + WHERE p.product = :product_id') + ->setParameter('product_id', $produktcheck->getUid()) + ->execute(); + } + } + $inarraycheck = []; + $inarraycheckb = []; foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { - $selectedShop = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Shop')->findOneBy(array("uid" => intval($queueSettings->getShop()))); + $selectedShop = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Shop') + ->findOneBy(['uid' => intval($queueSettings->getShop())]); - $variMatGroupNo = $value->attributes()->MatGroupNo; $variGrDescDEName = strtolower($value->attributes()->GrDescDE); @@ -331,21 +351,21 @@ $inarraycheckb = array(); $variFree9 = $value->attributes()->Free9; $variFree15 = $value->attributes()->PriceOld; - $variDescFR = \str_replace(" ", " ", $variDescFR); - $variFree15 = \str_replace(",", ".", $variFree15); - if($variFree15 == "") { + $variDescFR = \str_replace(' ', ' ', $variDescFR); + $variFree15 = \str_replace(',', '.', $variFree15); + if ($variFree15 == '') { $variFree15 = 0; } /* - 0 = per 1 Stück - 1 = per 10 Stück - 2 = per 100 Stück - 3 = per 1000 Stück - 9 = Gesamtpreis - $variPrice - $variPriceInd - $variPalletAmount - */ + * 0 = per 1 Stück + * 1 = per 10 Stück + * 2 = per 100 Stück + * 3 = per 1000 Stück + * 9 = Gesamtpreis + * $variPrice + * $variPriceInd + * $variPalletAmount + */ if ($variPriceInd == 0) { $variPrice = $variPrice; @@ -356,29 +376,29 @@ $inarraycheckb = array(); $variPriceStep4 = $variPriceStep1; $variPriceStep5 = $variPriceStep1; } else if ($variPriceInd == 1) { - $variPrice = $variPrice / 10 * $variPalletAmount; - $variFree15 = $variFree15 / 10 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 10 * $variPalletAmount; + $variPrice = ($variPrice / 10) * $variPalletAmount; + $variFree15 = ($variFree15 / 10) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 10) * $variPalletAmount; } else if ($variPriceInd == 2) { - $variPrice = $variPrice / 100 * $variPalletAmount; - $variFree15 = $variFree15 / 100 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 100 * $variPalletAmount; + $variPrice = ($variPrice / 100) * $variPalletAmount; + $variFree15 = ($variFree15 / 100) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 100) * $variPalletAmount; } else if ($variPriceInd == 3) { - $variPrice = $variPrice / 1000 * $variPalletAmount; - $variFree15 = $variFree15 / 1000 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 1000 * $variPalletAmount; + $variPrice = ($variPrice / 1000) * $variPalletAmount; + $variFree15 = ($variFree15 / 1000) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 1000) * $variPalletAmount; } else if ($variPriceInd == 9) { $variPrice = $variPrice; $variFree15 = $variFree15; @@ -388,45 +408,57 @@ $inarraycheckb = array(); $variPriceStep4 = $variPriceStep1; $variPriceStep5 = $variPriceStep1; } - - if ($variDescFR != "") { - $produktcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variMaterialNo)); + + if ($variDescFR != '') { + $produktcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findOneBy(['shop' => $selectedShop, 'nrIntern' => $variMaterialNo]); if (!$produktcheck) { $product = new Product(); $product->setMetaKeywords(1); $product->setShop($selectedShop); - if ($variClientNo != "") { + if ($variClientNo != '') { $product->setPrivate(1); $product->setMetaAuthor($variClientNo); } $product->setInstall($selectedShop->getInstall()->getUid()); $product->setEnable(true); - $urlcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "title" => $variDescFR)); + $urlcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop, 'title' => $variDescFR]); if (!$urlcheck) { $product->setUrl($this->shortText($this->clean(strtolower($variDescFR)), 50)); - $inurl=$this->shortText($this->clean(strtolower($variDescFR)), 50); + $inurl = $this->shortText($this->clean(strtolower($variDescFR)), 50); } else { - $product->setUrl($this->shortText($this->clean(strtolower($variDescFR)), 50) . "-" . $this->clean(strtolower($variMaterialNo))); - $inurl=$this->shortText($this->clean(strtolower($variDescFR)), 50) . "-" . $this->clean(strtolower($variMaterialNo)); + $product->setUrl( + $this->shortText($this->clean(strtolower($variDescFR)), 50) . + '-' . + $this->clean(strtolower($variMaterialNo)), + ); + $inurl = + $this->shortText($this->clean(strtolower($variDescFR)), 50) . + '-' . + $this->clean(strtolower($variMaterialNo)); } - if ($variMaterialNo != "") { - $bestellnr = ''; + if ($variMaterialNo != '') { + $bestellnr = + ''; } else { - $bestellnr = ""; + $bestellnr = ''; } - if ($variColor != "") { - $farbe = "
Farbe:" . $variColor; + if ($variColor != '') { + $farbe = '
Farbe:' . $variColor; } else { - $farbe = ""; + $farbe = ''; } - if ($variWeight2 != "") { - $gewicht = "
Gewicht:" . $variWeight2; + if ($variWeight2 != '') { + $gewicht = '
Gewicht:' . $variWeight2; } else { - $gewicht = ""; + $gewicht = ''; } $product->setTitle($variDescFR); - $product->setCustomTabText(""); + $product->setCustomTabText(''); $product->setConfirm(false); $product->setNotEdit(false); $product->setConfirmOne(false); @@ -441,34 +473,59 @@ $inarraycheckb = array(); $product->setMwert(19); $productmwst = 19; } - if($variPrice == NULL) { + if ($variPrice == null) { $product->setCanBuyWithNoPrice(true); } $product->setNrIntern($variMaterialNo); - $teile = explode(" ", $variMaterialNo); - $teile = explode("-", $teile[0]); - $teile = explode("/", $teile[0]); + $teile = explode(' ', $variMaterialNo); + $teile = explode('-', $teile[0]); + $teile = explode('/', $teile[0]); $number = str_replace(['+', '-'], '', filter_var($teile[0], FILTER_SANITIZE_NUMBER_INT)); $product->setPos($number); - $product->setUploadProduct(""); - $product->setUploadPost(""); - $product->setUploadEmail(""); - $product->setUploadCenter(""); - $product->setHintText(""); + $product->setUploadProduct(''); + $product->setUploadPost(''); + $product->setUploadEmail(''); + $product->setUploadCenter(''); + $product->setHintText(''); $product->setMetaOgImage($variImage); $product->setMetaOgUrl($variPreview); $product->setMetaOgType($variWeight2); $product->setMetaOgTitle($bestellnr); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $variISSFCertificateIn = $variISSFCertificate; } else { $variISSFCertificateIn = 0; } - $product->setMetaDescription("Color=>" . $variColor . ",Diameter=>" . $variDiameter . ",Length=>" . $variLength . ",Width=>" . $variWidth . ",PalletAmount=>" . $variPalletAmount . ",Weight2=>" . $variWeight2 . ",ISSFCertificate=>" . $variISSFCertificateIn . ",DSBSignum=>" . $variFree9 . ",NewPrice=>" .$variPrice . ",OldPrice=>" .$variFree15 . ",PriceInd=>" . $variPriceInd . "," . "PriceOut=>" . $variPriceout . ","); + $product->setMetaDescription('Color=>' . + $variColor . + ',Diameter=>' . + $variDiameter . + ',Length=>' . + $variLength . + ',Width=>' . + $variWidth . + ',PalletAmount=>' . + $variPalletAmount . + ',Weight2=>' . + $variWeight2 . + ',ISSFCertificate=>' . + $variISSFCertificateIn . + ',DSBSignum=>' . + $variFree9 . + ',NewPrice=>' . + $variPrice . + ',OldPrice=>' . + $variFree15 . + ',PriceInd=>' . + $variPriceInd . + ',' . + 'PriceOut=>' . + $variPriceout . + ','); if ($variPalletAmount == 1) { - $stueckvari = "pièce"; + $stueckvari = 'pièce'; } else { - $stueckvari = $variPalletAmount . " pièce"; + $stueckvari = $variPalletAmount . ' pièce'; } if ($variTaxKey == 5) { $variPriceInklMwSt = $variPrice * 1.07; @@ -479,42 +536,87 @@ $inarraycheckb = array(); } $bruttopreis = number_format(round($variPriceInklMwSt, 2), 2, ',', ''); $nettopreis = number_format(round($variPrice, 2), 2, ',', ''); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $product->setMetaAuthor($variISSFCertificate); } if ($variAsOfAmount1b != intval(0)) { - $product->setMetaOgDescription(' '); - $staffelpreis = 'Échelle de prix:
de 1 à ' . $variAsOfAmount1 . ' = ' . $this->cutNumber(round($variPrice, 2)) . ' Euro
à partir de: ' . $variAsOfAmount1b . ' = ' . $this->cutNumber(round($variPriceStep1,2)) . ' Euro'; - $description = "" . $variAddDescFR . "
" . $variAdd2DescFR; + $product->setMetaOgDescription(' '); + $staffelpreis = + 'Échelle de prix:
de 1 à ' . + $variAsOfAmount1 . + ' = ' . + $this->cutNumber(round($variPrice, 2)) . + ' Euro
à partir de: ' . + $variAsOfAmount1b . + ' = ' . + $this->cutNumber(round($variPriceStep1, 2)) . + ' Euro'; + $description = '' . $variAddDescFR . '
' . $variAdd2DescFR; $product->setMetaCustomTitle($staffelpreis); $product->setType(6); $product->setCalcXml(' - ' . str_replace(array("
", "
", "&", "$"), " ", $variDescFR) . '
+ ' . + str_replace(['
', '
', '&', '$'], ' ', $variDescFR) . + '
'); } else { - if ($variISSFCertificate != NULL) { - $product->setMetaOgDescription(' '); + if ($variISSFCertificate != null) { + $product->setMetaOgDescription(' '); } else { - $product->setMetaOgDescription('
'); + $product->setMetaOgDescription('
'); } - $description = "
" . $variAddDescFR . "
" . $variAdd2DescFR . "
"; + $description = '
' . $variAddDescFR . '
' . $variAdd2DescFR . '
'; $product->setType(2); - $product->setCalcXml(NULL); + $product->setCalcXml(null); } $product->setDescription($description); $this->_entityManager->persist($product); - - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $variMatGroupNo)); + + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $variMatGroupNo]); if ($allGroups) { $artikelingroup = new ProductProductgroup(); @@ -523,59 +625,70 @@ $inarraycheckb = array(); $this->_entityManager->persist($artikelingroup); } - - if ($variMatGroupNoPlus != NULL) { - $teile = explode(";", $variMatGroupNoPlus); + if ($variMatGroupNoPlus != null) { + $teile = explode(';', $variMatGroupNoPlus); foreach ($teile as $key => $teile) { - if($teile != $variMatGroupNo) { - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $teile)); - if ($allGroups) { - $artikelingroup = new ProductProductgroup(); - $artikelingroup->setProduct($product); - $artikelingroup->setGroup(intval($allGroups->getUid())); - $this->_entityManager->persist($artikelingroup); + if ($teile != $variMatGroupNo) { + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $teile]); + if ($allGroups) { + $artikelingroup = new ProductProductgroup(); + $artikelingroup->setProduct($product); + $artikelingroup->setGroup(intval($allGroups->getUid())); + $this->_entityManager->persist($artikelingroup); + } } } } - } } else { $produktcheck->setMetaKeywords(1); $produktcheck->setShop($selectedShop); $produktcheck->setInstall($selectedShop->getInstall()->getUid()); $produktcheck->setType(2); $produktcheck->setEnable(true); - $urlcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "title" => $variDescFR)); + $urlcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop, 'title' => $variDescFR]); if (count($urlcheck) == 1) { $produktcheck->setUrl($this->shortText($this->clean(strtolower($variDescFR)), 50)); - $inurl=$this->shortText($this->clean(strtolower($variDescFR)), 50); + $inurl = $this->shortText($this->clean(strtolower($variDescFR)), 50); } else { - $produktcheck->setUrl($this->shortText($this->clean(strtolower($variDescFR)), 50) . "-" . $this->clean(strtolower($variMaterialNo))); - $inurl=$this->shortText($this->clean(strtolower($variDescFR)), 50) . "-" . $this->clean(strtolower($variMaterialNo)); + $produktcheck->setUrl( + $this->shortText($this->clean(strtolower($variDescFR)), 50) . + '-' . + $this->clean(strtolower($variMaterialNo)), + ); + $inurl = + $this->shortText($this->clean(strtolower($variDescFR)), 50) . + '-' . + $this->clean(strtolower($variMaterialNo)); } - if ($variClientNo != "") { + if ($variClientNo != '') { $produktcheck->setPrivate(1); $produktcheck->setMetaAuthor($variClientNo); } //Je Verpackungseinheit //IF Abfragen für Farbe und Co. - if ($variMaterialNo != "") { - $bestellnr = ''; + if ($variMaterialNo != '') { + $bestellnr = + ''; } else { - $bestellnr = ""; + $bestellnr = ''; } - if ($variColor != "") { - $farbe = "
Farbe:" . $variColor; + if ($variColor != '') { + $farbe = '
Farbe:' . $variColor; } else { - $farbe = ""; + $farbe = ''; } - if ($variWeight2 != "") { - $gewicht = "
Gewicht:" . $variWeight2; + if ($variWeight2 != '') { + $gewicht = '
Gewicht:' . $variWeight2; } else { - $gewicht = ""; + $gewicht = ''; } $produktcheck->setTitle($variDescFR); - $produktcheck->setCustomTabText(""); + $produktcheck->setCustomTabText(''); $produktcheck->setConfirm(false); $produktcheck->setNotEdit(false); $produktcheck->setConfirmOne(false); @@ -590,35 +703,60 @@ $inarraycheckb = array(); $produktcheck->setMwert(19); $productmwst = 19; } - if($variPrice == NULL) { + if ($variPrice == null) { $produktcheck->setCanBuyWithNoPrice(true); } $produktcheck->setNrIntern($variMaterialNo); - $teile = explode(" ", $variMaterialNo); - $teile = explode("-", $teile[0]); - $teile = explode("/", $teile[0]); + $teile = explode(' ', $variMaterialNo); + $teile = explode('-', $teile[0]); + $teile = explode('/', $teile[0]); $number = str_replace(['+', '-'], '', filter_var($teile[0], FILTER_SANITIZE_NUMBER_INT)); $produktcheck->setPos($number); - $produktcheck->setUploadProduct(""); - $produktcheck->setHintText(""); - $produktcheck->setUploadPost(""); - $produktcheck->setUploadEmail(""); - $produktcheck->setUploadCenter(""); + $produktcheck->setUploadProduct(''); + $produktcheck->setHintText(''); + $produktcheck->setUploadPost(''); + $produktcheck->setUploadEmail(''); + $produktcheck->setUploadCenter(''); $produktcheck->setMetaOgImage($variImage); $produktcheck->setMetaOgUrl($variPreview); $produktcheck->setMetaOgType($variWeight2); $produktcheck->setMetaOgTitle($bestellnr); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $variISSFCertificateIn = $variISSFCertificate; } else { $variISSFCertificateIn = 0; } - $produktcheck->setMetaDescription("Color=>" . $variColor . ",Diameter=>" . $variDiameter . ",Length=>" . $variLength . ",Width=>" . $variWidth . ",PalletAmount=>" . $variPalletAmount . ",Weight2=>" . $variWeight2 . ",ISSFCertificate=>" . $variISSFCertificateIn . ",DSBSignum=>" . $variFree9 . ",NewPrice=>" .$variPrice . ",OldPrice=>" .$variFree15 . ",PriceInd=>" . $variPriceInd . "," . "PriceOut=>" . $variPriceout . ","); + $produktcheck->setMetaDescription('Color=>' . + $variColor . + ',Diameter=>' . + $variDiameter . + ',Length=>' . + $variLength . + ',Width=>' . + $variWidth . + ',PalletAmount=>' . + $variPalletAmount . + ',Weight2=>' . + $variWeight2 . + ',ISSFCertificate=>' . + $variISSFCertificateIn . + ',DSBSignum=>' . + $variFree9 . + ',NewPrice=>' . + $variPrice . + ',OldPrice=>' . + $variFree15 . + ',PriceInd=>' . + $variPriceInd . + ',' . + 'PriceOut=>' . + $variPriceout . + ','); if ($variPalletAmount == 1) { - $stueckvari = "pièce"; + $stueckvari = 'pièce'; } else { - $stueckvari = $variPalletAmount . " pièce"; + $stueckvari = $variPalletAmount . ' pièce'; } if ($variTaxKey == 5) { $variPriceInklMwSt = $variPrice * 1.07; @@ -630,16 +768,33 @@ $inarraycheckb = array(); $bruttopreis = number_format(round($variPriceInklMwSt, 2), 2, ',', ''); $nettopreis = number_format(round($variPrice, 2), 2, ',', ''); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $produktcheck->setMetaAuthor($variISSFCertificate); } if ($variAsOfAmount1b != intval(0)) { - $produktcheck->setMetaOgDescription(' '); - $staffelpreis = 'Échelle de prix:
de 1 à ' . $variAsOfAmount1 . ' = ' . $this->cutNumber(round($variPrice, 2)) . ' Euro
à partir de: ' . $variAsOfAmount1b . ' = ' . $this->cutNumber(round($variPriceStep1, 2)) . ' Euro'; - $description = "" . $variAddDescFR . "
" . $variAdd2DescFR; + $produktcheck->setMetaOgDescription(' '); + $staffelpreis = + 'Échelle de prix:
de 1 à ' . + $variAsOfAmount1 . + ' = ' . + $this->cutNumber(round($variPrice, 2)) . + ' Euro
à partir de: ' . + $variAsOfAmount1b . + ' = ' . + $this->cutNumber(round($variPriceStep1, 2)) . + ' Euro'; + $description = '' . $variAddDescFR . '
' . $variAdd2DescFR; $produktcheck->setMetaCustomTitle($staffelpreis); $produktcheck->setType(6); - if ($variWeight2 != "" AND $variWeight2 != NULL) { + if ($variWeight2 != '' and $variWeight2 != null) { $gewichtinkalk = $variWeight2 * 1000; $gewichtinkalk = intval($gewichtinkalk); } else { @@ -647,48 +802,75 @@ $inarraycheckb = array(); } $produktcheck->setCalcXml(' - ' . str_replace(array("
", "
", "&", "$"), " ", $variDescFR) . '
+ ' . + str_replace(['
', '
', '&', '$'], ' ', $variDescFR) . + '
'); } else { - if ($variISSFCertificate != NULL) { - $produktcheck->setMetaOgDescription(' '); - } else { - $produktcheck->setMetaOgDescription('
'); - } - $description = "
" . $variAddDescFR . "
" . $variAdd2DescFR . "
"; + if ($variISSFCertificate != null) { + $produktcheck->setMetaOgDescription(' '); + } else { + $produktcheck->setMetaOgDescription('
'); + } + $description = '
' . $variAddDescFR . '
' . $variAdd2DescFR . '
'; $produktcheck->setType(2); - $produktcheck->setCalcXml(NULL); + $produktcheck->setCalcXml(null); } $produktcheck->setDescription($description); $this->_entityManager->persist($produktcheck); - if ($variWeight2 != "" AND $variWeight2 != NULL) { + if ($variWeight2 != '' and $variWeight2 != null) { $gewicht = $variWeight2 * 1000; $gewicht = intval($gewicht); } else { $gewicht = 0; } - /** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */ $productDoc = $this->_doctrine_mongodb ->getRepository('PSC\Shop\EntityBundle\Document\Product') - ->findOneBy(array('uid' => (string)$produktcheck->getUid())); + ->findOneBy(['uid' => (string) $produktcheck->getUid()]); if ($productDoc) { $productDoc->setUid($produktcheck->getUid()); $productDoc->setWeight($gewicht); @@ -699,18 +881,25 @@ $inarraycheckb = array(); $productDoc->setWeight($gewicht); $this->_doctrine_mongodb->getManager()->persist($productDoc); } - - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $variMatGroupNo)); + + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $variMatGroupNo]); //\dump(intval($produktcheck->getUid())); //\dump(intval($allGroups->getUid())); - - if (in_array(intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()), $inarraycheck)) { + + if ( + in_array( + intval($produktcheck->getUid()) . ';' . intval($allGroups->getUid()), + $inarraycheck, + ) + ) { //dump("IST DRIN!!!"); $notinsert = true; } else { //dump("IST NICHT DRIN!!!"); $notinsert = false; - $inarraycheck[] .= intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()); + $inarraycheck[] .= intval($produktcheck->getUid()) . ';' . intval($allGroups->getUid()); } if (!$notinsert) { $artikelingroup = new ProductProductgroup(); @@ -719,61 +908,74 @@ $inarraycheckb = array(); $this->_entityManager->persist($artikelingroup); } - - if ($variMatGroupNoPlus != NULL) { - $teile = explode(";", $variMatGroupNoPlus); + if ($variMatGroupNoPlus != null) { + $teile = explode(';', $variMatGroupNoPlus); foreach ($teile as $key => $teile) { - if($teile != $variMatGroupNo) { - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $teile)); + if ($teile != $variMatGroupNo) { + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $teile]); - if ($allGroups AND in_array(intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()), $inarraycheckb)) { - //dump("IST DRIN!!!"); - $notinsertb = true; - } else { - if($allGroups) { - //dump("IST NICHT DRIN!!!"); - $notinsertb = false; - $inarraycheckb[] .= intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()); + if ( + $allGroups and + in_array( + intval($produktcheck->getUid()) . + ';' . + intval($allGroups->getUid()), + $inarraycheckb, + ) + ) { + //dump("IST DRIN!!!"); + $notinsertb = true; + } else { + if ($allGroups) { + //dump("IST NICHT DRIN!!!"); + $notinsertb = false; + $inarraycheckb[] .= + intval($produktcheck->getUid()) . + ';' . + intval($allGroups->getUid()); + } + } + + if ($allGroups and !$notinsertb) { + $artikelingroup = new ProductProductgroup(); + $artikelingroup->setProduct($produktcheck); + $artikelingroup->setGroup(intval($allGroups->getUid())); + $this->_entityManager->persist($artikelingroup); } } - - if ($allGroups AND !$notinsertb) { - $artikelingroup = new ProductProductgroup(); - $artikelingroup->setProduct($produktcheck); - $artikelingroup->setGroup(intval($allGroups->getUid())); - $this->_entityManager->persist($artikelingroup); - } } } - } } } - if ($counter % 10 == 0) { + if (($counter % 10) == 0) { $this->_entityManager->flush(); $this->_entityManager->clear(); $this->_doctrine_mongodb->getManager()->flush(); $this->_doctrine_mongodb->getManager()->clear(); } - + $counter++; - } - $produktchecknoActive = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "metaKeywords" => 0)); + $produktchecknoActive = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop, 'metaKeywords' => 0]); -foreach($produktchecknoActive as $produktchecknoActive) { - //\dump($produktchecknoActive->getUid()); - $produktchecknoActive->setEnable(NULL); -} + foreach ($produktchecknoActive as $produktchecknoActive) { + //\dump($produktchecknoActive->getUid()); + $produktchecknoActive->setEnable(null); + } + + $this->_entityManager->flush(); + $this->_entityManager->clear(); -$this->_entityManager->flush(); -$this->_entityManager->clear(); - rename($queueSettings->getFile(), $queueSettings->getFile() . '.old'); } - unlink($queueSettings->getFile() . "run_ai.txt"); + unlink($queueSettings->getFile() . 'run_ai.txt'); } catch (\Exception $e) { echo $e->getMessage(); return false; @@ -799,18 +1001,20 @@ $this->_entityManager->clear(); { if (strlen($string) > $lenght) { $string = substr($string, 0, $lenght); - $string_ende = strrchr($string, ""); - $string = str_replace($string_ende, "-", $string); + $string_ende = strrchr($string, ''); + $string = str_replace($string_ende, '-', $string); } return $string; } - function cutNumber($number, $decimals=2) { - $number = explode(".", $number, 2); + + function cutNumber($number, $decimals = 2) + { + $number = explode('.', $number, 2); //print_r($number); - if(!isset($number[1])) { - return $number[0].".00"; + if (!isset($number[1])) { + return $number[0] . '.00'; } else { - return $number[0].".".substr($number[1].str_repeat("0", $decimals), 0, $decimals); - } + return $number[0] . '.' . substr($number[1] . str_repeat('0', $decimals), 0, $decimals); } + } } diff --git a/src/new/var/plugins/Custom/Krueger/Artikelkundenimport/Queue/Import.php b/src/new/var/plugins/Custom/Krueger/Artikelkundenimport/Queue/Import.php index b8c72388d..4bd0d9dc0 100755 --- a/src/new/var/plugins/Custom/Krueger/Artikelkundenimport/Queue/Import.php +++ b/src/new/var/plugins/Custom/Krueger/Artikelkundenimport/Queue/Import.php @@ -2,7 +2,6 @@ namespace Plugin\Custom\Krueger\Artikelkundenimport\Queue; - use Ddeboer\DataImport\Reader\ArrayReader; use Ddeboer\DataImport\Workflow; use Doctrine\Bundle\MongoDBBundle\ManagerRegistry; @@ -14,17 +13,18 @@ use PSC\Shop\EntityBundle\Document\Queue; use PSC\Shop\EntityBundle\Entity\Account; use PSC\Shop\EntityBundle\Entity\Contact; use PSC\Shop\EntityBundle\Entity\ContactRole; -use PSC\Shop\EntityBundle\Entity\Role; -use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\EntityBundle\Entity\Productgroup; use PSC\Shop\EntityBundle\Entity\ProductProductgroup; +use PSC\Shop\EntityBundle\Entity\Role; +use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\Shop\EntityBundle\Repository\ProductProductgroupRepository; use PSC\Shop\QueueBundle\Event\EventInterface; use PSC\Shop\QueueBundle\Event\Position\Printpartner\Notify; use PSC\Shop\QueueBundle\Type\ConfigurableElementInterface; use PSC\Shop\QueueBundle\Type\QueueInterface; use Ramsey\Uuid\Uuid; +use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Form; use Symfony\Component\Form\FormBuilderInterface; @@ -33,7 +33,6 @@ use Symfony\Component\Form\FormFactoryInterface; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; -use Symfony\Bundle\SecurityBundle\Security; class Import implements QueueInterface, ConfigurableElementInterface { @@ -43,8 +42,11 @@ class Import implements QueueInterface, ConfigurableElementInterface private $_doctrine_mongodb = null; private $_error = null; - function __construct(FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, ManagerRegistry $doctrine_mongodb) - { + function __construct( + FormFactoryInterface $formFactory, + EntityManagerInterface $entityManager, + ManagerRegistry $doctrine_mongodb, + ) { $this->_formFactory = $formFactory; $this->_entityManager = $entityManager; $this->_doctrine_mongodb = $doctrine_mongodb; @@ -78,8 +80,16 @@ class Import implements QueueInterface, ConfigurableElementInterface public function getForm(FormBuilderInterface $builder, $form_options, EventInterface $event) { - $builder->add("file", TextType::class, array('empty_data' => '/data/www/old/data/packages/import/artikel.xml', 'label' => 'Import Datei', 'attr' => array('class' => 'form-element'))); - $builder->add("shop", TextType::class, array('empty_data' => '1', 'label' => 'Shop Id', 'attr' => array('class' => 'form-element'))); + $builder->add('file', TextType::class, [ + 'empty_data' => '/data/www/old/data/packages/import/artikel.xml', + 'label' => 'Import Datei', + 'attr' => ['class' => 'form-element'], + ]); + $builder->add('shop', TextType::class, [ + 'empty_data' => '1', + 'label' => 'Shop Id', + 'attr' => ['class' => 'form-element'], + ]); } public function injectDocument(Form $form, EventInterface $event, Queue $objQueue) @@ -107,33 +117,33 @@ class Import implements QueueInterface, ConfigurableElementInterface */ public function execute(EventInterface $event, Queue $doc) { -//$produktgroupcheck = new Productgroup; -//dump($produktgroupcheck); + //$produktgroupcheck = new Productgroup; + //dump($produktgroupcheck); try { /** @var \Plugin\Custom\Krueger\Artikelkundenimport\Document\Import $queueSettings */ $queueSettings = $doc->getQueueDocument(); - if (file_exists($queueSettings->getFile() . "run_ai.txt")) return true; + if (file_exists($queueSettings->getFile() . 'run_ai.txt')) + return true; - file_put_contents($queueSettings->getFile() . "run_ai.txt", "import"); + file_put_contents($queueSettings->getFile() . 'run_ai.txt', 'import'); set_time_limit(0); if (file_exists($queueSettings->getFile())) { - $article = file_get_contents($queueSettings->getFile()); $xml = simplexml_load_string($article, 'SimpleXMLElement', LIBXML_NOWARNING); $counter = 0; - $group = "groups"; + $group = 'groups'; //sort($xml->tblMaterialGroup->Details_Collection->Details); //dump($xml->tblMaterialGroup->Details_Collection->Details->attributes()->MatGroup_DescDE); - $items = array(); + $items = []; foreach ($xml->tblMaterialGroup->Details_Collection->Details as $item) { //dump($item->attributes()->MatGroup_DescDE); $items[] .= $item->attributes()->MatGroup_DescDE; - }; + } // Custom sort on the names of the items: //usort ($items, function($a, $b) { @@ -141,7 +151,7 @@ class Import implements QueueInterface, ConfigurableElementInterface //}); natsort($items); - $itemsID = array(); + $itemsID = []; $counter = 1; foreach ($items as $item) { //echo $item; @@ -155,22 +165,27 @@ class Import implements QueueInterface, ConfigurableElementInterface //die("TEST"); foreach ($xml->tblMaterialGroup->Details_Collection->Details as $value) { - $selectedShop = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Shop')->findOneBy(array("uid" => intval($queueSettings->getShop()))); + $selectedShop = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Shop') + ->findOneBy(['uid' => intval($queueSettings->getShop())]); - $selectedContakt = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(array("company" => $value->attributes()->MainContactNo1)); + $selectedContakt = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Contact') + ->findOneBy(['company' => $value->attributes()->MainContactNo1]); $variMatGroupNo = $value->attributes()->MatGroup_MatGroupNo; $variGrDescDEName = strtolower($value->attributes()->MatGroup_DescDE); //dump($variMatGroupNo); $variGrDescDE = $value->attributes()->MatGroup_DescDE; - //var_dump( array_key_exists($variGrDescDE, $itemsID) ); $arraykey = array_keys($itemsID, $variGrDescDE); //echo $arraykey[0]; //die("TEST"); - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("metaOGType" => $variMatGroupNo, "shop" => $selectedShop)); + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['metaOGType' => $variMatGroupNo, 'shop' => $selectedShop]); //dump($allGroups); $variGrDescEN = $value->attributes()->GrDescEN; $variGrDescFR = $value->attributes()->GrDescFR; @@ -201,47 +216,44 @@ class Import implements QueueInterface, ConfigurableElementInterface $variSalesInd = $value->attributes()->SalesInd; $variFree9 = $value->attributes()->Free9; $variFree15 = $value->attributes()->PriceOld; - $variDescDE = \str_replace(" ", " ", $variDescDE); - $variFree15 = \str_replace(",", ".", $variFree15); + $variDescDE = \str_replace(' ', ' ', $variDescDE); + $variFree15 = \str_replace(',', '.', $variFree15); - if($variFree15 == "") { + if ($variFree15 == '') { $variFree15 = 0; } if (!$allGroups) { - $productgroup = new Productgroup(); $productgroup->setShop($selectedShop); - if ($variSalesInd == "True") { + if ($variSalesInd == 'True') { $productgroup->setEnable(true); } else { $productgroup->setEnable(false); } - + $productgroup->setMetaOGType($variMatGroupNo); $productgroup->setTitle($variGrDescDE); $productgroup->setUrl($this->clean(strtolower($value->attributes()->MatGroup_DescDE))); $productgroup->setPos($arraykey[0]); - $productgroup->setLanguage("all"); + $productgroup->setLanguage('all'); $this->_entityManager->persist($productgroup); } else { - $allGroups->setShop($selectedShop); - if ($variSalesInd == "True") { + if ($variSalesInd == 'True') { $allGroups->setEnable(true); } else { $allGroups->setEnable(false); } - + $allGroups->setMetaOGType($variMatGroupNo); $allGroups->setTitle($variGrDescDE); $allGroups->setUrl($this->clean(strtolower($value->attributes()->MatGroup_DescDE))); $allGroups->setPos($arraykey[0]); - $allGroups->setLanguage("all"); + $allGroups->setLanguage('all'); $this->_entityManager->persist($allGroups); - } - - if ($counter % 10 == 0) { + + if (($counter % 10) == 0) { $this->_entityManager->flush(); $this->_entityManager->clear(); $this->_doctrine_mongodb->getManager()->flush(); @@ -250,31 +262,38 @@ class Import implements QueueInterface, ConfigurableElementInterface $counter++; } - $counter = 0; - $setproduk = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop)); - foreach($setproduk as $setproduk) { - $setproduk->setMetaKeywords(0); - //$setproduk->setEnable(false); - } + $setproduk = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop]); + foreach ($setproduk as $setproduk) { + $setproduk->setMetaKeywords(0); - foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { - $variMaterialNo = $value->attributes()->MaterialNo; - $produktcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variMaterialNo)); - if($produktcheck) { - //dump(intval($produktcheck->getUid())); + //$setproduk->setEnable(false); + } + + foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { + $variMaterialNo = $value->attributes()->MaterialNo; + $produktcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findOneBy(['shop' => $selectedShop, 'nrIntern' => $variMaterialNo]); + if ($produktcheck) { + //dump(intval($produktcheck->getUid())); $this->_entityManager ->createQuery(' - DELETE FROM PSCEntityBundle:ProductProductgroup p - WHERE p.product = :product_id')->setParameter('product_id', $produktcheck->getUid())->execute(); - } - } -$inarraycheck = array(); -$inarraycheckb = array(); + DELETE FROM PSC\Shop\EntityBundle\Entity\ProductProductgroup p + WHERE p.product = :product_id') + ->setParameter('product_id', $produktcheck->getUid()) + ->execute(); + } + } + $inarraycheck = []; + $inarraycheckb = []; foreach ($xml->tblMaterials->Detail_Collection->Detail as $value) { - $selectedShop = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Shop')->findOneBy(array("uid" => intval($queueSettings->getShop()))); + $selectedShop = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Shop') + ->findOneBy(['uid' => intval($queueSettings->getShop())]); - $variMatGroupNo = $value->attributes()->MatGroupNo; $variGrDescDEName = strtolower($value->attributes()->GrDescDE); @@ -325,22 +344,21 @@ $inarraycheckb = array(); $variFree9 = $value->attributes()->Free9; $variFree15 = $value->attributes()->PriceOld; - $variDescDE = \str_replace(" ", " ", $variDescDE); - $variFree15 = \str_replace(",", ".", $variFree15); - if($variFree15 == "") { + $variDescDE = \str_replace(' ', ' ', $variDescDE); + $variFree15 = \str_replace(',', '.', $variFree15); + if ($variFree15 == '') { $variFree15 = 0; } /* - 0 = per 1 Stück - 1 = per 10 Stück - 2 = per 100 Stück - 3 = per 1000 Stück - 9 = Gesamtpreis - $variPrice - $variPriceInd - $variPalletAmount - */ - + * 0 = per 1 Stück + * 1 = per 10 Stück + * 2 = per 100 Stück + * 3 = per 1000 Stück + * 9 = Gesamtpreis + * $variPrice + * $variPriceInd + * $variPalletAmount + */ if ($variPriceInd == 0) { $variPrice = $variPrice; @@ -351,29 +369,29 @@ $inarraycheckb = array(); $variPriceStep4 = $variPriceStep1; $variPriceStep5 = $variPriceStep1; } else if ($variPriceInd == 1) { - $variPrice = $variPrice / 10 * $variPalletAmount; - $variFree15 = $variFree15 / 10 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 10 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 10 * $variPalletAmount; + $variPrice = ($variPrice / 10) * $variPalletAmount; + $variFree15 = ($variFree15 / 10) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 10) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 10) * $variPalletAmount; } else if ($variPriceInd == 2) { - $variPrice = $variPrice / 100 * $variPalletAmount; - $variFree15 = $variFree15 / 100 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 100 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 100 * $variPalletAmount; + $variPrice = ($variPrice / 100) * $variPalletAmount; + $variFree15 = ($variFree15 / 100) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 100) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 100) * $variPalletAmount; } else if ($variPriceInd == 3) { - $variPrice = $variPrice / 1000 * $variPalletAmount; - $variFree15 = $variFree15 / 1000 * $variPalletAmount; - $variPriceStep1 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep2 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep3 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep4 = $variPriceStep1 / 1000 * $variPalletAmount; - $variPriceStep5 = $variPriceStep1 / 1000 * $variPalletAmount; + $variPrice = ($variPrice / 1000) * $variPalletAmount; + $variFree15 = ($variFree15 / 1000) * $variPalletAmount; + $variPriceStep1 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep2 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep3 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep4 = ($variPriceStep1 / 1000) * $variPalletAmount; + $variPriceStep5 = ($variPriceStep1 / 1000) * $variPalletAmount; } else if ($variPriceInd == 9) { $variPrice = $variPrice; $variFree15 = $variFree15; @@ -384,8 +402,7 @@ $inarraycheckb = array(); $variPriceStep5 = $variPriceStep1; } - - if($variPalletAmount == 0 or $variPalletAmount == "") { + if ($variPalletAmount == 0 or $variPalletAmount == '') { if ($variPriceInd == 3) { $variPrice = $variPriceout / 1000; $variFree15 = $variPriceout / 1000; @@ -393,49 +410,58 @@ $inarraycheckb = array(); } if ($variPriceInd == 0) { $variPrice = $variPriceout; - $variFree15 = $variPriceout; + $variFree15 = $variPriceout; $variPalletAmountohne = 1000; } } - //\var_dump("PREISOUT" . $variPriceout); - //\var_dump("PREISIND" . $variPriceInd); - //\var_dump("PREIS" . $variPrice); - if ($variDescDE != "") { - $produktcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('shop' => $selectedShop, "nrIntern" => $variMaterialNo)); + //\var_dump("PREISOUT" . $variPriceout); + //\var_dump("PREISIND" . $variPriceInd); + //\var_dump("PREIS" . $variPrice); + if ($variDescDE != '') { + $produktcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findOneBy(['shop' => $selectedShop, 'nrIntern' => $variMaterialNo]); if (!$produktcheck) { $product = new Product(); $product->setMetaKeywords(1); $product->setShop($selectedShop); - if ($variClientNo != "") { + if ($variClientNo != '') { $product->setPrivate(1); $product->setMetaAuthor($variClientNo); } $product->setInstall($selectedShop->getInstall()->getUid()); $product->setEnable(true); - $urlcheck = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "title" => $variDescDE)); + $urlcheck = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop, 'title' => $variDescDE]); if (!$urlcheck) { $product->setUrl($this->shortText($this->clean(strtolower($variDescDE)), 50)); } else { - $product->setUrl($this->shortText($this->clean(strtolower($variDescDE)), 50) . "-" . count($urlcheck)); + $product->setUrl( + $this->shortText($this->clean(strtolower($variDescDE)), 50) . + '-' . + count($urlcheck), + ); } - if ($variMaterialNo != "") { - $bestellnr = ''; + if ($variMaterialNo != '') { + $bestellnr = + ''; } else { - $bestellnr = ""; + $bestellnr = ''; } - if ($variColor != "") { - $farbe = "
Farbe:" . $variColor; + if ($variColor != '') { + $farbe = '
Farbe:' . $variColor; } else { - $farbe = ""; + $farbe = ''; } - if ($variWeight2 != "") { - $gewicht = "
Gewicht:" . $variWeight2; + if ($variWeight2 != '') { + $gewicht = '
Gewicht:' . $variWeight2; } else { - $gewicht = ""; + $gewicht = ''; } $product->setTitle($variDescDE); - $product->setCustomTabText(""); + $product->setCustomTabText(''); $product->setConfirm(false); $product->setNotEdit(false); $product->setConfirmOne(false); @@ -450,31 +476,56 @@ $inarraycheckb = array(); $product->setMwert(19); $productmwst = 19; } - if($variPrice == NULL) { + if ($variPrice == null) { $product->setCanBuyWithNoPrice(true); } $product->setNrIntern($variMaterialNo); - $teile = explode(" ", $variMaterialNo); - $teile = explode("-", $teile[0]); - $teile = explode("/", $teile[0]); + $teile = explode(' ', $variMaterialNo); + $teile = explode('-', $teile[0]); + $teile = explode('/', $teile[0]); $number = str_replace(['+', '-'], '', filter_var($teile[0], FILTER_SANITIZE_NUMBER_INT)); $product->setPos($number); - $product->setUploadProduct(""); - $product->setUploadPost(""); - $product->setUploadEmail(""); - $product->setUploadCenter(""); - $product->setHintText(""); + $product->setUploadProduct(''); + $product->setUploadPost(''); + $product->setUploadEmail(''); + $product->setUploadCenter(''); + $product->setHintText(''); $product->setMetaOgImage($variImage); $product->setMetaOgUrl($variPreview); $product->setMetaOgType($variWeight2); $product->setMetaOgTitle($bestellnr); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $variISSFCertificateIn = $variISSFCertificate; } else { $variISSFCertificateIn = 0; } - $product->setMetaDescription("Color=>" . $variColor . ",Diameter=>" . $variDiameter . ",Length=>" . $variLength . ",Width=>" . $variWidth . ",PalletAmount=>" . $variPalletAmount . ",Weight2=>" . $variWeight2 . ",ISSFCertificate=>" . $variISSFCertificateIn . ",DSBSignum=>" . $variFree9 . ",NewPrice=>" .$variPrice . ",OldPrice=>" .$variFree15 . ",PriceInd=>" . $variPriceInd . "," . "PriceOut=>" . $variPriceout . ","); - + $product->setMetaDescription('Color=>' . + $variColor . + ',Diameter=>' . + $variDiameter . + ',Length=>' . + $variLength . + ',Width=>' . + $variWidth . + ',PalletAmount=>' . + $variPalletAmount . + ',Weight2=>' . + $variWeight2 . + ',ISSFCertificate=>' . + $variISSFCertificateIn . + ',DSBSignum=>' . + $variFree9 . + ',NewPrice=>' . + $variPrice . + ',OldPrice=>' . + $variFree15 . + ',PriceInd=>' . + $variPriceInd . + ',' . + 'PriceOut=>' . + $variPriceout . + ','); + if ($variTaxKey == 5) { $variPriceInklMwSt = $variPrice * 1.07; } else if ($variTaxKey == 21) { @@ -482,62 +533,111 @@ $inarraycheckb = array(); } else { $variPriceInklMwSt = $variPrice * 1.19; } - if($variPalletAmountohne) { + if ($variPalletAmountohne) { if ($variPalletAmountohne == 1) { - $stueckvari = "Stück"; + $stueckvari = 'Stück'; } else { - $stueckvari = $variPalletAmountohne . " Stück"; + $stueckvari = $variPalletAmountohne . ' Stück'; } - $bruttopreis = number_format(round($variPriceInklMwSt*$variPalletAmountohne, 2), 2, ',', ''); - $nettopreis = number_format(round($variPrice*$variPalletAmountohne, 2), 2, ',', ''); + $bruttopreis = number_format( + round($variPriceInklMwSt * $variPalletAmountohne, 2), + 2, + ',', + '', + ); + $nettopreis = number_format(round($variPrice * $variPalletAmountohne, 2), 2, ',', ''); } else { - if ($variPalletAmount == 1) { - $stueckvari = "Stück"; - } else { - $stueckvari = $variPalletAmount . " Stück"; + if ($variPalletAmount == 1) { + $stueckvari = 'Stück'; + } else { + $stueckvari = $variPalletAmount . ' Stück'; + } + $bruttopreis = number_format(round($variPriceInklMwSt, 2), 2, ',', ''); + $nettopreis = number_format(round($variPrice, 2), 2, ',', ''); } - $bruttopreis = number_format(round($variPriceInklMwSt, 2), 2, ',', ''); - $nettopreis = number_format(round($variPrice, 2), 2, ',', ''); - } - - - if ($variISSFCertificate != NULL) { + + if ($variISSFCertificate != null) { $product->setMetaAuthor($variISSFCertificate); } if ($variAsOfAmount1b != intval(0)) { - $product->setMetaOgDescription(' '); - $staffelpreis = 'Preisstaffel:
von 1 bis ' . $variAsOfAmount1 . ' = ' . $this->cutNumber(round($variPrice, 2)) . ' Euro
ab: ' . $variAsOfAmount1b . ' = ' . $this->cutNumber(round($variPriceStep1,2)) . ' Euro'; - $description = "" . $variAddDescDE . "
" . $variAdd2DescDE; + $product->setMetaOgDescription(' '); + $staffelpreis = + 'Preisstaffel:
von 1 bis ' . + $variAsOfAmount1 . + ' = ' . + $this->cutNumber(round($variPrice, 2)) . + ' Euro
ab: ' . + $variAsOfAmount1b . + ' = ' . + $this->cutNumber(round($variPriceStep1, 2)) . + ' Euro'; + $description = '' . $variAddDescDE . '
' . $variAdd2DescDE; $product->setMetaCustomTitle($staffelpreis); $product->setType(6); $product->setCalcXml(' - ' . str_replace(array("
", "
", "&", "$"), " ", $variDescDE) . '
+ ' . + str_replace(['
', '
', '&', '$'], ' ', $variDescDE) . + '
'); } else { - if ($variISSFCertificate != NULL) { - $product->setMetaOgDescription(' '); + if ($variISSFCertificate != null) { + $product->setMetaOgDescription(' '); } else { - $product->setMetaOgDescription('
'); + $product->setMetaOgDescription('
'); } - $description = "
" . $variAddDescDE . "
" . $variAdd2DescDE . "
"; + $description = '
' . $variAddDescDE . '
' . $variAdd2DescDE . '
'; $product->setType(2); - $product->setCalcXml(NULL); + $product->setCalcXml(null); } $product->setDescription($description); $this->_entityManager->persist($product); - - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $variMatGroupNo)); + + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $variMatGroupNo]); if ($allGroups) { $artikelingroup = new ProductProductgroup(); @@ -546,11 +646,12 @@ $inarraycheckb = array(); $this->_entityManager->persist($artikelingroup); } - - if ($variMatGroupNoPlus != NULL) { - $teile = explode(";", $variMatGroupNoPlus); + if ($variMatGroupNoPlus != null) { + $teile = explode(';', $variMatGroupNoPlus); foreach ($teile as $key => $teile) { - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $teile)); + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $teile]); if ($allGroups) { $artikelingroup = new ProductProductgroup(); $artikelingroup->setProduct($product); @@ -565,29 +666,30 @@ $inarraycheckb = array(); $produktcheck->setInstall($selectedShop->getInstall()->getUid()); $produktcheck->setType(2); $produktcheck->setEnable(true); - if ($variClientNo != "") { + if ($variClientNo != '') { $produktcheck->setPrivate(1); $produktcheck->setMetaAuthor($variClientNo); } //Je Verpackungseinheit //IF Abfragen für Farbe und Co. - if ($variMaterialNo != "") { - $bestellnr = ''; + if ($variMaterialNo != '') { + $bestellnr = + ''; } else { - $bestellnr = ""; + $bestellnr = ''; } - if ($variColor != "") { - $farbe = "
Farbe:" . $variColor; + if ($variColor != '') { + $farbe = '
Farbe:' . $variColor; } else { - $farbe = ""; + $farbe = ''; } - if ($variWeight2 != "") { - $gewicht = "
Gewicht:" . $variWeight2; + if ($variWeight2 != '') { + $gewicht = '
Gewicht:' . $variWeight2; } else { - $gewicht = ""; + $gewicht = ''; } $produktcheck->setTitle($variDescDE); - $produktcheck->setCustomTabText(""); + $produktcheck->setCustomTabText(''); $produktcheck->setConfirm(false); $produktcheck->setNotEdit(false); $produktcheck->setConfirmOne(false); @@ -602,30 +704,55 @@ $inarraycheckb = array(); $produktcheck->setMwert(19); $productmwst = 19; } - if($variPrice == NULL) { + if ($variPrice == null) { $produktcheck->setCanBuyWithNoPrice(true); } $produktcheck->setNrIntern($variMaterialNo); - $teile = explode(" ", $variMaterialNo); - $teile = explode("-", $teile[0]); - $teile = explode("/", $teile[0]); + $teile = explode(' ', $variMaterialNo); + $teile = explode('-', $teile[0]); + $teile = explode('/', $teile[0]); $number = str_replace(['+', '-'], '', filter_var($teile[0], FILTER_SANITIZE_NUMBER_INT)); $produktcheck->setPos($number); - $produktcheck->setUploadProduct(""); - $produktcheck->setHintText(""); - $produktcheck->setUploadPost(""); - $produktcheck->setUploadEmail(""); - $produktcheck->setUploadCenter(""); + $produktcheck->setUploadProduct(''); + $produktcheck->setHintText(''); + $produktcheck->setUploadPost(''); + $produktcheck->setUploadEmail(''); + $produktcheck->setUploadCenter(''); $produktcheck->setMetaOgImage($variImage); $produktcheck->setMetaOgUrl($variPreview); $produktcheck->setMetaOgType($variWeight2); $produktcheck->setMetaOgTitle($bestellnr); - if ($variISSFCertificate != NULL) { + if ($variISSFCertificate != null) { $variISSFCertificateIn = $variISSFCertificate; } else { $variISSFCertificateIn = 0; } - $produktcheck->setMetaDescription("Color=>" . $variColor . ",Diameter=>" . $variDiameter . ",Length=>" . $variLength . ",Width=>" . $variWidth . ",PalletAmount=>" . $variPalletAmount . ",Weight2=>" . $variWeight2 . ",ISSFCertificate=>" . $variISSFCertificateIn . ",DSBSignum=>" . $variFree9 . ",NewPrice=>" .$variPrice . ",OldPrice=>" .$variFree15 . ",PriceInd=>" . $variPriceInd . "," . "PriceOut=>" . $variPriceout . ","); + $produktcheck->setMetaDescription('Color=>' . + $variColor . + ',Diameter=>' . + $variDiameter . + ',Length=>' . + $variLength . + ',Width=>' . + $variWidth . + ',PalletAmount=>' . + $variPalletAmount . + ',Weight2=>' . + $variWeight2 . + ',ISSFCertificate=>' . + $variISSFCertificateIn . + ',DSBSignum=>' . + $variFree9 . + ',NewPrice=>' . + $variPrice . + ',OldPrice=>' . + $variFree15 . + ',PriceInd=>' . + $variPriceInd . + ',' . + 'PriceOut=>' . + $variPriceout . + ','); if ($variTaxKey == 5) { $variPriceInklMwSt = $variPrice * 1.07; @@ -634,75 +761,122 @@ $inarraycheckb = array(); } else { $variPriceInklMwSt = $variPrice * 1.19; } - if(isset($variPalletAmountohne)) { + if (isset($variPalletAmountohne)) { if ($variPalletAmountohne == 1) { - $stueckvari = "Stück"; + $stueckvari = 'Stück'; } else { - $stueckvari = $variPalletAmountohne . " Stück"; + $stueckvari = $variPalletAmountohne . ' Stück'; } - $bruttopreis = number_format(round($variPriceInklMwSt*$variPalletAmountohne, 2), 2, ',', ''); - $nettopreis = number_format(round($variPrice*$variPalletAmountohne, 2), 2, ',', ''); + $bruttopreis = number_format( + round($variPriceInklMwSt * $variPalletAmountohne, 2), + 2, + ',', + '', + ); + $nettopreis = number_format(round($variPrice * $variPalletAmountohne, 2), 2, ',', ''); } else { - if ($variPalletAmount == 1) { - $stueckvari = "Stück"; - } else { - $stueckvari = $variPalletAmount . " Stück"; + if ($variPalletAmount == 1) { + $stueckvari = 'Stück'; + } else { + $stueckvari = $variPalletAmount . ' Stück'; + } + $bruttopreis = number_format(round($variPriceInklMwSt, 2), 2, ',', ''); + $nettopreis = number_format(round($variPrice, 2), 2, ',', ''); } - $bruttopreis = number_format(round($variPriceInklMwSt, 2), 2, ',', ''); - $nettopreis = number_format(round($variPrice, 2), 2, ',', ''); - } - \var_dump("PREISOUT" . $variPriceout); - \var_dump("PREISIND" . $variPriceInd); - \var_dump("PREIS" . $variPrice); - \var_dump("PalletAmountohne" . $variPalletAmountohne); - if ($variISSFCertificate != NULL) { + \var_dump('PREISOUT' . $variPriceout); + \var_dump('PREISIND' . $variPriceInd); + \var_dump('PREIS' . $variPrice); + \var_dump('PalletAmountohne' . $variPalletAmountohne); + if ($variISSFCertificate != null) { $produktcheck->setMetaAuthor($variISSFCertificate); } if ($variAsOfAmount1b != intval(0)) { - $produktcheck->setMetaOgDescription(' '); - $staffelpreis = 'Preisstaffel:
von 1 bis ' . $variAsOfAmount1 . ' = ' . $this->cutNumber(round($variPrice, 2)) . ' Euro
ab: ' . $variAsOfAmount1b . ' = ' . $this->cutNumber(round($variPriceStep1, 2)) . ' Euro'; - $description = "" . $variAddDescDE . "
" . $variAdd2DescDE; + $produktcheck->setMetaOgDescription(' '); + $staffelpreis = + 'Preisstaffel:
von 1 bis ' . + $variAsOfAmount1 . + ' = ' . + $this->cutNumber(round($variPrice, 2)) . + ' Euro
ab: ' . + $variAsOfAmount1b . + ' = ' . + $this->cutNumber(round($variPriceStep1, 2)) . + ' Euro'; + $description = '' . $variAddDescDE . '
' . $variAdd2DescDE; $produktcheck->setMetaCustomTitle($staffelpreis); $produktcheck->setType(6); $produktcheck->setCalcXml(' - ' . str_replace(array("
", "
", "&", "$"), " ", $variDescDE) . '
+ ' . + str_replace(['
', '
', '&', '$'], ' ', $variDescDE) . + '
'); } else { - if ($variISSFCertificate != NULL) { - $produktcheck->setMetaOgDescription(' '); - } else { - $produktcheck->setMetaOgDescription('
'); - } - $description = "
" . $variAddDescDE . "
" . $variAdd2DescDE . "
"; + if ($variISSFCertificate != null) { + $produktcheck->setMetaOgDescription(' '); + } else { + $produktcheck->setMetaOgDescription('
'); + } + $description = '
' . $variAddDescDE . '
' . $variAdd2DescDE . '
'; $produktcheck->setType(2); - $produktcheck->setCalcXml(NULL); + $produktcheck->setCalcXml(null); } $produktcheck->setDescription($description); $this->_entityManager->persist($produktcheck); - if ($variWeight2 != "" AND $variWeight2 != NULL) { + if ($variWeight2 != '' and $variWeight2 != null) { $gewicht = $variWeight2 * 1000; $gewicht = intval($gewicht); } else { $gewicht = 0; } - /** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */ $productDoc = $this->_doctrine_mongodb ->getRepository('PSC\Shop\EntityBundle\Document\Product') - ->findOneBy(array('shop' => $selectedShop, 'uid' => (string)$produktcheck->getUid())); + ->findOneBy(['shop' => $selectedShop, 'uid' => (string) $produktcheck->getUid()]); if ($productDoc) { $productDoc->setUid($produktcheck->getUid()); $productDoc->setWeight($gewicht); @@ -713,19 +887,25 @@ $inarraycheckb = array(); $productDoc->setWeight($gewicht); $this->_doctrine_mongodb->getManager()->persist($productDoc); } - - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $variMatGroupNo)); + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $variMatGroupNo]); //\dump(intval($produktcheck->getUid())); //\dump(intval($allGroups->getUid())); - - if (in_array(intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()), $inarraycheck)) { + + if ( + in_array( + intval($produktcheck->getUid()) . ';' . intval($allGroups->getUid()), + $inarraycheck, + ) + ) { //dump("IST DRIN!!!"); $notinsert = true; } else { //dump("IST NICHT DRIN!!!"); $notinsert = false; - $inarraycheck[] .= intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()); + $inarraycheck[] .= intval($produktcheck->getUid()) . ';' . intval($allGroups->getUid()); } if (!$notinsert) { $artikelingroup = new ProductProductgroup(); @@ -734,24 +914,32 @@ $inarraycheckb = array(); $this->_entityManager->persist($artikelingroup); } - - if ($variMatGroupNoPlus != NULL) { - $teile = explode(";", $variMatGroupNoPlus); + if ($variMatGroupNoPlus != null) { + $teile = explode(';', $variMatGroupNoPlus); foreach ($teile as $key => $teile) { - $allGroups = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup')->findOneBy(array("shop" => $selectedShop, "metaOGType" => $teile)); + $allGroups = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Productgroup') + ->findOneBy(['shop' => $selectedShop, 'metaOGType' => $teile]); - if ($allGroups AND in_array(intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()), $inarraycheckb)) { + if ( + $allGroups and + in_array( + intval($produktcheck->getUid()) . ';' . intval($allGroups->getUid()), + $inarraycheckb, + ) + ) { //dump("IST DRIN!!!"); $notinsertb = true; } else { - if($allGroups) { - //dump("IST NICHT DRIN!!!"); - $notinsertb = false; - $inarraycheckb[] .= intval($produktcheck->getUid()) . ";" . intval($allGroups->getUid()); + if ($allGroups) { + //dump("IST NICHT DRIN!!!"); + $notinsertb = false; + $inarraycheckb[] .= + intval($produktcheck->getUid()) . ';' . intval($allGroups->getUid()); } } - if ($allGroups AND !$notinsertb) { + if ($allGroups and !$notinsertb) { $artikelingroup = new ProductProductgroup(); $artikelingroup->setProduct($produktcheck); $artikelingroup->setGroup(intval($allGroups->getUid())); @@ -762,31 +950,32 @@ $inarraycheckb = array(); } } - if ($counter % 10 == 0) { + if (($counter % 10) == 0) { $this->_entityManager->flush(); $this->_entityManager->clear(); $this->_doctrine_mongodb->getManager()->flush(); $this->_doctrine_mongodb->getManager()->clear(); } - + $counter++; - } - $produktchecknoActive = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array('shop' => $selectedShop, "metaKeywords" => 0)); + $produktchecknoActive = $this->_entityManager + ->getRepository('PSC\Shop\EntityBundle\Entity\Product') + ->findBy(['shop' => $selectedShop, 'metaKeywords' => 0]); -foreach($produktchecknoActive as $produktchecknoActive) { - //\dump($produktchecknoActive->getUid()); - $produktchecknoActive->setEnable(NULL); -} + foreach ($produktchecknoActive as $produktchecknoActive) { + //\dump($produktchecknoActive->getUid()); + $produktchecknoActive->setEnable(null); + } + + $this->_entityManager->flush(); + $this->_entityManager->clear(); -$this->_entityManager->flush(); -$this->_entityManager->clear(); - rename($queueSettings->getFile(), $queueSettings->getFile() . '.old'); } - unlink($queueSettings->getFile() . "run_ai.txt"); + unlink($queueSettings->getFile() . 'run_ai.txt'); } catch (\Exception $e) { echo $e->getMessage(); return false; @@ -812,18 +1001,20 @@ $this->_entityManager->clear(); { if (strlen($string) > $lenght) { $string = substr($string, 0, $lenght); - $string_ende = strrchr($string, ""); - $string = str_replace($string_ende, "-", $string); + $string_ende = strrchr($string, ''); + $string = str_replace($string_ende, '-', $string); } return $string; } - function cutNumber($number, $decimals=2) { - $number = explode(".", $number, 2); + + function cutNumber($number, $decimals = 2) + { + $number = explode('.', $number, 2); //print_r($number); - if(!isset($number[1])) { - return $number[0].".00"; + if (!isset($number[1])) { + return $number[0] . '.00'; } else { - return $number[0].".".substr($number[1].str_repeat("0", $decimals), 0, $decimals); - } + return $number[0] . '.' . substr($number[1] . str_repeat('0', $decimals), 0, $decimals); } + } } diff --git a/src/new/var/plugins/Custom/Krueger/Erlkonten/Controller/StartController.php b/src/new/var/plugins/Custom/Krueger/Erlkonten/Controller/StartController.php index d0d76fd5c..3f041d062 100755 --- a/src/new/var/plugins/Custom/Krueger/Erlkonten/Controller/StartController.php +++ b/src/new/var/plugins/Custom/Krueger/Erlkonten/Controller/StartController.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -17,7 +17,7 @@ use Symfony\Component\Routing\Attribute\Route; class StartController extends AbstractController { #[Route("/start/{lkenn}", name: "plugin_custom_krueger_Erlkonten_load")] - #[Template] + #[Template('@PluginCustomKruegerErlkontenController/start/start.html.twig')] public function startAction($lkenn, DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security) { $article = file_get_contents("/data/www/old/data/packages/import/ERLKonten.xml"); diff --git a/src/new/var/plugins/Custom/Krueger/KDVcheckout/Controller/StartController.php b/src/new/var/plugins/Custom/Krueger/KDVcheckout/Controller/StartController.php index ec558d392..bea8cb00e 100755 --- a/src/new/var/plugins/Custom/Krueger/KDVcheckout/Controller/StartController.php +++ b/src/new/var/plugins/Custom/Krueger/KDVcheckout/Controller/StartController.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -21,7 +21,7 @@ use Symfony\Component\Routing\Attribute\Route; class StartController extends AbstractController { #[Route("/start", name: "plugin_custom_kdv_checkout_load")] - #[Template] + #[Template('@PluginCustomKruegerKDVcheckoutController/start/start.html.twig')] public function startAction(DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManagerService) { /* diff --git a/src/new/var/plugins/Custom/Krueger/KDVwingame/Controller/StartController.php b/src/new/var/plugins/Custom/Krueger/KDVwingame/Controller/StartController.php index 3d768482d..7b159f079 100755 --- a/src/new/var/plugins/Custom/Krueger/KDVwingame/Controller/StartController.php +++ b/src/new/var/plugins/Custom/Krueger/KDVwingame/Controller/StartController.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -17,7 +17,7 @@ use Symfony\Component\Routing\Attribute\Route; class StartController extends AbstractController { #[Route("/start", name: "plugin_custom_kdv_wingame_load")] - #[Template] + #[Template('@PluginCustomKruegerKDVwingameController/start/start.html.twig')] public function startAction(DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManagerService) { $allContakt = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(array('uid' => (string)$security->getUser()->getUid())); diff --git a/src/new/var/plugins/Custom/Krueger/Lieferschein/Controller/StartController.php b/src/new/var/plugins/Custom/Krueger/Lieferschein/Controller/StartController.php index a2cd3ed03..f7627def8 100755 --- a/src/new/var/plugins/Custom/Krueger/Lieferschein/Controller/StartController.php +++ b/src/new/var/plugins/Custom/Krueger/Lieferschein/Controller/StartController.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -17,7 +17,7 @@ use Symfony\Component\Routing\Attribute\Route; class StartController extends AbstractController { #[Route("/start", name: "plugin_custom_krueger_lieferschein_load")] - #[Template] + #[Template('@PluginCustomKruegerLieferscheinController/start/start.html.twig')] public function startAction(DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManagerService) { $allContakt = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(array('uid' => (string)$security->getUser()->getUid())); diff --git a/src/new/var/plugins/Custom/Krueger/Livesearch/Controller/LivesearchController.php b/src/new/var/plugins/Custom/Krueger/Livesearch/Controller/LivesearchController.php index 14312ddd7..2b801fefc 100755 --- a/src/new/var/plugins/Custom/Krueger/Livesearch/Controller/LivesearchController.php +++ b/src/new/var/plugins/Custom/Krueger/Livesearch/Controller/LivesearchController.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -19,7 +19,7 @@ use PSC\Shop\EntityBundle\Entity\Shop; class LivesearchController extends AbstractController { #[Route("/start", name: "plugin_custom_krueger_livesearch_load")] - #[Template] + #[Template('@PluginCustomKruegerLivesearchController/livesearch/start.html.twig')] public function startAction(DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManagerService, \PSC\System\SettingsBundle\Service\Shop $shopService) { /** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */ diff --git a/src/new/var/plugins/Custom/Krueger/Megalithguestuser/Controller/StartController.php b/src/new/var/plugins/Custom/Krueger/Megalithguestuser/Controller/StartController.php index 37e47068f..cfdec1c51 100755 --- a/src/new/var/plugins/Custom/Krueger/Megalithguestuser/Controller/StartController.php +++ b/src/new/var/plugins/Custom/Krueger/Megalithguestuser/Controller/StartController.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Request; class StartController extends AbstractController { #[\Symfony\Component\Routing\Attribute\Route("/start", name: "plugin_custom_krueger_megalithguestnew_load")] - #[Template] + #[Template('@PluginCustomKruegerMegalithguestuserController/start/start.html.twig')] public function startAction(DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security) { $allContakt = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(array('uid' => (string)$security->getUser()->getUid())); diff --git a/src/new/var/plugins/Custom/Krueger/Megalithuser/Controller/StartController.php b/src/new/var/plugins/Custom/Krueger/Megalithuser/Controller/StartController.php index 1f76e4940..93d42fbc9 100755 --- a/src/new/var/plugins/Custom/Krueger/Megalithuser/Controller/StartController.php +++ b/src/new/var/plugins/Custom/Krueger/Megalithuser/Controller/StartController.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -17,7 +17,7 @@ use Symfony\Component\Routing\Attribute\Route; class StartController extends AbstractController { #[Route("/start", name: "plugin_custom_krueger_megalithusernew_load")] - #[Template] + #[Template('@PluginCustomKruegerMegalithuserController/start/start.html.twig')] public function startAction(DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security) { $allContakt = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(array('uid' => (string)$security->getUser()->getUid())); diff --git a/src/new/var/plugins/Custom/Krueger/Userlk/Controller/StartController.php b/src/new/var/plugins/Custom/Krueger/Userlk/Controller/StartController.php index 0a71ee628..cacaec922 100755 --- a/src/new/var/plugins/Custom/Krueger/Userlk/Controller/StartController.php +++ b/src/new/var/plugins/Custom/Krueger/Userlk/Controller/StartController.php @@ -6,7 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -17,7 +17,7 @@ use Symfony\Component\Routing\Attribute\Route; class StartController extends AbstractController { #[Route("/start", name: "plugin_custom_krueger_Userlknew_load")] - #[Template] + #[Template('@PluginCustomKruegerUserlkController/start/start.html.twig')] public function startAction(DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security) { $allContakt = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(array('uid' => (string)$security->getUser()->getUid())); diff --git a/src/new/var/plugins/Custom/MDVI/Useredit/Controller/UsereditController.php b/src/new/var/plugins/Custom/MDVI/Useredit/Controller/UsereditController.php index aa5f03987..59c368d67 100755 --- a/src/new/var/plugins/Custom/MDVI/Useredit/Controller/UsereditController.php +++ b/src/new/var/plugins/Custom/MDVI/Useredit/Controller/UsereditController.php @@ -12,8 +12,8 @@ use PSC\Shop\EntityBundle\Entity\ContactRole; use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\System\SettingsBundle\Service\Shop; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; @@ -28,9 +28,9 @@ class UsereditController extends AbstractController } - #[Template] + #[Template('@PluginCustomMDVIUsereditController/useredit/index.html.twig')] #[Route('/edit/{uid}', name: 'psc_plugin_useredit_load')] - #[Security("is_granted('ROLE_App_Contact_Edit')")] + #[IsGranted('ROLE_App_Contact_Edit')] public function indexAction(Request $request, $uid) { $save = false; @@ -57,9 +57,9 @@ class UsereditController extends AbstractController ); } - #[Template] + #[Template('@PluginCustomMDVIUsereditController/useredit/new.html.twig')] #[Route('/new', name: 'psc_plugin_usernew_load')] - #[Security("is_granted('ROLE_App_Contact_Edit')")] + #[IsGranted('ROLE_App_Contact_Edit')] public function newAction(Request $request, Shop $shopService) { $save = false; @@ -131,9 +131,9 @@ class UsereditController extends AbstractController ); } - #[Template] + #[Template('@PluginCustomMDVIUsereditController/useredit/list.html.twig')] #[Route('/list/{orderBy}/{sort}', name: 'psc_plugin_userlist_load')] - #[Security("is_granted('ROLE_App_Contact_Edit')")] + #[IsGranted('ROLE_App_Contact_Edit')] public function listAction(Request $request, $orderBy = 'uid', $sort = 'asc') { $newarray = $request->request->all(); diff --git a/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/OrdersController.php b/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/OrdersController.php index ddbb05669..929700324 100755 --- a/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/OrdersController.php +++ b/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/OrdersController.php @@ -4,7 +4,7 @@ namespace Plugin\Custom\Maincontor\Reselleradmin\Controller; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use PSC\System\SettingsBundle\Service\Shop; use PSC\System\SettingsBundle\Document\Status; @@ -13,7 +13,7 @@ use Symfony\Component\Routing\Annotation\Route; #[Route('/reselleradmin')] class OrdersController extends AbstractController { - #[Template] + #[Template('@PluginCustomMaincontorReselleradminController/orders/start.html.twig')] #[Route('/orders/{page}', name: 'plugin_custom_maincontor_reselleradmin_orders')] public function startAction(Shop $shop, DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security, $page) { diff --git a/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/StartController.php b/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/StartController.php index d2dffdf3b..9d3bfa94e 100755 --- a/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/StartController.php +++ b/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/StartController.php @@ -4,14 +4,14 @@ namespace Plugin\Custom\Maincontor\Reselleradmin\Controller; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; #[Route('/reselleradmin')] class StartController extends AbstractController { - #[Template] + #[Template('@PluginCustomMaincontorReselleradminController/start/start.html.twig')] #[Route('/start', name: 'plugin_custom_maincontor_reselleradmin_load')] public function startAction(DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security) { diff --git a/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/UsersController.php b/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/UsersController.php index 818565b5e..2535f93e7 100755 --- a/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/UsersController.php +++ b/src/new/var/plugins/Custom/Maincontor/Reselleradmin/Controller/UsersController.php @@ -4,7 +4,7 @@ namespace Plugin\Custom\Maincontor\Reselleradmin\Controller; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Component\Routing\Annotation\Route; @@ -13,7 +13,7 @@ use Symfony\Component\Routing\Annotation\Route; class UsersController extends AbstractController { - #[Template] + #[Template('@PluginCustomMaincontorReselleradminController/users/start.html.twig')] #[Route('/users/{page}', name: 'plugin_custom_maincontor_reselleradmin_users')] public function startAction(Shop $shop, DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security, $page) { diff --git a/src/new/var/plugins/Custom/Mundfein/Contact/Controller/Backend/StartController.php b/src/new/var/plugins/Custom/Mundfein/Contact/Controller/Backend/StartController.php index ce40d3f76..962f6be0c 100755 --- a/src/new/var/plugins/Custom/Mundfein/Contact/Controller/Backend/StartController.php +++ b/src/new/var/plugins/Custom/Mundfein/Contact/Controller/Backend/StartController.php @@ -13,7 +13,7 @@ use PSC\Shop\EntityBundle\Entity\ContactAddress; use PSC\Shop\EntityBundle\Repository\ContactAddressRepository; use PSC\System\PluginBundle\Form\Chain\Field; use Role; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/var/plugins/Custom/NoweDruck/TpApi/Controller/TemplateprintController.php b/src/new/var/plugins/Custom/NoweDruck/TpApi/Controller/TemplateprintController.php index 8ca5c9f0a..9ec282488 100755 --- a/src/new/var/plugins/Custom/NoweDruck/TpApi/Controller/TemplateprintController.php +++ b/src/new/var/plugins/Custom/NoweDruck/TpApi/Controller/TemplateprintController.php @@ -7,7 +7,7 @@ use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\OrderBundle\Service\Order; use PSC\Shop\QueueBundle\Service\Event\Manager; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use SimpleXMLElement; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpClient\HttpClient; diff --git a/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Backend/IndexController.php b/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Backend/IndexController.php index b70713d96..26d8a493c 100755 --- a/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Backend/IndexController.php +++ b/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Backend/IndexController.php @@ -8,8 +8,8 @@ use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; use Plugin\Custom\PSC\CollectLayouter\Form\ContactSelectType; use Plugin\Custom\PSC\CollectLayouter\Model\Setting; use PSC\Shop\EntityBundle\Entity\Product; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; @@ -25,7 +25,7 @@ class IndexController extends AbstractController ) {} #[Template] - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] #[Route( '/edit/{uuid}', defaults: ['uuid' => '', 'test' => false], diff --git a/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Frontend/DesignerController.php b/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Frontend/DesignerController.php index 4372bb92c..19efa1148 100755 --- a/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Frontend/DesignerController.php +++ b/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Frontend/DesignerController.php @@ -17,7 +17,7 @@ use PSC\Shop\ContactBundle\Transformer\Model\Contact; use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\MediaBundle\Service\MediaManager; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Routing\Annotation\Route; diff --git a/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Frontend/UserController.php b/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Frontend/UserController.php index 78456e550..7fedd9824 100755 --- a/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Frontend/UserController.php +++ b/src/new/var/plugins/Custom/PSC/CollectLayouter/Controller/Frontend/UserController.php @@ -17,8 +17,8 @@ use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\System\SettingsBundle\Service\Shop; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; @@ -33,9 +33,9 @@ class UserController extends AbstractController } - #[Template] + #[Template('@PluginCustomPSCCollectLayouterControllerFrontend/user/edit.html.twig')] #[Route('/edit/{productUuid}/{contactUuid}', name: 'plugin_custom_psc_collectlayouter_user_edit')] - #[Security("is_granted('ROLE_PSC_Collect_Contact_Edit')")] + #[IsGranted('ROLE_PSC_Collect_Contact_Edit')] public function edit(Request $request, string $contactUuid, string $productUuid = ''): array { $save = false; @@ -246,9 +246,9 @@ class UserController extends AbstractController ); } - #[Template] + #[Template('@PluginCustomPSCCollectLayouterControllerFrontend/user/new.html.twig')] #[Route('/new/{productUuid}', name: 'plugin_custom_psc_collectlayouter_user_new')] - #[Security("is_granted('ROLE_PSC_Collect_Contact_Add')")] + #[IsGranted('ROLE_PSC_Collect_Contact_Add')] public function new(Request $request, Shop $shopService, string $productUuid = '') { $save = false; @@ -401,7 +401,7 @@ class UserController extends AbstractController ); } - #[Template] + #[Template('@PluginCustomPSCCollectLayouterControllerFrontend/user/list.html.twig')] #[Route('/list/{productUuid}/{orderBy}/{sort}', name: 'plugin_custom_psc_collectlayouter_user_list')] public function list(Request $request, string $productUuid = 'none', $orderBy = 'uid', $sort = 'asc'): array { diff --git a/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/GroupController.php b/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/GroupController.php index a9b5c4c11..3e64869a5 100644 --- a/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/GroupController.php +++ b/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/GroupController.php @@ -11,8 +11,8 @@ use PSC\Shop\MotivBundle\Form\Backend\MotivGroupType; use PSC\Shop\MotivBundle\Form\Backend\MotivType; use PSC\Shop\MotivBundle\Form\Backend\SearchType; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -28,8 +28,8 @@ use Symfony\Component\Routing\Annotation\Route; */ class GroupController extends AbstractController { - #[Security("is_granted('ROLE_ADMIN')")] - #[Template] + #[IsGranted('ROLE_ADMIN')] + #[Template('@PluginCustomPSCCreativeLayouterControllerBackend/group/index.html.twig')] #[Route('/group/list/index', name: 'psc_shop_motive_backend_group_list_index')] public function indexAction(Shop $shopService, DocumentManager $documentManager) { @@ -44,8 +44,8 @@ class GroupController extends AbstractController ]; } - #[Security("is_granted('ROLE_ADMIN')")] - #[Template] + #[IsGranted('ROLE_ADMIN')] + #[Template('@PluginCustomPSCCreativeLayouterControllerBackend/group/create.html.twig')] #[Route('/group/create', name: 'psc_shop_motive_backend_group_create')] public function createAction( Request $request, @@ -75,8 +75,8 @@ class GroupController extends AbstractController ]; } - #[Security("is_granted('ROLE_ADMIN')")] - #[Template] + #[IsGranted('ROLE_ADMIN')] + #[Template('@PluginCustomPSCCreativeLayouterControllerBackend/group/edit.html.twig')] #[Route('/group/edit/{uuid}', name: 'psc_shop_motive_backend_group_edit')] public function editAction(Request $request, SessionInterface $session, DocumentManager $documentManager, $uuid) { @@ -101,8 +101,8 @@ class GroupController extends AbstractController ]; } - #[Security("is_granted('ROLE_ADMIN')")] - #[Template] + #[IsGranted('ROLE_ADMIN')] + #[Template('@PluginCustomPSCCreativeLayouterControllerBackend/group/delete.html.twig')] #[Route('/group/delete/{uuid}', name: 'psc_shop_motive_backend_group_delete')] public function deleteAction(Request $request, SessionInterface $session, DocumentManager $documentManager, $uuid) { diff --git a/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/ListController.php b/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/ListController.php index ce6537a1a..e2d4f4c01 100644 --- a/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/ListController.php +++ b/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/ListController.php @@ -13,8 +13,8 @@ use PSC\Shop\MotivBundle\Form\Backend\MotivType; use PSC\Shop\MotivBundle\Form\Backend\SearchType; use PSC\Shop\MotivBundle\Form\Backend\SwapType; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -42,9 +42,9 @@ class ListController extends AbstractController * @return array * @throws \Doctrine\ORM\ORMException */ - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] #[Route(path: '/list/index', name: 'psc_shop_motive_backend_list_index')] - #[Template] + #[Template('@PluginCustomPSCCreativeLayouterControllerBackend/list/index.html.twig')] public function indexAction( Request $request, Shop $shopService, @@ -87,7 +87,7 @@ class ListController extends AbstractController * @throws \ImagickException */ #[Route(path: '/list/swap/{uuid}', name: 'psc_shop_motive_backend_list_swap')] - #[Template] + #[Template('@PluginCustomPSCCreativeLayouterControllerBackend/list/swap.html.twig')] public function swapAction( Request $request, Shop $shopService, @@ -211,7 +211,7 @@ class ListController extends AbstractController * @return View */ #[Route(path: '/list/upload', name: 'psc_shop_motive_backend_list_upload')] - #[Template] + #[Template('@PluginCustomPSCCreativeLayouterControllerBackend/list/upload.html.twig')] public function uploadAction() { return []; diff --git a/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/XmlController.php b/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/XmlController.php index ba9fe4f9a..1b360d692 100644 --- a/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/XmlController.php +++ b/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Backend/XmlController.php @@ -9,8 +9,8 @@ use PSC\Shop\EntityBundle\Document\Shop; use PSC\Shop\EntityBundle\Entity\Account; use PSC\Shop\EntityBundle\Entity\Product; use PSC\Shop\EntityBundle\Entity\Stockbooking; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; diff --git a/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Json/MotivController.php b/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Json/MotivController.php index 2fb22cefd..998658c5f 100644 --- a/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Json/MotivController.php +++ b/src/new/var/plugins/Custom/PSC/CreativeLayouter/Controller/Json/MotivController.php @@ -13,7 +13,7 @@ use Liip\ImagineBundle\Controller\ImagineController; use PSC\Shop\EntityBundle\Document\Motiv as DocumentMotiv; use PSC\Shop\EntityBundle\Entity\Motiv; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/src/new/var/plugins/Custom/PSC/Fastbill/Controller/FastbillController.php b/src/new/var/plugins/Custom/PSC/Fastbill/Controller/FastbillController.php index 132e25094..fc13b012e 100755 --- a/src/new/var/plugins/Custom/PSC/Fastbill/Controller/FastbillController.php +++ b/src/new/var/plugins/Custom/PSC/Fastbill/Controller/FastbillController.php @@ -4,7 +4,7 @@ namespace Plugin\Custom\PSC\Fastbill\Controller; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\SecurityContext; @@ -13,7 +13,7 @@ use Symfony\Component\Security\Core\SecurityContext; class FastbillController extends AbstractController { - #[Template] + #[Template('@PluginCustomPSCFastbillController/fastbill/start.html.twig')] #[Route('/start', name: 'plugin_custom_psc_fastbill_load')] public function startAction(DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManagerService, \PSC\System\SettingsBundle\Service\Shop $shopService) { diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/Controller/Backend/ProductController.php b/src/new/var/plugins/Custom/PSC/FormBuilder/Controller/Backend/ProductController.php index da3688c8f..f3fec71dc 100644 --- a/src/new/var/plugins/Custom/PSC/FormBuilder/Controller/Backend/ProductController.php +++ b/src/new/var/plugins/Custom/PSC/FormBuilder/Controller/Backend/ProductController.php @@ -5,16 +5,16 @@ namespace Plugin\Custom\PSC\FormBuilder\Controller\Backend; use Gesdinet\JWTRefreshTokenBundle\Generator\RefreshTokenGeneratorInterface; use Gesdinet\JWTRefreshTokenBundle\Model\RefreshTokenManagerInterface; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; #[Route('/product')] class ProductController extends AbstractController { - #[Template] - #[Security("is_granted('ROLE_USER')")] + #[Template('@PluginCustomPSCFormBuilderControllerBackend/product/edit.html.twig')] + #[IsGranted('ROLE_USER')] #[Route(path: '/edit', name: 'psc_plugin_formbuilder_edit')] public function edit( JWTTokenManagerInterface $jwtManager, diff --git a/src/new/var/plugins/Custom/PSC/FormLayouter/Controller/Backend/XmlController.php b/src/new/var/plugins/Custom/PSC/FormLayouter/Controller/Backend/XmlController.php index 50c72e784..d30f1dffc 100644 --- a/src/new/var/plugins/Custom/PSC/FormLayouter/Controller/Backend/XmlController.php +++ b/src/new/var/plugins/Custom/PSC/FormLayouter/Controller/Backend/XmlController.php @@ -24,8 +24,8 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Routing\Annotation\Route; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; class XmlController extends AbstractController diff --git a/src/new/var/plugins/Custom/PSC/Formular/Controller/Backend/SettingsController.php b/src/new/var/plugins/Custom/PSC/Formular/Controller/Backend/SettingsController.php index 89ca56152..ce7999f2c 100755 --- a/src/new/var/plugins/Custom/PSC/Formular/Controller/Backend/SettingsController.php +++ b/src/new/var/plugins/Custom/PSC/Formular/Controller/Backend/SettingsController.php @@ -7,7 +7,7 @@ use Plugin\Custom\PSC\Formular\Document\Formular; use Plugin\Custom\PSC\Formular\Form\Backend\Formular as WebForm; use PSC\Shop\EntityBundle\Entity\Domain; use PSC\System\PluginBundle\Form\Chain\Field; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use PSC\Shop\ShippingBundle\Form\Backend\DeleteType; diff --git a/src/new/var/plugins/Custom/PSC/Formular/Controller/StartController.php b/src/new/var/plugins/Custom/PSC/Formular/Controller/StartController.php index f89deb877..c877c5578 100755 --- a/src/new/var/plugins/Custom/PSC/Formular/Controller/StartController.php +++ b/src/new/var/plugins/Custom/PSC/Formular/Controller/StartController.php @@ -8,7 +8,7 @@ use Gregwar\Captcha\CaptchaBuilder; use Plugin\Custom\PSC\Formular\Document\Formular; use Plugin\Custom\PSC\Formular\Event\Submit; use PSC\Shop\QueueBundle\Service\Event\Manager; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use PSC\System\SettingsBundle\Service\Shop; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/var/plugins/Custom/PSC/HPLayouter/Queue/Render.php b/src/new/var/plugins/Custom/PSC/HPLayouter/Queue/Render.php index 32c1d0ea3..2bbb40ebe 100644 --- a/src/new/var/plugins/Custom/PSC/HPLayouter/Queue/Render.php +++ b/src/new/var/plugins/Custom/PSC/HPLayouter/Queue/Render.php @@ -110,7 +110,7 @@ class Render implements QueueInterface, ConfigurableElementInterface if ($position->getLayouterMode() == 8) { /** @var Position $objDoc */ $objDoc = $this->_doctrine_mongodb - ->getRepository('PSCEntityBundle:Position') + ->getRepository('PSC\Shop\EntityBundle\Entity\Position') ->findOneByUid((string) $position->getId()); $body = json_encode([ @@ -146,4 +146,3 @@ class Render implements QueueInterface, ConfigurableElementInterface return $this->_error; } } - diff --git a/src/new/var/plugins/Custom/PSC/Numberformater/Controller/StartController.php b/src/new/var/plugins/Custom/PSC/Numberformater/Controller/StartController.php index 1c1c0e256..63bb92dc9 100755 --- a/src/new/var/plugins/Custom/PSC/Numberformater/Controller/StartController.php +++ b/src/new/var/plugins/Custom/PSC/Numberformater/Controller/StartController.php @@ -6,11 +6,11 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; @@ -18,7 +18,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt #[Route("/numberformater")] class StartController extends AbstractController { - #[Template] + #[Template('@PluginCustomPSCNumberformaterController/start/start.html.twig')] #[Route("/start", name: "plugin_custom_psc_numberformater_load")] public function startAction(DocumentManager $documentManager, EntityManagerInterface $entityManager, TokenStorageInterface $securityContext) { diff --git a/src/new/var/plugins/Custom/PSC/Pitchprint/Controller/Backend/DesignController.php b/src/new/var/plugins/Custom/PSC/Pitchprint/Controller/Backend/DesignController.php index f78a73dfd..cd52fb9c0 100755 --- a/src/new/var/plugins/Custom/PSC/Pitchprint/Controller/Backend/DesignController.php +++ b/src/new/var/plugins/Custom/PSC/Pitchprint/Controller/Backend/DesignController.php @@ -15,7 +15,7 @@ use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use PSC\Shop\EntityBundle\Entity\Product; use Plugin\Custom\PSC\Pitchprint\Api\Design; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; diff --git a/src/new/var/plugins/Custom/PSC/Pitchprint/Controller/Frontend/DesignerController.php b/src/new/var/plugins/Custom/PSC/Pitchprint/Controller/Frontend/DesignerController.php index 0c07fb770..55e946594 100755 --- a/src/new/var/plugins/Custom/PSC/Pitchprint/Controller/Frontend/DesignerController.php +++ b/src/new/var/plugins/Custom/PSC/Pitchprint/Controller/Frontend/DesignerController.php @@ -4,7 +4,7 @@ namespace Plugin\Custom\PSC\Pitchprint\Controller\Frontend; use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use PSC\Shop\EntityBundle\Entity\Layoutdesigndata; diff --git a/src/new/var/plugins/Custom/PSC/Preflightcheck/Controller/Backend/EditController.php b/src/new/var/plugins/Custom/PSC/Preflightcheck/Controller/Backend/EditController.php index 9382e62b4..95b89ab3c 100644 --- a/src/new/var/plugins/Custom/PSC/Preflightcheck/Controller/Backend/EditController.php +++ b/src/new/var/plugins/Custom/PSC/Preflightcheck/Controller/Backend/EditController.php @@ -10,7 +10,7 @@ use Plugin\Custom\PSC\Preflightcheck\Form\Backend\PreflightCheckType; use PSC\Libraries\AutoRegistryBundle\Service\ConfigurableElementInterface; use PSC\Shop\EntityBundle\Entity\Shop; use PSC\Shop\NewsBundle\Form\Backend\DeleteType; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\SessionInterface; @@ -20,7 +20,7 @@ use Symfony\Component\Routing\Annotation\Route; class EditController extends AbstractController { #[Route('/create', name: 'psc_plugin_system_preflightcheck_backend_create')] - #[Template] + #[Template('@PluginCustomPSCPreflightcheckControllerBackend/edit/create.html.twig')] public function createAction(Request $request, SessionInterface $session, EntityManagerInterface $entityManager) { $preflightCheck = new Preflightcheck(); @@ -45,7 +45,7 @@ class EditController extends AbstractController } #[Route('/create/{uid}', name: 'psc_plugin_system_preflightcheck_backend_edit')] - #[Template] + #[Template('@PluginCustomPSCPreflightcheckControllerBackend/edit/edit.html.twig')] public function editAction(Request $request, SessionInterface $session, EntityManagerInterface $entityManager, $uid) { /** @var Preflightcheck $preflightCheck */ @@ -74,7 +74,7 @@ class EditController extends AbstractController } #[Route(path: '/delete/{uid}', name: 'psc_plugin_system_preflightcheck_backend_delete')] - #[Template] + #[Template('@PluginCustomPSCPreflightcheckControllerBackend/edit/delete.html.twig')] public function deleteAction( Request $request, SessionInterface $session, diff --git a/src/new/var/plugins/Custom/PSC/Preflightcheck/Controller/Backend/ListController.php b/src/new/var/plugins/Custom/PSC/Preflightcheck/Controller/Backend/ListController.php index 9c91551f3..310af264c 100644 --- a/src/new/var/plugins/Custom/PSC/Preflightcheck/Controller/Backend/ListController.php +++ b/src/new/var/plugins/Custom/PSC/Preflightcheck/Controller/Backend/ListController.php @@ -4,8 +4,8 @@ namespace Plugin\Custom\PSC\Preflightcheck\Controller\Backend; use Doctrine\ORM\EntityManagerInterface; use Knp\Component\Pager\PaginatorInterface; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; @@ -15,7 +15,7 @@ class ListController extends AbstractController { #[Route('/list', name: 'psc_plugin_system_preflightcheck_backend_list')] #[IsGranted('ROLE_ADMIN')] - #[Template] + #[Template('@PluginCustomPSCPreflightcheckControllerBackend/list/index.html.twig')] public function indexAction(Request $request, PaginatorInterface $paginator, EntityManagerInterface $entityManager) { $userRepository = $entityManager->getRepository('Plugin\Custom\PSC\Preflightcheck\Entity\Preflightcheck'); diff --git a/src/new/var/plugins/Custom/PSC/Printess/Controller/Frontend/DesignerController.php b/src/new/var/plugins/Custom/PSC/Printess/Controller/Frontend/DesignerController.php index a3fb121da..ddff28137 100755 --- a/src/new/var/plugins/Custom/PSC/Printess/Controller/Frontend/DesignerController.php +++ b/src/new/var/plugins/Custom/PSC/Printess/Controller/Frontend/DesignerController.php @@ -6,7 +6,7 @@ use Doctrine\ORM\EntityManagerInterface; use Plugin\Custom\PSC\Printess\Transformer\ContactArray; use PSC\Shop\ContactBundle\Model\Contact; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use PSC\Shop\EntityBundle\Entity\Layoutdesigndata; diff --git a/src/new/var/plugins/Custom/PSC/R2_Pitchprint/Controller/Backend/DesignController.php b/src/new/var/plugins/Custom/PSC/R2_Pitchprint/Controller/Backend/DesignController.php index ab3152fa4..2eda30e34 100755 --- a/src/new/var/plugins/Custom/PSC/R2_Pitchprint/Controller/Backend/DesignController.php +++ b/src/new/var/plugins/Custom/PSC/R2_Pitchprint/Controller/Backend/DesignController.php @@ -17,7 +17,7 @@ use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Plugin\Custom\PSC\R2_Pitchprint\Api\Design; use PSC\Shop\EntityBundle\Entity\Product; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; @@ -28,7 +28,7 @@ class DesignController extends AbstractController private Design $designService, ) {} - #[Template] + #[Template('@PluginCustomPSCR2_PitchprintControllerBackend/design/edit.html.twig')] #[Route('/design/edit/{uuid}/{folder}', name: 'psc_plugin_pitchprint_r2_backend_design_edit')] public function editAction( Request $request, diff --git a/src/new/var/plugins/Custom/PSC/R2_Pitchprint/Controller/Frontend/DesignerController.php b/src/new/var/plugins/Custom/PSC/R2_Pitchprint/Controller/Frontend/DesignerController.php index 7363c10ac..81d1c2afb 100755 --- a/src/new/var/plugins/Custom/PSC/R2_Pitchprint/Controller/Frontend/DesignerController.php +++ b/src/new/var/plugins/Custom/PSC/R2_Pitchprint/Controller/Frontend/DesignerController.php @@ -11,7 +11,7 @@ use Plugin\Custom\PSC\CollectLayouter\Model\ElementBinding; use Plugin\Custom\PSC\CollectLayouter\Model\Setting; use PSC\Shop\EntityBundle\Entity\Product; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use PSC\Shop\EntityBundle\Entity\Layoutdesigndata; diff --git a/src/new/var/plugins/Custom/PSC/R2_Sendcloud/Controller/Backend/OrderController.php b/src/new/var/plugins/Custom/PSC/R2_Sendcloud/Controller/Backend/OrderController.php index f2d3d1477..6a27654c0 100755 --- a/src/new/var/plugins/Custom/PSC/R2_Sendcloud/Controller/Backend/OrderController.php +++ b/src/new/var/plugins/Custom/PSC/R2_Sendcloud/Controller/Backend/OrderController.php @@ -12,7 +12,7 @@ use Plugin\Custom\PSC\R2_Sendcloud\Model\Parcels; use PSC\Shop\EntityBundle\Document\Shop; use PSC\Shop\OrderBundle\Service\Order; use PSC\System\SettingsBundle\Service\Status; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -23,7 +23,7 @@ use Symfony\Component\Serializer\SerializerInterface; class OrderController extends AbstractController { - #[Template] + #[Template('@PluginCustomPSCR2_SendcloudControllerBackend/order/index.html.twig')] #[Route('/list', name: 'psc_shop_r2_sendcloud_backend_list_index')] public function indexAction(\PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, @@ -81,7 +81,7 @@ class OrderController extends AbstractController ); } - #[Template] + #[Template('@PluginCustomPSCR2_SendcloudControllerBackend/order/send.html.twig')] #[Route('/send/{uuid}', name: 'psc_shop_r2_sendcloud_backend_send')] public function sendAction(\PSC\System\SettingsBundle\Service\Shop $shopService, Order $orderService, Request $request, SerializerInterface $serializer, string $uuid): array|RedirectResponse { diff --git a/src/new/var/plugins/Custom/PSC/R2_Sendcloud/Controller/Backend/SendController.php b/src/new/var/plugins/Custom/PSC/R2_Sendcloud/Controller/Backend/SendController.php index be3e8c30e..c274b0f7c 100755 --- a/src/new/var/plugins/Custom/PSC/R2_Sendcloud/Controller/Backend/SendController.php +++ b/src/new/var/plugins/Custom/PSC/R2_Sendcloud/Controller/Backend/SendController.php @@ -15,7 +15,7 @@ use Plugin\Custom\PSC\R2_Sendcloud\Model\Parcels; use PSC\Shop\EntityBundle\Document\Shop; use PSC\Shop\OrderBundle\Service\Order; use PSC\System\SettingsBundle\Service\Status; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -27,7 +27,7 @@ use Symfony\Component\Serializer\SerializerInterface; class SendController extends AbstractController { - #[Template] + #[Template('@PluginCustomPSCR2_SendcloudControllerBackend/send/sendshipping.html.twig')] #[Route('/sendshipping/{uuid}', name: 'psc_shop_r2_sendcloud_backend_sendshipping')] public function sendshipping(\PSC\System\SettingsBundle\Service\Shop $shopService, Order $orderService, Request $request, SerializerInterface $serializer, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManagerService, string $uuid): array { diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/ApiController/ConfigController.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/ApiController/ConfigController.php index 5b83ca6f0..f6ae9392d 100755 --- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/ApiController/ConfigController.php +++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/ApiController/ConfigController.php @@ -10,7 +10,7 @@ use Plugin\Custom\PSC\Saxoprint_API_R1\Dto\Input; use Plugin\Custom\PSC\Saxoprint_API_R1\Dto\Output; use PSC\Shop\EntityBundle\Document\Product; use PSC\Shop\EntityBundle\Repository\ProductRepository; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/BackendController/CollectController.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/BackendController/CollectController.php index 5d4d44a75..a22cf3188 100755 --- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/BackendController/CollectController.php +++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/BackendController/CollectController.php @@ -8,8 +8,8 @@ use PSC\Shop\EntityBundle\Repository\ProductRepository; use PSC\Shop\OrderBundle\Service\Order; use PSC\System\SettingsBundle\Service\Shop; use PSC\System\SettingsBundle\Service\Status; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/BackendController/ConfigController.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/BackendController/ConfigController.php index a5e1718ea..01dd19d02 100755 --- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/BackendController/ConfigController.php +++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/BackendController/ConfigController.php @@ -10,8 +10,8 @@ use PSC\Shop\EntityBundle\Entity\Domain; use PSC\Shop\EntityBundle\Repository\ProductRepository; use PSC\System\SettingsBundle\Service\Shop; use PSC\System\SettingsBundle\Service\Tax; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/OrderController.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/OrderController.php index b4b0e6832..1e252e1a5 100755 --- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/OrderController.php +++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/OrderController.php @@ -7,7 +7,7 @@ use PSC\Shop\OrderBundle\Model\Order\Position; use Plugin\Custom\PSC\Saxoprint_API_R1\Api\GetState; use PSC\Shop\EntityBundle\Document\Order; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class OrderController extends AbstractController diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/SaxoprintController.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/SaxoprintController.php index a0f6538b6..12ce8c165 100755 --- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/SaxoprintController.php +++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Controller/SaxoprintController.php @@ -11,7 +11,7 @@ use Plugin\Custom\PSC\Saxoprint_API_R1\Api\PutConfig; use PSC\Shop\EntityBundle\Entity\Product; use PSC\System\SettingsBundle\Service\Help; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Backend/SettingsController.php b/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Backend/SettingsController.php index 22946c332..1380ab1fa 100755 --- a/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Backend/SettingsController.php +++ b/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Backend/SettingsController.php @@ -6,7 +6,7 @@ use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ORM\EntityManagerInterface; use Plugin\Custom\PSC\Sendcloud\Form\Field\FormularShopsettings; use PSC\System\PluginBundle\Form\Chain\Field; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; diff --git a/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Checkorder/SettingsController.php b/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Checkorder/SettingsController.php index dc4266915..69ca24609 100755 --- a/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Checkorder/SettingsController.php +++ b/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Checkorder/SettingsController.php @@ -4,7 +4,7 @@ namespace Plugin\Custom\PSC\Sendcloud\Controller\Checkorder; use Doctrine\ORM\EntityManagerInterface; use Plugin\Custom\PSC\Sendcloud\Document\Formular; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use PSC\System\SettingsBundle\Service\Shop; diff --git a/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Checkversand/SettingsController.php b/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Checkversand/SettingsController.php index 7e80f22bf..a82e3632c 100755 --- a/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Checkversand/SettingsController.php +++ b/src/new/var/plugins/Custom/PSC/Sendcloud/Controller/Checkversand/SettingsController.php @@ -1,7 +1,7 @@ getSelectedShop(); @@ -101,7 +101,7 @@ class ListController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/list/delete/{uid}', name: 'psc_shop_upload_backend_list_delete')] - #[Template] + #[Template('@PluginCustomPSCUploadControllerBackend/list/delete.html.twig')] public function deleteAction(Request $request, DocumentManager $documentManager, $uid) { /** @var Upload $upload */ diff --git a/src/new/var/plugins/Custom/PSC/Upload/Controller/Frontend/CreateController.php b/src/new/var/plugins/Custom/PSC/Upload/Controller/Frontend/CreateController.php index b645cca78..133e2024f 100644 --- a/src/new/var/plugins/Custom/PSC/Upload/Controller/Frontend/CreateController.php +++ b/src/new/var/plugins/Custom/PSC/Upload/Controller/Frontend/CreateController.php @@ -20,8 +20,8 @@ use Plugin\Custom\PSC\Upload\Helper\UploaderHelper; use PSC\Shop\QueueBundle\Event\Package\Created; use PSC\Shop\QueueBundle\Service\Event\Manager; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; @@ -53,7 +53,7 @@ class CreateController extends AbstractController * @throws \Doctrine\ODM\MongoDB\MongoDBException */ #[Route(path: '/create', name: 'psc_shop_upload_frontend_create')] - #[Template] + #[Template('@PluginCustomPSCUploadControllerFrontend/create/create.html.twig')] public function createAction( Request $request, Shop $shopService, diff --git a/src/new/var/plugins/Custom/PSC/WMD_API/Controller/OrderController.php b/src/new/var/plugins/Custom/PSC/WMD_API/Controller/OrderController.php index 5edb44504..abea0cecb 100755 --- a/src/new/var/plugins/Custom/PSC/WMD_API/Controller/OrderController.php +++ b/src/new/var/plugins/Custom/PSC/WMD_API/Controller/OrderController.php @@ -5,7 +5,7 @@ namespace Plugin\Custom\PSC\WMD_API\Controller; use PSC\Shop\EntityBundle\Document\Order; use PSC\System\SettingsBundle\Service\Shop; use Plugin\Custom\PSC\WMD_API\Api\GetState; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class OrderController extends AbstractController diff --git a/src/new/var/plugins/Custom/PSC/Zaikio/Controller/Backend/ConfigController.php b/src/new/var/plugins/Custom/PSC/Zaikio/Controller/Backend/ConfigController.php index 299aa347a..96dbf7b92 100755 --- a/src/new/var/plugins/Custom/PSC/Zaikio/Controller/Backend/ConfigController.php +++ b/src/new/var/plugins/Custom/PSC/Zaikio/Controller/Backend/ConfigController.php @@ -10,7 +10,7 @@ use Plugin\Custom\PSC\Zaikio\Model\Finishing; use Plugin\Custom\PSC\Zaikio\Model\Part; use PSC\Shop\EntityBundle\Entity\Product; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; @@ -20,7 +20,7 @@ class ConfigController extends AbstractController { #[Route('/start/{uuid}', name: 'plugin_custom_psc_zaikio_config_start')] - #[Template] + #[Template('@PluginCustomPSCZaikioControllerBackend/config/start.html.twig')] public function start(Request $request, Shop $shopService, EntityManagerInterface $entityManager, DocumentManager $documentManager, string $uuid): array { diff --git a/src/new/var/plugins/Custom/PSC/Zaikio/Controller/OrderController.php b/src/new/var/plugins/Custom/PSC/Zaikio/Controller/OrderController.php index 20446d21b..95c9bf12b 100755 --- a/src/new/var/plugins/Custom/PSC/Zaikio/Controller/OrderController.php +++ b/src/new/var/plugins/Custom/PSC/Zaikio/Controller/OrderController.php @@ -4,7 +4,7 @@ namespace Plugin\Custom\PSC\Zaikio\Controller; use PSC\Shop\EntityBundle\Document\Order; use PSC\System\SettingsBundle\Service\Shop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; use Symfony\Component\HttpClient\Exception\ClientException; diff --git a/src/new/var/plugins/Custom/Sumitomo/Contact/Controller/Backend/StartController.php b/src/new/var/plugins/Custom/Sumitomo/Contact/Controller/Backend/StartController.php index 7a5d3650f..b89810f8f 100755 --- a/src/new/var/plugins/Custom/Sumitomo/Contact/Controller/Backend/StartController.php +++ b/src/new/var/plugins/Custom/Sumitomo/Contact/Controller/Backend/StartController.php @@ -13,7 +13,7 @@ use PSC\Shop\EntityBundle\Entity\ContactAddress; use PSC\Shop\EntityBundle\Repository\ContactAddressRepository; use PSC\System\PluginBundle\Form\Chain\Field; use Role; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/var/plugins/Custom/VonBusch/Contact/Controller/Backend/StartController.php b/src/new/var/plugins/Custom/VonBusch/Contact/Controller/Backend/StartController.php index a159a46ea..cdf3ad161 100755 --- a/src/new/var/plugins/Custom/VonBusch/Contact/Controller/Backend/StartController.php +++ b/src/new/var/plugins/Custom/VonBusch/Contact/Controller/Backend/StartController.php @@ -13,7 +13,7 @@ use PSC\Shop\EntityBundle\Entity\ContactAddress; use PSC\Shop\EntityBundle\Repository\ContactAddressRepository; use PSC\System\PluginBundle\Form\Chain\Field; use Role; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; diff --git a/src/new/var/plugins/Custom/Weber/Orderimport/Controller/TemplateprintController.php b/src/new/var/plugins/Custom/Weber/Orderimport/Controller/TemplateprintController.php index 5d13dd5bd..eb5095794 100755 --- a/src/new/var/plugins/Custom/Weber/Orderimport/Controller/TemplateprintController.php +++ b/src/new/var/plugins/Custom/Weber/Orderimport/Controller/TemplateprintController.php @@ -8,7 +8,7 @@ use PSC\Shop\OrderBundle\Model\Order\Position; use PSC\Shop\OrderBundle\Service\Order; use PSC\Shop\QueueBundle\Event\Position\Status\Change; use PSC\Shop\QueueBundle\Service\Event\Manager; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\BinaryFileResponse; use Symfony\Component\HttpFoundation\File\UploadedFile; @@ -21,7 +21,7 @@ class TemplateprintController extends AbstractController { protected static $key = "p489r7nwpefsnfp0"; - #[Template] + #[Template('@PluginCustomWeberOrderimportController/templateprint/index.html.twig')] #[Route('/start/{positionUuid}', name: 'psc_plugin_custom_Weber_tp_start')] public function indexAction(Request $request, Order $orderService, $positionUuid) { @@ -61,7 +61,7 @@ class TemplateprintController extends AbstractController } #[Route('/redirect', name: 'psc_plugin_custom_huelswitt_tp_redirect')] - #[Template] + #[Template('@PluginCustomWeberOrderimportController/templateprint/redirect.html.twig')] public function redirectAction(Request $request) { return []; diff --git a/src/new/var/plugins/System/PSC/Bootstrap3/Controller/Backend/SliderController.php b/src/new/var/plugins/System/PSC/Bootstrap3/Controller/Backend/SliderController.php index 137a6bfcd..3c1475d8b 100755 --- a/src/new/var/plugins/System/PSC/Bootstrap3/Controller/Backend/SliderController.php +++ b/src/new/var/plugins/System/PSC/Bootstrap3/Controller/Backend/SliderController.php @@ -17,7 +17,7 @@ use PSC\Shop\EntityBundle\Entity\Upload; use Plugin\System\PSC\Production\Form\Backend\UploadType; use PSC\Shop\QueueBundle\Event\Position\Status\Change; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Component\Routing\Annotation\Route; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; @@ -32,7 +32,7 @@ class SliderController extends AbstractController { #[Route('/', name: 'psc_plugin_bootstrap3_backend_slider_index')] - #[Template] + #[Template('@PluginSystemPSCBootstrap3ControllerBackend/slider/index.html.twig')] public function indexAction(\PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager) { $selectedShop = $shopService->getSelectedShop(); @@ -96,7 +96,7 @@ class SliderController extends AbstractController return ['form' => $form->createView(), "slide" => $data]; } - #[Template] + #[Template('@PluginSystemPSCBootstrap3ControllerBackend/slider/delete.html.twig')] #[Route(path: '/delete/{uid}', name: 'psc_plugin_bootstrap3_backend_slider_delete')] public function deleteAction(Request $request, SessionInterface $session, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, $uid) { diff --git a/src/new/var/plugins/System/PSC/Bootstrap4/Controller/Backend/SliderController.php b/src/new/var/plugins/System/PSC/Bootstrap4/Controller/Backend/SliderController.php index adf36829e..7c8778cac 100755 --- a/src/new/var/plugins/System/PSC/Bootstrap4/Controller/Backend/SliderController.php +++ b/src/new/var/plugins/System/PSC/Bootstrap4/Controller/Backend/SliderController.php @@ -17,7 +17,7 @@ use PSC\Shop\EntityBundle\Entity\Upload; use Plugin\System\PSC\Production\Form\Backend\UploadType; use PSC\Shop\QueueBundle\Event\Position\Status\Change; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\JsonResponse; @@ -31,7 +31,7 @@ use Symfony\Component\Routing\Annotation\Route; class SliderController extends AbstractController { #[Route('/', name: 'psc_plugin_bootstrap4_backend_slider_index')] - #[Template] + #[Template('@PluginSystemPSCBootstrap4ControllerBackend/slider/index.html.twig')] public function indexAction(\PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager) { $selectedShop = $shopService->getSelectedShop(); @@ -95,7 +95,7 @@ class SliderController extends AbstractController return ['form' => $form->createView(), "slide" => $data]; } - #[Template] + #[Template('@PluginSystemPSCBootstrap4ControllerBackend/slider/delete.html.twig')] #[Route(path: '/delete/{uid}', name: 'psc_plugin_bootstrap4_backend_slider_delete')] public function deleteAction(Request $request, SessionInterface $session, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, $uid) { diff --git a/src/new/var/plugins/System/PSC/Invoice/Controller/Backend/IndexController.php b/src/new/var/plugins/System/PSC/Invoice/Controller/Backend/IndexController.php index 96c37fdc6..c7660b8b9 100755 --- a/src/new/var/plugins/System/PSC/Invoice/Controller/Backend/IndexController.php +++ b/src/new/var/plugins/System/PSC/Invoice/Controller/Backend/IndexController.php @@ -1,8 +1,8 @@ redirectToRoute('psc_backend_production_correction_detail_index', array('uuid' => $uuid)); } - #[Security("is_granted('ROLE_PRODUCTION')")] + #[IsGranted('ROLE_PRODUCTION')] #[Route('/changeexport/{uuid}/{upload}', name: 'psc_backend_production_correction_changeexport')] public function changeexportAction(\PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, $uuid, $upload) { @@ -119,8 +119,8 @@ class CorrectionController extends AbstractController return $this->redirectToRoute('psc_backend_production_correction_detail_index', array('uuid' => $uuid)); } - #[Template] - #[Security("is_granted('ROLE_PRODUCTION')")] + #[Template('@PluginSystemPSCProductionControllerBackend/correction/detail.html.twig')] + #[IsGranted('ROLE_PRODUCTION')] #[Route('/detail/{uuid}', name: 'psc_backend_production_correction_detail_index')] public function detailAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, Manager $eventManager, PaperDB $paperDB, SessionInterface $session, Order $orderService) { diff --git a/src/new/var/plugins/System/PSC/Production/Controller/Backend/PrepressController.php b/src/new/var/plugins/System/PSC/Production/Controller/Backend/PrepressController.php index 74011ab74..cb5b32459 100755 --- a/src/new/var/plugins/System/PSC/Production/Controller/Backend/PrepressController.php +++ b/src/new/var/plugins/System/PSC/Production/Controller/Backend/PrepressController.php @@ -14,8 +14,8 @@ use PSC\Shop\QueueBundle\Event\Position\Printpartner\Notify; use PSC\Shop\QueueBundle\Event\Position\Status\Change; use PSC\Shop\QueueBundle\Service\Event\Manager; use PSC\System\SettingsBundle\Service\PaperDB; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\SessionInterface; @@ -27,8 +27,8 @@ require_once __DIR__ .'/../../../../../../../src/PSC/Shop/EntityBundle/Lagacy/TP class PrepressController extends AbstractController { - #[Template] - #[Security("is_granted('ROLE_PRODUCTION')")] + #[Template('@PluginSystemPSCProductionControllerBackend/prepress/index.html.twig')] + #[IsGranted('ROLE_PRODUCTION')] #[Route('/index', name: 'psc_backend_production_prepress_list_index')] public function indexAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, PaginatorInterface $paginator) { @@ -54,8 +54,8 @@ class PrepressController extends AbstractController ); } - #[Template] - #[Security("is_granted('ROLE_PRODUCTION')")] + #[Template('@PluginSystemPSCProductionControllerBackend/prepress/detail.html.twig')] + #[IsGranted('ROLE_PRODUCTION')] #[Route('/detail/{uuid}', name: 'psc_backend_production_prepress_detail_index')] public function detailAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, Order $orderService, SessionInterface $session, PaperDB $paperDB, EntityManagerInterface $entityManager, DocumentManager $documentManager, Manager $eventManager) { diff --git a/src/new/var/plugins/System/PSC/Production/Controller/Backend/ProductionController.php b/src/new/var/plugins/System/PSC/Production/Controller/Backend/ProductionController.php index c5aedc1f7..0e7ff0c29 100755 --- a/src/new/var/plugins/System/PSC/Production/Controller/Backend/ProductionController.php +++ b/src/new/var/plugins/System/PSC/Production/Controller/Backend/ProductionController.php @@ -17,8 +17,8 @@ use PSC\Shop\QueueBundle\Event\Position\Status\Change; use PSC\Shop\QueueBundle\Service\Event\Manager; use PSC\System\SettingsBundle\Service\PaperDB; use Ramsey\Uuid\Uuid; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; @@ -31,8 +31,8 @@ require_once __DIR__ .'/../../../../../../../src/PSC/Shop/EntityBundle/Lagacy/TP class ProductionController extends AbstractController { - #[Template] - #[Security("is_granted('ROLE_PRODUCTION')")] + #[Template('@PluginSystemPSCProductionControllerBackend/production/index.html.twig')] + #[IsGranted('ROLE_PRODUCTION')] #[Route('/index', name: 'psc_backend_production_production_list_index')] public function indexAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, PaginatorInterface $paginator) { @@ -58,8 +58,8 @@ class ProductionController extends AbstractController ); } - #[Template] - #[Security("is_granted('ROLE_PRODUCTION')")] + #[Template('@PluginSystemPSCProductionControllerBackend/production/detail.html.twig')] + #[IsGranted('ROLE_PRODUCTION')] #[Route('/detail/{uuid}', name: 'psc_backend_production_production_detail_index')] public function detailAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, Order $orderService, SessionInterface $session, PaperDB $paperDB, EntityManagerInterface $entityManager, DocumentManager $documentManager, Manager $eventManager) { diff --git a/src/new/var/plugins/System/PSC/Production/Controller/Backend/ShippingController.php b/src/new/var/plugins/System/PSC/Production/Controller/Backend/ShippingController.php index 0081f97d3..87dc3fee7 100755 --- a/src/new/var/plugins/System/PSC/Production/Controller/Backend/ShippingController.php +++ b/src/new/var/plugins/System/PSC/Production/Controller/Backend/ShippingController.php @@ -1,10 +1,10 @@ getSelectedShop(); - $userRepository = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order'); - $qb = $userRepository->createQueryBuilder('orders') + $userRepository = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order'); + $qb = $userRepository + ->createQueryBuilder('orders') ->leftJoin('orders.contact', 'contact') ->leftJoin('orders.invoiceAddress', 'invoiceAddress') ->leftJoin('orders.positions', 'positions') ->andWhere('orders.shop = :shop_id') ->andWhere('positions.status = :status') - ->setParameter("shop_id", $selectedShop->getUid()) - ->setParameter("status", 177) + ->setParameter('shop_id', $selectedShop->getUid()) + ->setParameter('status', 177) ->orderBy('orders.uid', 'desc'); - $pagination = $paginator->paginate( - $qb, - $request->query->getInt('page', 1), - 15 - ); + $pagination = $paginator->paginate($qb, $request->query->getInt('page', 1), 15); - return array( + return [ 'pagination' => $pagination, - ); + ]; } - #[Template] - #[Security("is_granted('ROLE_PRODUCTION')")] + #[Template('@PluginSystemPSCProductionControllerBackend/shipping/deletetracking.html.twig')] + #[IsGranted('ROLE_PRODUCTION')] #[Route('/tracking/delete/{uuid}/{pos}/{index}', name: 'psc_backend_production_shipping_detail_tracking_delete')] - public function deleteTrackingAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, DocumentManager $documentManager, $uuid, $pos, $index) - { + public function deleteTrackingAction( + Request $request, + \PSC\System\SettingsBundle\Service\Shop $shopService, + EntityManagerInterface $entityManager, + DocumentManager $documentManager, + $uuid, + $pos, + $index, + ) { /** @var Shop $selectedShop */ $selectedShop = $shopService->getSelectedShop(); @@ -78,12 +85,12 @@ class ShippingController extends AbstractController */ $pos = $entityManager ->getRepository('PSC\Shop\EntityBundle\Entity\Orderpos') - ->findOneBy(array('shop' => $selectedShop, 'uuid' => $pos)); + ->findOneBy(['shop' => $selectedShop, 'uuid' => $pos]); /** @var Position $objDoc */ $objDoc = $documentManager - ->getRepository('PSCEntityBundle:Position') - ->findOneByUid((string)$pos->getId()); + ->getRepository('PSC\Shop\EntityBundle\Entity\Position') + ->findOneByUid((string) $pos->getId()); $trackings = $objDoc->getTrackings(); @@ -94,11 +101,11 @@ class ShippingController extends AbstractController $documentManager->persist($objDoc); $documentManager->flush(); - return $this->redirectToRoute('psc_backend_production_shipping_detail_index', array('uuid' => $uuid)); + return $this->redirectToRoute('psc_backend_production_shipping_detail_index', ['uuid' => $uuid]); } - #[Template] - #[Security("is_granted('ROLE_PRODUCTION')")] + #[Template('@PluginSystemPSCProductionControllerBackend/shipping/detail.html.twig')] + #[IsGranted('ROLE_PRODUCTION')] #[Route('/detail/{uuid}/{enableDelivery}', name: 'psc_backend_production_shipping_detail_index')] public function detailAction( Request $request, @@ -111,21 +118,26 @@ class ShippingController extends AbstractController Status $statusService, Registry $shippingService, \PSC\Shop\OrderBundle\Service\Order $orderService, - $uuid, $enableDelivery = 0) - { + $uuid, + $enableDelivery = 0, + ) { $selectedShop = $shopService->getSelectedShop(); /** @var Order $order */ $order = $entityManager ->getRepository('PSC\Shop\EntityBundle\Entity\Order') - ->findOneBy(array('shop' => $selectedShop, 'uuid' => $uuid)); + ->findOneBy(['shop' => $selectedShop, 'uuid' => $uuid]); /** @var \PSC\Shop\EntityBundle\Document\Order $orderObj */ $orderObj = $documentManager ->getRepository('PSC\Shop\EntityBundle\Document\Order') - ->findOneBy(array('uid' => (string)$order->getUid())); + ->findOneBy(['uid' => (string) $order->getUid()]); - $formStatus = $this->createForm(OrderStatusType::class, ['notices' => $orderObj->getNotices(), 'status' => $order->getStatus(), 'package' => $order->getPackage()]); + $formStatus = $this->createForm(OrderStatusType::class, [ + 'notices' => $orderObj->getNotices(), + 'status' => $order->getStatus(), + 'package' => $order->getPackage(), + ]); $formStatus->handleRequest($request); @@ -135,10 +147,7 @@ class ShippingController extends AbstractController $order->setPackage($data['package']); $orderObj->setNotices($data['notices']); - $session->getFlashBag()->add( - 'success', - 'Status erfolgreich gesetzt' - ); + $session->getFlashBag()->add('success', 'Status erfolgreich gesetzt'); $notify = new \PSC\Shop\QueueBundle\Event\Order\Status\Change(); $notify->setShop($selectedShop->getUID()); @@ -150,7 +159,6 @@ class ShippingController extends AbstractController $entityManager->persist($order); $entityManager->flush(); $documentManager->flush(); - } $invoiceObj = $orderObj->getInvoiceAddressSaved(); @@ -196,19 +204,19 @@ class ShippingController extends AbstractController $eventManager->addJob($notify); } - $positions = array(); + $positions = []; $order = $orderService->getOrderByUuid($order->getUuid()); - foreach($order->getPositions() as $pos) { - + foreach ($order->getPositions() as $pos) { /** @var Position $objDoc */ - $objDoc = $documentManager - ->getRepository(Position::class) - ->findOneBy(['uid' => (string)$pos->getUid()]); - - if($request->isMethod('post') && $request->get('shippingProvider', false) && strtolower($request->get('shippingProvider', 'keine')) != 'keine') { + $objDoc = $documentManager->getRepository(Position::class)->findOneBy(['uid' => (string) $pos->getUid()]); + if ( + $request->isMethod('post') && + $request->get('shippingProvider', false) && + strtolower($request->get('shippingProvider', 'keine')) != 'keine' + ) { $tracking = new Tracking(); $tracking->setShippingProvider($request->get('shippingProvider')); $tracking->setTrackingNumber($request->get('trackingNumber')); @@ -222,13 +230,12 @@ class ShippingController extends AbstractController $documentManager->persist($objDoc); $documentManager->flush(); - } $positions[] = $pos; } - return array( + return [ 'positions' => $positions, 'formStatus' => $formStatus->createView(), 'formInvoice' => $formInvoice->createView(), @@ -236,14 +243,20 @@ class ShippingController extends AbstractController 'formSender' => $formSender->createView(), 'order' => $order, 'shippingProvider' => $shippingService->all(), - 'posStatus' => $statusService->getPositionStatusAsArray() - ); + 'posStatus' => $statusService->getPositionStatusAsArray(), + ]; } - #[Template] + #[Template('@PluginSystemPSCProductionControllerBackend/shipping/switchposstatus.html.twig')] #[Route('/detail/switchposstatus/{order}/{pos}/{status}', name: 'psc_backend_production_shipping_detail_switchpos')] - public function switchPosStatusAction(EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService, Manager $eventManager, $order = "", $pos = "", $status = 10) - { + public function switchPosStatusAction( + EntityManagerInterface $entityManager, + \PSC\System\SettingsBundle\Service\Shop $shopService, + Manager $eventManager, + $order = '', + $pos = '', + $status = 10, + ) { /** @var Shop $selectedShop */ $selectedShop = $shopService->getSelectedShop(); @@ -252,7 +265,7 @@ class ShippingController extends AbstractController */ $pos = $entityManager ->getRepository('PSC\Shop\EntityBundle\Entity\Orderpos') - ->findOneBy(array('shop' => $selectedShop, 'uuid' => $pos)); + ->findOneBy(['shop' => $selectedShop, 'uuid' => $pos]); $pos->setStatus($status); @@ -265,9 +278,6 @@ class ShippingController extends AbstractController $notify->setStatus($pos->getStatus()); $eventManager->addJob($notify); - return $this->redirectToRoute('psc_backend_production_shipping_detail_index', array('uuid' => $order)); - + return $this->redirectToRoute('psc_backend_production_shipping_detail_index', ['uuid' => $order]); } - - } diff --git a/src/new/var/plugins/System/PSC/XmlCalc/Api/Product/One.php b/src/new/var/plugins/System/PSC/XmlCalc/Api/Product/One.php index 0abcba07c..97e228aa5 100755 --- a/src/new/var/plugins/System/PSC/XmlCalc/Api/Product/One.php +++ b/src/new/var/plugins/System/PSC/XmlCalc/Api/Product/One.php @@ -12,7 +12,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; use OpenApi\Annotations as OA; use Nelmio\ApiDocBundle\Annotation\Model; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Nelmio\ApiDocBundle\Annotation\Security; class One extends AbstractController { diff --git a/src/new/var/plugins/System/PSC/XmlCalc/Api/Product/Update.php b/src/new/var/plugins/System/PSC/XmlCalc/Api/Product/Update.php index ca26ddb11..d2f89071c 100755 --- a/src/new/var/plugins/System/PSC/XmlCalc/Api/Product/Update.php +++ b/src/new/var/plugins/System/PSC/XmlCalc/Api/Product/Update.php @@ -12,7 +12,7 @@ use OpenApi\Attributes\Tag; use Plugin\System\PSC\XmlCalc\Model\Product; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\EntityBundle\Entity\Product as PSCProduct; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; diff --git a/src/new/var/plugins/System/PSC/XmlCalc/Api/Shop/One.php b/src/new/var/plugins/System/PSC/XmlCalc/Api/Shop/One.php index bb05a3737..ea9a32d88 100755 --- a/src/new/var/plugins/System/PSC/XmlCalc/Api/Shop/One.php +++ b/src/new/var/plugins/System/PSC/XmlCalc/Api/Shop/One.php @@ -9,7 +9,7 @@ use OpenApi\Annotations as OA; use Plugin\System\PSC\XmlCalc\Model\Shop as PluginShop; use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Shop\EntityBundle\Entity\Shop as PSCShop; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; diff --git a/src/new/var/plugins/System/PSC/XmlCalc/Api/Shop/Update.php b/src/new/var/plugins/System/PSC/XmlCalc/Api/Shop/Update.php index 38a513c34..7ff1f0b43 100755 --- a/src/new/var/plugins/System/PSC/XmlCalc/Api/Shop/Update.php +++ b/src/new/var/plugins/System/PSC/XmlCalc/Api/Shop/Update.php @@ -10,7 +10,7 @@ use PSC\Component\ApiBundle\Dto\Error\NotFound; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Nelmio\ApiDocBundle\Annotation\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; use OpenApi\Annotations as OA; diff --git a/src/new/var/plugins/System/PSC/XmlCalc/Api/System/One.php b/src/new/var/plugins/System/PSC/XmlCalc/Api/System/One.php index f2d66aff1..39df60ab7 100755 --- a/src/new/var/plugins/System/PSC/XmlCalc/Api/System/One.php +++ b/src/new/var/plugins/System/PSC/XmlCalc/Api/System/One.php @@ -12,7 +12,7 @@ use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; use OpenApi\Annotations as OA; use Nelmio\ApiDocBundle\Annotation\Model; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Nelmio\ApiDocBundle\Annotation\Security; class One extends AbstractController { diff --git a/src/new/var/plugins/System/PSC/XmlCalc/Api/System/Update.php b/src/new/var/plugins/System/PSC/XmlCalc/Api/System/Update.php index 17d01756b..4516f067b 100755 --- a/src/new/var/plugins/System/PSC/XmlCalc/Api/System/Update.php +++ b/src/new/var/plugins/System/PSC/XmlCalc/Api/System/Update.php @@ -10,7 +10,7 @@ use PSC\Component\ApiBundle\Dto\Error\NotFound; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Nelmio\ApiDocBundle\Annotation\Security; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; use OpenApi\Annotations as OA; diff --git a/src/new/var/plugins/System/PSC/XmlCalc/Controller/Backend/LiveController.php b/src/new/var/plugins/System/PSC/XmlCalc/Controller/Backend/LiveController.php index 134e60cd5..ea149fd40 100755 --- a/src/new/var/plugins/System/PSC/XmlCalc/Controller/Backend/LiveController.php +++ b/src/new/var/plugins/System/PSC/XmlCalc/Controller/Backend/LiveController.php @@ -35,8 +35,8 @@ use PSC\Shop\QueueBundle\Event\Position\Status\Change; use PSC\System\SettingsBundle\Service\PaperDB; use Ramsey\Uuid\Uuid; use Sauladam\ShipmentTracker\ShipmentTracker; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Symfony\Bridge\Twig\Attribute\Template; +use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\Request; @@ -49,7 +49,7 @@ class LiveController extends AbstractController { #[Template] - #[Security("is_granted('ROLE_ADMIN')")] + #[IsGranted('ROLE_ADMIN')] #[Route('/calc/{uuid}/{test}', defaults: ['uuid' => '', 'test' => false], name: 'psc_plugin_system_xmlcalc_backend_live_index')] public function indexAction( Request $request,