Renamed device_* routes to project_* routes

This commit is contained in:
Jan Böhmer 2023-01-08 23:07:25 +01:00
parent 1a3253b31a
commit 7b536fc4ad
5 changed files with 16 additions and 16 deletions

View file

@ -37,19 +37,19 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
/** /**
* @Route("/device") * @Route("/project")
*/ */
class ProjectAdminController extends BaseAdminController class ProjectAdminController extends BaseAdminController
{ {
protected $entity_class = Project::class; protected $entity_class = Project::class;
protected $twig_template = 'AdminPages/DeviceAdmin.html.twig'; protected $twig_template = 'AdminPages/ProjectAdmin.html.twig';
protected $form_class = ProjectAdminForm::class; protected $form_class = ProjectAdminForm::class;
protected $route_base = 'device'; protected $route_base = 'project';
protected $attachment_class = ProjectAttachment::class; protected $attachment_class = ProjectAttachment::class;
protected $parameter_class = ProjectParameter::class; protected $parameter_class = ProjectParameter::class;
/** /**
* @Route("/{id}", name="device_delete", methods={"DELETE"}) * @Route("/{id}", name="project_delete", methods={"DELETE"})
*/ */
public function delete(Request $request, Project $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse public function delete(Request $request, Project $entity, StructuralElementRecursionHelper $recursionHelper): RedirectResponse
{ {
@ -57,8 +57,8 @@ class ProjectAdminController extends BaseAdminController
} }
/** /**
* @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="device_edit") * @Route("/{id}/edit/{timestamp}", requirements={"id"="\d+"}, name="project_edit")
* @Route("/{id}", requirements={"id"="\d+"}) * @Route("/{id}/edit", requirements={"id"="\d+"})
*/ */
public function edit(Project $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response public function edit(Project $entity, Request $request, EntityManagerInterface $em, ?string $timestamp = null): Response
{ {
@ -66,7 +66,7 @@ class ProjectAdminController extends BaseAdminController
} }
/** /**
* @Route("/new", name="device_new") * @Route("/new", name="project_new")
* @Route("/{id}/clone", name="device_clone") * @Route("/{id}/clone", name="device_clone")
* @Route("/") * @Route("/")
*/ */
@ -76,7 +76,7 @@ class ProjectAdminController extends BaseAdminController
} }
/** /**
* @Route("/export", name="device_export_all") * @Route("/export", name="project_export_all")
*/ */
public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response public function exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request): Response
{ {
@ -84,7 +84,7 @@ class ProjectAdminController extends BaseAdminController
} }
/** /**
* @Route("/{id}/export", name="device_export") * @Route("/{id}/export", name="project_export")
*/ */
public function exportEntity(Project $entity, EntityExporter $exporter, Request $request): Response public function exportEntity(Project $entity, EntityExporter $exporter, Request $request): Response
{ {

View file

@ -50,7 +50,7 @@ class ProjectController extends AbstractController
} }
/** /**
* @Route("/{id}", name="project_info", requirements={"id"="\d+"}) * @Route("/{id}/info", name="project_info", requirements={"id"="\d+"})
*/ */
public function info(Project $project, Request $request) public function info(Project $project, Request $request)
{ {

View file

@ -113,7 +113,7 @@ class EntityURLGenerator
//As long we does not have own things for it use edit page //As long we does not have own things for it use edit page
AttachmentType::class => 'attachment_type_edit', AttachmentType::class => 'attachment_type_edit',
Category::class => 'category_edit', Category::class => 'category_edit',
Project::class => 'device_edit', Project::class => 'project_edit',
Supplier::class => 'supplier_edit', Supplier::class => 'supplier_edit',
Manufacturer::class => 'manufacturer_edit', Manufacturer::class => 'manufacturer_edit',
Storelocation::class => 'store_location_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 //As long we does not have own things for it use edit page
AttachmentType::class => 'attachment_type_edit', AttachmentType::class => 'attachment_type_edit',
Category::class => 'category_edit', Category::class => 'category_edit',
Project::class => 'device_edit', Project::class => 'project_info',
Supplier::class => 'supplier_edit', Supplier::class => 'supplier_edit',
Manufacturer::class => 'manufacturer_edit', Manufacturer::class => 'manufacturer_edit',
Storelocation::class => 'store_location_edit', Storelocation::class => 'store_location_edit',
@ -234,7 +234,7 @@ class EntityURLGenerator
Part::class => 'part_edit', Part::class => 'part_edit',
AttachmentType::class => 'attachment_type_edit', AttachmentType::class => 'attachment_type_edit',
Category::class => 'category_edit', Category::class => 'category_edit',
Project::class => 'device_edit', Project::class => 'project_edit',
Supplier::class => 'supplier_edit', Supplier::class => 'supplier_edit',
Manufacturer::class => 'manufacturer_edit', Manufacturer::class => 'manufacturer_edit',
Storelocation::class => 'store_location_edit', Storelocation::class => 'store_location_edit',
@ -264,7 +264,7 @@ class EntityURLGenerator
Part::class => 'part_new', Part::class => 'part_new',
AttachmentType::class => 'attachment_type_new', AttachmentType::class => 'attachment_type_new',
Category::class => 'category_new', Category::class => 'category_new',
Project::class => 'device_new', Project::class => 'project_new',
Supplier::class => 'supplier_new', Supplier::class => 'supplier_new',
Manufacturer::class => 'manufacturer_new', Manufacturer::class => 'manufacturer_new',
Storelocation::class => 'store_location_new', Storelocation::class => 'store_location_new',
@ -340,7 +340,7 @@ class EntityURLGenerator
Part::class => 'part_delete', Part::class => 'part_delete',
AttachmentType::class => 'attachment_type_delete', AttachmentType::class => 'attachment_type_delete',
Category::class => 'category_delete', Category::class => 'category_delete',
Project::class => 'device_delete', Project::class => 'project_delete',
Supplier::class => 'supplier_delete', Supplier::class => 'supplier_delete',
Manufacturer::class => 'manufacturer_delete', Manufacturer::class => 'manufacturer_delete',
Storelocation::class => 'store_location_delete', Storelocation::class => 'store_location_delete',

View file

@ -159,7 +159,7 @@ class ToolsTreeBuilder
if ($this->security->isGranted('read', new Project())) { if ($this->security->isGranted('read', new Project())) {
$nodes[] = (new TreeViewNode( $nodes[] = (new TreeViewNode(
$this->translator->trans('tree.tools.edit.projects'), $this->translator->trans('tree.tools.edit.projects'),
$this->urlGenerator->generate('device_new') $this->urlGenerator->generate('project_new')
))->setIcon('fa-fw fa-treeview fa-solid fa-archive'); ))->setIcon('fa-fw fa-treeview fa-solid fa-archive');
} }
if ($this->security->isGranted('read', new Supplier())) { if ($this->security->isGranted('read', new Supplier())) {