mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-05 23:15:50 +01:00
Show a treeview in the admin menus, to select between the different elements.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Entity\AttachmentType;
|
||||
use App\Entity\Category;
|
||||
use App\Entity\NamedDBElement;
|
||||
use App\Entity\Part;
|
||||
@@ -107,6 +108,10 @@ class EntityURLGenerator
|
||||
return $this->urlGenerator->generate('part_edit', ['id' => $entity->getID()]);
|
||||
}
|
||||
|
||||
if($entity instanceof AttachmentType) {
|
||||
return $this->urlGenerator->generate('attachment_type_edit', ['id' => $entity->getID()]);
|
||||
}
|
||||
|
||||
//Otherwise throw an error
|
||||
throw new EntityNotSupported('The given entity is not supported yet!');
|
||||
}
|
||||
@@ -124,6 +129,10 @@ class EntityURLGenerator
|
||||
return $this->urlGenerator->generate('part_new');
|
||||
}
|
||||
|
||||
if($entity instanceof AttachmentType) {
|
||||
return $this->urlGenerator->generate('attachment_type_new');
|
||||
}
|
||||
|
||||
throw new EntityNotSupported('The given entity is not supported yet!');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user