Added some basic DB fields for the new project system

This commit is contained in:
Jan Böhmer 2022-12-18 20:34:25 +01:00
parent 8ae4e9fe05
commit 0c7ec9f0c7
36 changed files with 281 additions and 130 deletions

View file

@ -28,7 +28,7 @@ use App\Entity\Attachments\AttachmentType;
use App\Entity\Attachments\AttachmentTypeAttachment;
use App\Entity\Attachments\CategoryAttachment;
use App\Entity\Attachments\CurrencyAttachment;
use App\Entity\Attachments\DeviceAttachment;
use App\Entity\Attachments\ProjectAttachment;
use App\Entity\Attachments\FootprintAttachment;
use App\Entity\Attachments\GroupAttachment;
use App\Entity\Attachments\ManufacturerAttachment;
@ -82,7 +82,7 @@ class AttachmentSubmitHandler
AttachmentTypeAttachment::class => 'attachment_type',
CategoryAttachment::class => 'category',
CurrencyAttachment::class => 'currency',
DeviceAttachment::class => 'device',
ProjectAttachment::class => 'device',
FootprintAttachment::class => 'footprint',
GroupAttachment::class => 'group',
ManufacturerAttachment::class => 'manufacturer',

View file

@ -25,7 +25,7 @@ namespace App\Services;
use App\Entity\Attachments\Attachment;
use App\Entity\Attachments\AttachmentType;
use App\Entity\Contracts\NamedElementInterface;
use App\Entity\Devices\Device;
use App\Entity\ProjectSystem\Project;
use App\Entity\LabelSystem\LabelProfile;
use App\Entity\Parameters\AbstractParameter;
use App\Entity\Parts\Category;
@ -59,7 +59,7 @@ class ElementTypeNameGenerator
Attachment::class => $this->translator->trans('attachment.label'),
Category::class => $this->translator->trans('category.label'),
AttachmentType::class => $this->translator->trans('attachment_type.label'),
Device::class => $this->translator->trans('device.label'),
Project::class => $this->translator->trans('device.label'),
Footprint::class => $this->translator->trans('footprint.label'),
Manufacturer::class => $this->translator->trans('manufacturer.label'),
MeasurementUnit::class => $this->translator->trans('measurement_unit.label'),

View file

@ -26,7 +26,7 @@ use App\Entity\Attachments\Attachment;
use App\Entity\Attachments\AttachmentType;
use App\Entity\Attachments\PartAttachment;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Devices\Device;
use App\Entity\ProjectSystem\Project;
use App\Entity\LabelSystem\LabelProfile;
use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint;
@ -113,7 +113,7 @@ class EntityURLGenerator
//As long we does not have own things for it use edit page
AttachmentType::class => 'attachment_type_edit',
Category::class => 'category_edit',
Device::class => 'device_edit',
Project::class => 'device_edit',
Supplier::class => 'supplier_edit',
Manufacturer::class => 'manufacturer_edit',
Storelocation::class => 'store_location_edit',
@ -204,7 +204,7 @@ class EntityURLGenerator
//As long we does not have own things for it use edit page
AttachmentType::class => 'attachment_type_edit',
Category::class => 'category_edit',
Device::class => 'device_edit',
Project::class => 'device_edit',
Supplier::class => 'supplier_edit',
Manufacturer::class => 'manufacturer_edit',
Storelocation::class => 'store_location_edit',
@ -234,7 +234,7 @@ class EntityURLGenerator
Part::class => 'part_edit',
AttachmentType::class => 'attachment_type_edit',
Category::class => 'category_edit',
Device::class => 'device_edit',
Project::class => 'device_edit',
Supplier::class => 'supplier_edit',
Manufacturer::class => 'manufacturer_edit',
Storelocation::class => 'store_location_edit',
@ -264,7 +264,7 @@ class EntityURLGenerator
Part::class => 'part_new',
AttachmentType::class => 'attachment_type_new',
Category::class => 'category_new',
Device::class => 'device_new',
Project::class => 'device_new',
Supplier::class => 'supplier_new',
Manufacturer::class => 'manufacturer_new',
Storelocation::class => 'store_location_new',
@ -295,7 +295,7 @@ class EntityURLGenerator
Part::class => 'part_clone',
AttachmentType::class => 'attachment_type_clone',
Category::class => 'category_clone',
Device::class => 'device_clone',
Project::class => 'device_clone',
Supplier::class => 'supplier_clone',
Manufacturer::class => 'manufacturer_clone',
Storelocation::class => 'store_location_clone',
@ -338,7 +338,7 @@ class EntityURLGenerator
Part::class => 'part_delete',
AttachmentType::class => 'attachment_type_delete',
Category::class => 'category_delete',
Device::class => 'device_delete',
Project::class => 'device_delete',
Supplier::class => 'supplier_delete',
Manufacturer::class => 'manufacturer_delete',
Storelocation::class => 'store_location_delete',

View file

@ -43,7 +43,7 @@ namespace App\Services\Tools;
use App\Entity\Attachments\Attachment;
use App\Entity\Attachments\AttachmentType;
use App\Entity\Devices\Device;
use App\Entity\ProjectSystem\Project;
use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint;
use App\Entity\Parts\Manufacturer;
@ -111,7 +111,7 @@ class StatisticsHelper
$arr = [
'attachment_type' => AttachmentType::class,
'category' => Category::class,
'device' => Device::class,
'device' => Project::class,
'footprint' => Footprint::class,
'manufacturer' => Manufacturer::class,
'measurement_unit' => MeasurementUnit::class,

View file

@ -24,7 +24,7 @@ namespace App\Services\Trees;
use App\Entity\Attachments\AttachmentType;
use App\Entity\Attachments\PartAttachment;
use App\Entity\Devices\Device;
use App\Entity\ProjectSystem\Project;
use App\Entity\LabelSystem\LabelProfile;
use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint;
@ -156,7 +156,7 @@ class ToolsTreeBuilder
$this->urlGenerator->generate('category_new')
))->setIcon('fa-fw fa-treeview fa-solid fa-tags');
}
if ($this->security->isGranted('read', new Device())) {
if ($this->security->isGranted('read', new Project())) {
$nodes[] = (new TreeViewNode(
$this->translator->trans('tree.tools.edit.devices'),
$this->urlGenerator->generate('device_new')

View file

@ -25,7 +25,7 @@ namespace App\Services\Trees;
use App\Entity\Base\AbstractDBElement;
use App\Entity\Base\AbstractNamedDBElement;
use App\Entity\Base\AbstractStructuralDBElement;
use App\Entity\Devices\Device;
use App\Entity\ProjectSystem\Project;
use App\Entity\Parts\Category;
use App\Entity\Parts\Footprint;
use App\Entity\Parts\Manufacturer;
@ -161,7 +161,7 @@ class TreeViewGenerator
return $this->translator->trans('manufacturer.labelp');
case Supplier::class:
return $this->translator->trans('supplier.labelp');
case Device::class:
case Project::class:
return $this->translator->trans('device.labelp');
default:
return $this->translator->trans('tree.root_node.text');
@ -182,7 +182,7 @@ class TreeViewGenerator
return $icon . 'fa-industry';
case Supplier::class:
return $icon . 'fa-truck';
case Device::class:
case Project::class:
return $icon . 'fa-archive';
default:
return null;