mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 11:54:32 +02:00
Added a very basic import dialog for Parts
This commit is contained in:
parent
8f033910ce
commit
7a9b7c87a4
7 changed files with 149 additions and 22 deletions
|
@ -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' => [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue