mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 20:04:34 +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!');
|
||||
}
|
||||
|
||||
|
|
|
@ -76,6 +76,9 @@ class ToolsTreeBuilder
|
|||
$nodes[] = new TreeViewNode($this->translator->trans('tree.tools.edit.footprint'),
|
||||
$this->urlGenerator->generate('footprint_new'));
|
||||
|
||||
$nodes[] = new TreeViewNode($this->translator->trans('tree.tools.edit.currency'),
|
||||
$this->urlGenerator->generate('currency_new'));
|
||||
|
||||
$nodes[] = new TreeViewNode($this->translator->trans('tree.tools.edit.part'),
|
||||
$this->urlGenerator->generate('part_new'));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue