From b941b97eee78fd5652411c510144e83752ad33a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 8 Jul 2023 19:02:43 +0200 Subject: [PATCH] Show full paths of elements on hover in part tables Related to discussion #312 --- src/DataTables/Column/EntityColumn.php | 4 +++- src/DataTables/PartsDataTable.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/DataTables/Column/EntityColumn.php b/src/DataTables/Column/EntityColumn.php index 35bdf547..2facdc81 100644 --- a/src/DataTables/Column/EntityColumn.php +++ b/src/DataTables/Column/EntityColumn.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace App\DataTables\Column; use App\Entity\Base\AbstractNamedDBElement; +use App\Entity\Base\AbstractStructuralDBElement; use App\Services\EntityURLGenerator; use Omines\DataTablesBundle\Column\AbstractColumn; use Symfony\Component\OptionsResolver\Options; @@ -70,8 +71,9 @@ class EntityColumn extends AbstractColumn if ($entity instanceof AbstractNamedDBElement) { if (null !== $entity->getID()) { return sprintf( - '%s', + '%s', $this->urlGenerator->listPartsURL($entity), + $entity instanceof AbstractStructuralDBElement ? htmlspecialchars($entity->getFullPath()) : htmlspecialchars($entity->getName()), htmlspecialchars($entity->getName()) ); } diff --git a/src/DataTables/PartsDataTable.php b/src/DataTables/PartsDataTable.php index 82259cdd..d8b34098 100644 --- a/src/DataTables/PartsDataTable.php +++ b/src/DataTables/PartsDataTable.php @@ -144,8 +144,9 @@ final class PartsDataTable implements DataTableTypeInterface continue; } $tmp[] = sprintf( - '%s', + '%s', $this->urlGenerator->listPartsURL($lot->getStorageLocation()), + htmlspecialchars($lot->getStorageLocation()->getFullPath()), htmlspecialchars($lot->getStorageLocation()->getName()) ); }