diff --git a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php index 9c88f861d..9a9542927 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php @@ -13,6 +13,8 @@ namespace Chill\DocStoreBundle\Controller; use Chill\DocStoreBundle\GenericDoc\ManagerInterface; use Chill\DocStoreBundle\Security\Authorization\AccompanyingCourseDocumentVoter; +use Chill\MainBundle\Audit\TriggerAuditInterface; +use Chill\MainBundle\Entity\AuditTrail; use Chill\MainBundle\Pagination\PaginatorFactory; use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactory; use Chill\PersonBundle\Entity\AccompanyingPeriod; @@ -20,6 +22,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Security; +use Symfony\Component\Translation\TranslatableMessage; final readonly class GenericDocForAccompanyingPeriodController { @@ -29,6 +32,7 @@ final readonly class GenericDocForAccompanyingPeriodController private PaginatorFactory $paginator, private Security $security, private \Twig\Environment $twig, + private TriggerAuditInterface $triggerAudit, ) {} /** @@ -41,6 +45,12 @@ final readonly class GenericDocForAccompanyingPeriodController throw new AccessDeniedHttpException('not allowed to see the documents for accompanying period'); } + $this->triggerAudit->triggerAudit( + AuditTrail::AUDIT_LIST, + $accompanyingPeriod, + description: new TranslatableMessage('audit.generic-doc.list_for_accompanying_period') + ); + $filterBuilder = $this->filterOrderHelperFactory ->create(self::class) ->addSearchBox() diff --git a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php index 2a07d0d26..cea7f001e 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php @@ -13,6 +13,8 @@ namespace Chill\DocStoreBundle\Controller; use Chill\DocStoreBundle\GenericDoc\ManagerInterface; use Chill\DocStoreBundle\Security\Authorization\PersonDocumentVoter; +use Chill\MainBundle\Audit\TriggerAuditInterface; +use Chill\MainBundle\Entity\AuditTrail; use Chill\MainBundle\Pagination\PaginatorFactory; use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactory; use Chill\PersonBundle\Entity\Person; @@ -20,6 +22,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Security; +use Symfony\Component\Translation\TranslatableMessage; final readonly class GenericDocForPerson { @@ -29,6 +32,7 @@ final readonly class GenericDocForPerson private PaginatorFactory $paginator, private Security $security, private \Twig\Environment $twig, + private TriggerAuditInterface $triggerAudit, ) {} /** @@ -41,6 +45,12 @@ final readonly class GenericDocForPerson throw new AccessDeniedHttpException('not allowed to see the documents for person'); } + $this->triggerAudit->triggerAudit( + AuditTrail::AUDIT_LIST, + $person, + description: new TranslatableMessage('audit.generic-doc.list_for_person') + ); + $filterBuilder = $this->filterOrderHelperFactory ->create(self::class) ->addSearchBox()