mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-03 17:55:03 +02:00
Allow to add/delete attachments via part edit page.
This commit is contained in:
parent
fcfab982a8
commit
3a11933a89
12 changed files with 370 additions and 50 deletions
|
@ -31,12 +31,15 @@
|
|||
|
||||
namespace App\Form\Part;
|
||||
|
||||
use App\Entity\Attachments\PartAttachment;
|
||||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Footprint;
|
||||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Parts\MeasurementUnit;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Form\AttachmentFormType;
|
||||
use App\Form\AttachmentType;
|
||||
use App\Form\Type\SIUnitType;
|
||||
use App\Form\Type\StructuralEntityType;
|
||||
use Doctrine\DBAL\Types\FloatType;
|
||||
|
@ -130,6 +133,17 @@ class PartBaseType extends AbstractType
|
|||
'by_reference' => false
|
||||
]);
|
||||
|
||||
//Attachment section
|
||||
$builder->add('attachments', CollectionType::class, [
|
||||
'entry_type' => AttachmentFormType::class,
|
||||
'allow_add' => true, 'allow_delete' => true,
|
||||
'label' => false,
|
||||
'entry_options' => [
|
||||
'data_class' => PartAttachment::class
|
||||
],
|
||||
'by_reference' => false
|
||||
]);
|
||||
|
||||
$builder
|
||||
//Buttons
|
||||
->add('save', SubmitType::class, ['label' => 'part.edit.save'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue