From eebf4649230b8d4339768c93b56af03aea99eb53 Mon Sep 17 00:00:00 2001 From: Martin Grossmann Date: Mon, 4 Nov 2024 14:45:48 +0100 Subject: [PATCH] inquiries are now displayed only for managed domains --- src/Controller/Admin/InquiryController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Controller/Admin/InquiryController.php b/src/Controller/Admin/InquiryController.php index b4c00b4eb1..84db338543 100644 --- a/src/Controller/Admin/InquiryController.php +++ b/src/Controller/Admin/InquiryController.php @@ -5,6 +5,7 @@ namespace Shopsys\FrameworkBundle\Controller\Admin; use Shopsys\FrameworkBundle\Component\Domain\AdminDomainFilterTabsFacade; +use Shopsys\FrameworkBundle\Component\Domain\Domain; use Shopsys\FrameworkBundle\Form\Admin\QuickSearch\QuickSearchFormData; use Shopsys\FrameworkBundle\Form\Admin\QuickSearch\QuickSearchFormType; use Shopsys\FrameworkBundle\Model\Inquiry\InquiryFacade; @@ -21,12 +22,14 @@ class InquiryController extends AdminBaseController * @param \Shopsys\FrameworkBundle\Model\Inquiry\InquiryFacade $inquiryFacade * @param \Shopsys\FrameworkBundle\Model\Localization\Localization $localization * @param \Shopsys\FrameworkBundle\Component\Domain\AdminDomainFilterTabsFacade $adminDomainFilterTabsFacade + * @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain */ public function __construct( protected readonly InquiryGridFactory $inquiryGridFactory, protected readonly InquiryFacade $inquiryFacade, protected readonly Localization $localization, protected readonly AdminDomainFilterTabsFacade $adminDomainFilterTabsFacade, + protected readonly Domain $domain, ) { } @@ -53,6 +56,10 @@ public function listAction(Request $request): Response $queryBuilder ->andWhere('i.domainId = :selectedDomainId') ->setParameter('selectedDomainId', $selectedDomainId); + } else { + $queryBuilder + ->andWhere('i.domainId IN (:domainIds)') + ->setParameter('domainIds', $this->domain->getAdminEnabledDomainIds()); } return $this->render('@ShopsysFramework/Admin/Content/Inquiry/list.html.twig', [