mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-02-17 06:59:35 +00:00
Only show the created avatar attachment type for user attachments
This commit is contained in:
parent
a4c2b8f885
commit
90c82aab2e
2 changed files with 2 additions and 1 deletions
|
|
@ -52,7 +52,7 @@ class AttachmentTypeAdminForm extends BaseEntityAdminForm
|
||||||
if (!is_a($class, Attachment::class, true)) {
|
if (!is_a($class, Attachment::class, true)) {
|
||||||
return $class;
|
return $class;
|
||||||
}
|
}
|
||||||
return new StaticMessage($this->elementTypeNameGenerator->typeLabel($class::ALLOWED_ELEMENT_CLASS));
|
return new StaticMessage($this->elementTypeNameGenerator->typeLabelPlural($class::ALLOWED_ELEMENT_CLASS));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,7 @@ class UserAvatarHelper
|
||||||
$attachment_type = new AttachmentType();
|
$attachment_type = new AttachmentType();
|
||||||
$attachment_type->setName('Avatars');
|
$attachment_type->setName('Avatars');
|
||||||
$attachment_type->setFiletypeFilter('image/*');
|
$attachment_type->setFiletypeFilter('image/*');
|
||||||
|
$attachment_type->setAllowedTargets([UserAttachment::class]);
|
||||||
$this->entityManager->persist($attachment_type);
|
$this->entityManager->persist($attachment_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue