Started to work on the possibilty to create new entities directly from the part edit page.

This fixes issue #203.
This commit is contained in:
Jan Böhmer 2023-01-29 20:42:18 +01:00
parent 672d55624f
commit 1654010ea3
8 changed files with 142 additions and 84 deletions

View file

@ -63,6 +63,7 @@ class OrderdetailType extends AbstractType
'class' => Supplier::class,
'disable_not_selectable' => true,
'label' => 'orderdetails.edit.supplier',
'allow_add' => $this->security->isGranted('@suppliers.create'),
]);
$builder->add('supplier_product_url', UrlType::class, [

View file

@ -104,15 +104,15 @@ class PartBaseType extends AbstractType
])
->add('category', StructuralEntityType::class, [
'class' => Category::class,
'allow_add' => $this->security->isGranted('@categories.create'),
'label' => 'part.edit.category',
'disable_not_selectable' => true,
'constraints' => [
],
])
->add('footprint', StructuralEntityType::class, [
'class' => Footprint::class,
'required' => false,
'label' => 'part.edit.footprint',
'allow_add' => $this->security->isGranted('@footprints.create'),
'disable_not_selectable' => true,
])
->add('tags', TextType::class, [
@ -131,6 +131,7 @@ class PartBaseType extends AbstractType
'class' => Manufacturer::class,
'required' => false,
'label' => 'part.edit.manufacturer.label',
'allow_add' => $this->security->isGranted('@manufacturers.create'),
'disable_not_selectable' => true,
])
->add('manufacturer_product_url', UrlType::class, [

View file

@ -60,6 +60,7 @@ class PartLotType extends AbstractType
'label' => 'part_lot.edit.location',
'required' => false,
'disable_not_selectable' => true,
'allow_add' => $this->security->isGranted('@storelocations.create'),
]);
$builder->add('amount', SIUnitType::class, [