Skip to content

Commit

Permalink
inquiries are now displayed only for managed domains
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmannmartin committed Nov 6, 2024
1 parent 8abdc19 commit eebf464
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Controller/Admin/InquiryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
) {
}

Expand All @@ -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', [
Expand Down

0 comments on commit eebf464

Please sign in to comment.