Added an admin page for currencies.

This commit is contained in:
Jan Böhmer 2019-08-12 23:45:21 +02:00
parent 87e6f641c3
commit 2468409212
15 changed files with 374 additions and 9 deletions

View file

@ -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!');
}