Added possibility to define alternative names on data structures

This can be used to find elements, based on the data returned by info providers
This commit is contained in:
Jan Böhmer 2023-07-16 22:59:46 +02:00
parent edc54aaf91
commit b74ab18a6d
11 changed files with 79 additions and 5 deletions

View file

@ -22,6 +22,9 @@ declare(strict_types=1);
namespace App\Form\AdminPages;
use App\Entity\PriceInformations\Currency;
use App\Entity\ProjectSystem\Project;
use App\Entity\UserSystem\Group;
use Symfony\Bundle\SecurityBundle\Security;
use App\Entity\Base\AbstractNamedDBElement;
use App\Entity\Base\AbstractStructuralDBElement;
@ -111,6 +114,19 @@ class BaseEntityAdminForm extends AbstractType
);
}
if ($entity instanceof AbstractStructuralDBElement && !($entity instanceof Group || $entity instanceof Project || $entity instanceof Currency)) {
$builder->add('alternative_names', TextType::class, [
'required' => false,
'label' => 'entity.edit.alternative_names.label',
'help' => 'entity.edit.alternative_names.help',
'empty_data' => null,
'attr' => [
'class' => 'tagsinput',
'data-controller' => 'elements--tagsinput',
]
]);
}
$this->additionalFormElements($builder, $options, $entity);
//Attachment section