mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 02:38:50 +02:00
Added an admin page for currencies.
This commit is contained in:
parent
87e6f641c3
commit
2468409212
15 changed files with 374 additions and 9 deletions
|
@ -39,6 +39,7 @@ use App\Entity\Base\NamedDBElement;
|
|||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\Supplier;
|
||||
use App\Entity\PriceInformations\Currency;
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Exceptions\EntityNotSupported;
|
||||
use Symfony\Component\HttpKernel\HttpCache\Store;
|
||||
|
@ -176,10 +177,14 @@ class EntityURLGenerator
|
|||
return $this->urlGenerator->generate("footprint_edit", ['id' => $entity->getID()]);
|
||||
}
|
||||
|
||||
if($entity instanceof User) {
|
||||
if ($entity instanceof User) {
|
||||
return $this->urlGenerator->generate('user_edit', ['id' => $entity->getID()]);
|
||||
}
|
||||
|
||||
if ($entity instanceof Currency) {
|
||||
return $this->urlGenerator->generate('currency_edit', ['id' => $entity->getID()]);
|
||||
}
|
||||
|
||||
//Otherwise throw an error
|
||||
throw new EntityNotSupported('The given entity is not supported yet!');
|
||||
}
|
||||
|
@ -229,6 +234,10 @@ class EntityURLGenerator
|
|||
return $this->urlGenerator->generate('user_new');
|
||||
}
|
||||
|
||||
if ($entity instanceof Currency) {
|
||||
return $this->urlGenerator->generate('currency_new');
|
||||
}
|
||||
|
||||
throw new EntityNotSupported('The given entity is not supported yet!');
|
||||
}
|
||||
|
||||
|
@ -299,6 +308,10 @@ class EntityURLGenerator
|
|||
return $this->urlGenerator->generate('user_delete', ['id' => $entity->getID()]);
|
||||
}
|
||||
|
||||
if ($entity instanceof Currency) {
|
||||
return $this->urlGenerator->generate('currency_delete', ['id' => $entity->getID()]);
|
||||
}
|
||||
|
||||
throw new EntityNotSupported('The given entity is not supported yet!');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue