diff --git a/src/Controller/AdminController.php b/src/Controller/AdminController.php index 02d97ea..3b289d4 100644 --- a/src/Controller/AdminController.php +++ b/src/Controller/AdminController.php @@ -679,14 +679,16 @@ class AdminController extends AbstractController } #[Route('/watchdog', name: 'watchdog')] + #[Route('/watchdog/view/{id}', name: 'watchdog_view')] #[Route('/watchdog/{type}', name: 'watchdog_type')] - #[Route('/watchdog/{type}/{action}', name: 'watchdog_type_action')] + #[Route('/watchdog/{type}/{action}', name: 'watchdog_type_action')] public function watchdog( PaginatorInterface $paginator, Request $Request, EntityManagerInterface $EntityManagerInterface, string $type = null, - string $action = null + string $action = null, + int $id = null ): Response { /** * @var LogEntryRepository $logEntryRepository @@ -704,6 +706,9 @@ class AdminController extends AbstractController ->from('Gedmo\Loggable\Entity\LogEntry', 'l') ->orderBy('l.loggedAt', 'DESC'); + + + if (null != $type) { $qb->where('l.objectClass = :type'); $qb->setParameter('type', 'App\Entity\\' . $type); @@ -718,6 +723,11 @@ class AdminController extends AbstractController } } + if(null != $id){ + $qb->where('l.objectId = :id'); + $qb->setParameter('id', $id); + } + $pagination = $paginator->paginate( $qb->getQuery()->getResult(), $Request->query->getInt('page', 1) diff --git a/templates/_cells/historyDisplay.html.twig b/templates/_cells/historyDisplay.html.twig index 4cdd176..de4df31 100644 --- a/templates/_cells/historyDisplay.html.twig +++ b/templates/_cells/historyDisplay.html.twig @@ -11,7 +11,7 @@ {% endif %}
{% if notype is not defined %} -{{ i.objectClass }} (# {{ i.objectId }})
+{{ i.objectClass }} (# {{ i.objectId }}) {% if is_granted('ROLE_ADMIN') %}{% endif %}
{% endif %}{{ ('title_data_' ~ i.action)|trans }}