Fixes
This commit is contained in:
parent
4be0f5a39d
commit
beb6450338
@ -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 ;
|
||||
|
||||
@ -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": "*",
|
||||
|
||||
68
src/new/composer.lock
generated
68
src/new/composer.lock
generated
@ -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",
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {};
|
||||
6
src/new/phpstan.neon
Normal file
6
src/new/phpstan.neon
Normal file
@ -0,0 +1,6 @@
|
||||
parameters:
|
||||
level: 7
|
||||
paths:
|
||||
- src
|
||||
- var/plugins
|
||||
|
||||
@ -20,11 +20,11 @@ use PSC\Shop\QueueBundle\Service\Queue\Manager;
|
||||
use PSC\System\SettingsBundle\Service\Instance;
|
||||
use PSC\System\SettingsBundle\Service\Shop;
|
||||
use PSC\System\UpdateBundle\Service\Migration;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Intl\NumberFormatter\NumberFormatter;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\UX\Chartjs\Builder\ChartBuilderInterface;
|
||||
use Symfony\UX\Chartjs\Model\Chart;
|
||||
|
||||
@ -47,24 +47,52 @@ class DashboardController extends AbstractController
|
||||
* @return array|View|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
#[Route(path: '/dashboard', name: 'psc_backend_dashboard_index')]
|
||||
#[Template]
|
||||
public function indexAction(Migration $migration, Shop $shop, EntityManagerInterface $entityManager, Manager $queueService, Instance $instanceService, ChartBuilderInterface $chartBuilder, ContactRepository $contactRepository, Order $orderService)
|
||||
{
|
||||
|
||||
#[Template('@PSCBackendDashboard/dashboard/index.html.twig')]
|
||||
public function indexAction(
|
||||
Migration $migration,
|
||||
Shop $shop,
|
||||
EntityManagerInterface $entityManager,
|
||||
Manager $queueService,
|
||||
Instance $instanceService,
|
||||
ChartBuilderInterface $chartBuilder,
|
||||
ContactRepository $contactRepository,
|
||||
Order $orderService,
|
||||
) {
|
||||
/** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */
|
||||
$selectedShop = $shop->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,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -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"));
|
||||
|
||||
@ -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()) {
|
||||
|
||||
@ -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));
|
||||
|
||||
@ -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 */
|
||||
|
||||
@ -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)) {
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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}}');
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -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 */
|
||||
|
||||
@ -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 */
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PSC\Libraries\DoctrineBundle\DBAL\Platform;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MariaDBPlatform as BaseMariaDBPlatform;
|
||||
|
||||
/**
|
||||
* Custom MariaDB Platform to support all MariaDB versions
|
||||
*/
|
||||
class MariaDBPlatform extends BaseMariaDBPlatform
|
||||
{
|
||||
// This class extends the base MariaDB platform
|
||||
// and can be used to add custom functionality if needed
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
@ -70,7 +70,7 @@ class EditController extends AbstractController
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Route(path: '/edit/create', name: 'psc_shop_account_backend_create')]
|
||||
#[Template]
|
||||
#[Template('@PSCShopAccount/backend/edit/create.html.twig')]
|
||||
public function createAction(
|
||||
Request $request,
|
||||
Field $fieldService,
|
||||
@ -145,7 +145,7 @@ class EditController extends AbstractController
|
||||
* @throws \Doctrine\ODM\MongoDB\MongoDBException
|
||||
*/
|
||||
#[Route(path: '/edit/edit/{uuid}', name: 'psc_shop_account_backend_edit')]
|
||||
#[Template]
|
||||
#[Template('@PSCShopAccount/backend/edit/edit.html.twig')]
|
||||
public function editAction(
|
||||
Request $request,
|
||||
Field $fieldService,
|
||||
|
||||
@ -27,8 +27,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;
|
||||
|
||||
/**
|
||||
@ -53,9 +53,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_account_backend_list')]
|
||||
#[Template]
|
||||
#[Template('@PSCShopAccount/backend/list/index.html.twig')]
|
||||
public function indexAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, PaginatorInterface $paginator, FilterBuilderUpdaterInterface $filterBuilderUpdater, SessionInterface $session)
|
||||
{
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
|
||||
@ -17,7 +17,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;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
|
||||
@ -17,7 +17,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;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
|
||||
@ -35,8 +35,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;
|
||||
|
||||
/**
|
||||
@ -74,7 +74,7 @@ class EditController extends AbstractController
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Route(path: '/create', name: 'psc_shop_cms_backend_edit_create')]
|
||||
#[Template]
|
||||
#[Template('@PSCShopCms/backend/edit/create.html.twig')]
|
||||
public function createAction(
|
||||
Request $request,
|
||||
Field $fieldService,
|
||||
@ -138,7 +138,7 @@ class EditController extends AbstractController
|
||||
* @throws \Doctrine\ODM\MongoDB\MongoDBException
|
||||
*/
|
||||
#[Route(path: '/edit/{uid}', name: 'psc_shop_cms_backend_edit_edit')]
|
||||
#[Template]
|
||||
#[Template('@PSCShopCms/backend/edit/edit.html.twig')]
|
||||
public function editAction(
|
||||
Request $request,
|
||||
Field $fieldService,
|
||||
@ -221,7 +221,7 @@ class EditController extends AbstractController
|
||||
* @return array|View|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/delete/{uid}', name: 'psc_shop_cms_backend_edit_delete')]
|
||||
#[Template]
|
||||
#[Template('@PSCShopCms/backend/edit/delete.html.twig')]
|
||||
public function deleteAction(
|
||||
Request $request,
|
||||
EntityManagerInterface $entityManager,
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
@ -45,7 +45,7 @@ class ListController extends AbstractController
|
||||
* @return array|View
|
||||
*/
|
||||
#[Route(path: '/list', name: 'psc_shop_cms_backend_list')]
|
||||
#[Template]
|
||||
#[Template('@PSCShopCms/backend/list/index.html.twig')]
|
||||
public function indexAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, FilterBuilderUpdaterInterface $filterBuilderUpdater, PaginatorInterface $paginator, ThemeSource $sourceService)
|
||||
{
|
||||
|
||||
|
||||
@ -20,8 +20,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;
|
||||
|
||||
/**
|
||||
@ -44,7 +44,7 @@ class ShowController extends AbstractController
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Route(path: '/{url}', name: 'psc_shop_cms_frontend_show')]
|
||||
#[Template]
|
||||
#[Template('@PSCShopCms/frontend/show/index.html.twig')]
|
||||
public function indexAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, $url)
|
||||
{
|
||||
|
||||
|
||||
@ -44,8 +44,8 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
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 Twig\Environment;
|
||||
use Twig_Environment;
|
||||
@ -78,7 +78,7 @@ class OrderController extends AbstractController
|
||||
* @internal param bool $enableDelivery
|
||||
*/
|
||||
#[Route(path: '/order/mail/{uuid}', defaults: ['enableDelivery' => 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 = "")
|
||||
{
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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())
|
||||
|
||||
@ -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 */
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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')
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
|
||||
@ -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]);
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 = "")
|
||||
{
|
||||
/**
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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 = "")
|
||||
{
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -45,5 +45,6 @@ class SpecialProductDenormalizer implements DenormalizerInterface, DenormalizerA
|
||||
|
||||
public function getSupportedTypes(null|string $format): array
|
||||
{
|
||||
return [IProductTypeObject::class];
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 */
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
|
||||
@ -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 == '') {
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user