mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-14 12:24:33 +02:00
Allow to import attachments and parameters via entity import
This fixes issue #363
This commit is contained in:
parent
bbf7222a6a
commit
06c8e584a4
19 changed files with 73 additions and 58 deletions
|
@ -147,7 +147,7 @@ abstract class Attachment extends AbstractNamedDBElement
|
|||
* @var string|null the original filename the file had, when the user uploaded it
|
||||
*/
|
||||
#[ORM\Column(type: Types::STRING, nullable: true)]
|
||||
#[Groups(['full', 'attachment:read'])]
|
||||
#[Groups(['attachment:read', 'import'])]
|
||||
#[Assert\Length(max: 255)]
|
||||
protected ?string $original_filename = null;
|
||||
|
||||
|
@ -161,7 +161,7 @@ abstract class Attachment extends AbstractNamedDBElement
|
|||
* @var string the name of this element
|
||||
*/
|
||||
#[Assert\NotBlank(message: 'validator.attachment.name_not_blank')]
|
||||
#[Groups(['simple', 'extended', 'full', 'attachment:read', 'attachment:write'])]
|
||||
#[Groups(['simple', 'extended', 'full', 'attachment:read', 'attachment:write', 'import'])]
|
||||
protected string $name = '';
|
||||
|
||||
/**
|
||||
|
@ -173,14 +173,14 @@ abstract class Attachment extends AbstractNamedDBElement
|
|||
protected ?AttachmentContainingDBElement $element = null;
|
||||
|
||||
#[ORM\Column(type: Types::BOOLEAN)]
|
||||
#[Groups(['attachment:read', 'attachment_write'])]
|
||||
#[Groups(['attachment:read', 'attachment_write', 'full', 'import'])]
|
||||
protected bool $show_in_table = false;
|
||||
|
||||
#[Assert\NotNull(message: 'validator.attachment.must_not_be_null')]
|
||||
#[ORM\ManyToOne(targetEntity: AttachmentType::class, inversedBy: 'attachments_with_type')]
|
||||
#[ORM\JoinColumn(name: 'type_id', nullable: false)]
|
||||
#[Selectable]
|
||||
#[Groups(['attachment:read', 'attachment:write'])]
|
||||
#[Groups(['attachment:read', 'attachment:write', 'import', 'full'])]
|
||||
#[ApiProperty(readableLink: false)]
|
||||
protected ?AttachmentType $attachment_type = null;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue