Show full paths of elements on hover in part tables

Related to discussion #312
This commit is contained in:
Jan Böhmer 2023-07-08 19:02:43 +02:00
parent d38ac652fc
commit b941b97eee
2 changed files with 5 additions and 2 deletions

View file

@ -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(
'<a href="%s">%s</a>',
'<a href="%s" title="%s">%s</a>',
$this->urlGenerator->listPartsURL($entity),
$entity instanceof AbstractStructuralDBElement ? htmlspecialchars($entity->getFullPath()) : htmlspecialchars($entity->getName()),
htmlspecialchars($entity->getName())
);
}

View file

@ -144,8 +144,9 @@ final class PartsDataTable implements DataTableTypeInterface
continue;
}
$tmp[] = sprintf(
'<a href="%s">%s</a>',
'<a href="%s" title="%s">%s</a>',
$this->urlGenerator->listPartsURL($lot->getStorageLocation()),
htmlspecialchars($lot->getStorageLocation()->getFullPath()),
htmlspecialchars($lot->getStorageLocation()->getName())
);
}