Added label profile edit and scanner dialog to tools menu.

This commit is contained in:
Jan Böhmer 2020-04-29 22:07:17 +02:00
parent 99fc7562b7
commit f16dec51b6

View file

@ -45,6 +45,7 @@ namespace App\Services\Trees;
use App\Entity\Attachments\AttachmentType; use App\Entity\Attachments\AttachmentType;
use App\Entity\Attachments\PartAttachment; use App\Entity\Attachments\PartAttachment;
use App\Entity\Devices\Device; use App\Entity\Devices\Device;
use App\Entity\LabelSystem\LabelProfile;
use App\Entity\Parts\Category; use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint; use App\Entity\Parts\Footprint;
use App\Entity\Parts\Manufacturer; use App\Entity\Parts\Manufacturer;
@ -122,6 +123,11 @@ class ToolsTreeBuilder
$this->urlGenerator->generate('label_dialog') $this->urlGenerator->generate('label_dialog')
); );
$nodes[] = new TreeViewNode(
$this->translator->trans('tree.tools.tools.label_scanner'),
$this->urlGenerator->generate('scan_dialog')
);
return $nodes; return $nodes;
} }
@ -188,6 +194,12 @@ class ToolsTreeBuilder
$this->urlGenerator->generate('measurement_unit_new') $this->urlGenerator->generate('measurement_unit_new')
); );
} }
if ($this->security->isGranted('create', new LabelProfile())) {
$nodes[] = new TreeViewNode(
$this->translator->trans('tree.tools.edit.label_profile'),
$this->urlGenerator->generate('label_profile_new')
);
}
if ($this->security->isGranted('create', new Part())) { if ($this->security->isGranted('create', new Part())) {
$nodes[] = new TreeViewNode( $nodes[] = new TreeViewNode(
$this->translator->trans('tree.tools.edit.part'), $this->translator->trans('tree.tools.edit.part'),
@ -195,6 +207,7 @@ class ToolsTreeBuilder
); );
} }
return $nodes; return $nodes;
} }