mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-13 13:49:33 +00:00
Assemblies einführen
This commit is contained in:
parent
e1418dfdc1
commit
f0748a2123
107 changed files with 14096 additions and 98 deletions
|
|
@ -22,6 +22,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Services\Trees;
|
||||
|
||||
use App\Entity\AssemblySystem\Assembly;
|
||||
use App\Entity\Attachments\AttachmentType;
|
||||
use App\Entity\LabelSystem\LabelProfile;
|
||||
use App\Entity\Parts\Category;
|
||||
|
|
@ -175,6 +176,12 @@ class ToolsTreeBuilder
|
|||
$this->urlGenerator->generate('project_new')
|
||||
))->setIcon('fa-fw fa-treeview fa-solid fa-archive');
|
||||
}
|
||||
if ($this->security->isGranted('read', new Assembly())) {
|
||||
$nodes[] = (new TreeViewNode(
|
||||
$this->translator->trans('tree.tools.edit.assemblies'),
|
||||
$this->urlGenerator->generate('assembly_new')
|
||||
))->setIcon('fa-fw fa-treeview fa-solid fa-list');
|
||||
}
|
||||
if ($this->security->isGranted('read', new Supplier())) {
|
||||
$nodes[] = (new TreeViewNode(
|
||||
$this->translator->trans('tree.tools.edit.suppliers'),
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Services\Trees;
|
||||
|
||||
use App\Entity\AssemblySystem\Assembly;
|
||||
use App\Entity\Base\AbstractDBElement;
|
||||
use App\Entity\Base\AbstractNamedDBElement;
|
||||
use App\Entity\Base\AbstractStructuralDBElement;
|
||||
|
|
@ -154,6 +155,10 @@ class TreeViewGenerator
|
|||
$href_type = 'list_parts';
|
||||
}
|
||||
|
||||
if ($mode === 'assemblies') {
|
||||
$href_type = 'list_parts';
|
||||
}
|
||||
|
||||
$generic = $this->getGenericTree($class, $parent);
|
||||
$treeIterator = new TreeViewNodeIterator($generic);
|
||||
$recursiveIterator = new RecursiveIteratorIterator($treeIterator, RecursiveIteratorIterator::SELF_FIRST);
|
||||
|
|
@ -219,6 +224,7 @@ class TreeViewGenerator
|
|||
Manufacturer::class => $this->translator->trans('manufacturer.labelp'),
|
||||
Supplier::class => $this->translator->trans('supplier.labelp'),
|
||||
Project::class => $this->translator->trans('project.labelp'),
|
||||
Assembly::class => $this->translator->trans('assembly.labelp'),
|
||||
default => $this->translator->trans('tree.root_node.text'),
|
||||
};
|
||||
}
|
||||
|
|
@ -233,6 +239,7 @@ class TreeViewGenerator
|
|||
Manufacturer::class => $icon.'fa-industry',
|
||||
Supplier::class => $icon.'fa-truck',
|
||||
Project::class => $icon.'fa-archive',
|
||||
Assembly::class => $icon.'fa-list',
|
||||
default => null,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue