Added a very basic import dialog for Parts

This commit is contained in:
Jan Böhmer 2023-03-12 19:53:55 +01:00
parent 8f033910ce
commit 7a9b7c87a4
7 changed files with 149 additions and 22 deletions

View file

@ -23,6 +23,8 @@ declare(strict_types=1);
namespace App\Form\AdminPages;
use App\Entity\Base\AbstractStructuralDBElement;
use App\Entity\Parts\Category;
use App\Entity\Parts\Part;
use App\Form\Type\StructuralEntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
@ -63,7 +65,7 @@ class ImportType extends AbstractType
'label' => 'export.format',
'disabled' => $disabled,
])
->add('csv_separator', TextType::class, [
->add('csv_delimiter', TextType::class, [
'data' => ';',
'label' => 'import.csv_separator',
'disabled' => $disabled,
@ -78,6 +80,17 @@ class ImportType extends AbstractType
]);
}
if ($entity instanceof Part) {
$builder->add('part_category', StructuralEntityType::class, [
'class' => Category::class,
'required' => false,
'label' => 'category.label',
'disabled' => $disabled,
'disable_not_selectable' => true,
'allow_add' => true
]);
}
$builder->add('file', FileType::class, [
'label' => 'import.file',
'attr' => [