diff --git a/config/routes/activity.yaml b/config/routes/activity.yaml
new file mode 100644
index 0000000..e671ae5
--- /dev/null
+++ b/config/routes/activity.yaml
@@ -0,0 +1,3 @@
+activity_activities:
+ path: /activities
+ controller: App\Controller\ActivityController::activities
\ No newline at end of file
diff --git a/config/routes/actor.yaml b/config/routes/actor.yaml
new file mode 100644
index 0000000..eae4f0b
--- /dev/null
+++ b/config/routes/actor.yaml
@@ -0,0 +1,6 @@
+actor_actors:
+ path: /actors
+ controller: App\Controller\ActorController::actors
+actor_actor:
+ path: /actors/edit/{id}
+ controller: App\Controller\ActorController::actor
\ No newline at end of file
diff --git a/config/routes/actors.yaml b/config/routes/actors.yaml
deleted file mode 100644
index 5e166d0..0000000
--- a/config/routes/actors.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-actors_actors:
- path: /actors
- controller: App\Controller\ActorsController::actors
-actors_actor:
- path: /actors/edit/{id}
- controller: App\Controller\ActorsController::actor
\ No newline at end of file
diff --git a/src/Controller/ActivityController.php b/src/Controller/ActivityController.php
new file mode 100644
index 0000000..0a43b01
--- /dev/null
+++ b/src/Controller/ActivityController.php
@@ -0,0 +1,21 @@
+render('activity/activities.html.twig');
+ }
+}
\ No newline at end of file
diff --git a/src/Controller/ActorController.php b/src/Controller/ActorController.php
new file mode 100644
index 0000000..8b63454
--- /dev/null
+++ b/src/Controller/ActorController.php
@@ -0,0 +1,160 @@
+getDoctrine()->getManager();
+ /** @var ActorRepository $actorRepository */
+ $actorRepository = $entityManager->getRepository(ActorEntity::class);
+
+ // Actor add form
+ /** @var ActorAddForm $actorAddFom */
+ $actorAddFom = $this->createNamedCustomForm('actorAdd', ActorAddForm::class);
+ $actorAddFom->handleRequest($request);
+ if ($actorAddFom->isSubmitted() && $actorAddFom->isValid()) {
+ $errors = $actorAddFom->validate();
+ if (empty($errors)) {
+ $actor = $actorAddFom->getActor();
+ $entityManager->persist($actor);
+ $entityManager->flush();
+
+ return $this->ajaxFormAnswer([
+ 'refresh' => true,
+ 'reset' => true,
+ 'message' => 'Acteur ajouté',
+ ]);
+ } else {
+ return $this->ajaxFormAnswer([
+ 'error' => join('
', $errors),
+ 'code' => Response::HTTP_BAD_REQUEST,
+ ]);
+ }
+ }
+
+ // Actor delete form
+ /** @var ActorDeleteForm $actorDeleteForm */
+ $actorDeleteForm = $this->createNamedCustomForm('actorDelete', ActorDeleteForm::class);
+ $actorDeleteForm->handleRequest($request);
+ if ($actorDeleteForm->isSubmitted() && $actorDeleteForm->isValid()) {
+ $errors = $actorDeleteForm->validate();
+ if (empty($errors)) {
+ $actor = $actorDeleteForm->getActor($actorRepository);
+ if (!is_null($actor)) {
+ $entityManager->remove($actor);
+ $entityManager->flush();
+ return $this->ajaxFormAnswer([
+ 'refresh' => true,
+ ]);
+ } else {
+ return $this->ajaxFormAnswer([
+ 'error' => 'Utilisateur non trouvé',
+ 'code' => Response::HTTP_BAD_REQUEST,
+ ]);
+ }
+ } else {
+ return $this->ajaxFormAnswer([
+ 'error' => join('
', $errors),
+ 'code' => Response::HTTP_BAD_REQUEST,
+ ]);
+ }
+ }
+
+ // Get actors
+ $actors = $actorRepository->findAll();
+
+ return $this->render('actor/actors.html.twig', [
+ 'actorAddForm' => $actorAddFom,
+ 'actorDeleteForm' => $actorDeleteForm,
+ 'actors' => $actors,
+ ]);
+ }
+
+ /**
+ * Actor edition page
+ *
+ * @param Request $request
+ * @param string $id
+ * @return Response
+ */
+ public function actor(Request $request, string $id): Response
+ {
+ // Get repositories
+ $entityManager = $this->getDoctrine()->getManager();
+ /** @var ActorRepository $actorRepository */
+ $actorRepository = $entityManager->getRepository(ActorEntity::class);
+
+ // Get actor
+ $actor = $actorRepository->find($id);
+
+ // Actor edit form
+ /** @var ActorEditForm $actorEditForm */
+ $actorEditForm = $this->createNamedCustomForm('edit', ActorEditForm::class);
+ $actorEditForm->handleRequest($request);
+ if ($actorEditForm->isSubmitted() && $actorEditForm->isValid()) {
+ $errors = $actorEditForm->validate();
+ if (empty($errors)) {
+ $actorEditForm->updateActor($actor);
+ $entityManager->persist($actor);
+ $entityManager->flush();
+ return $this->ajaxFormAnswer([
+ 'message' => 'Modification enregistrées',
+ 'refresh' => true,
+ ]);
+ } else {
+ return $this->ajaxFormAnswer([
+ 'error' => join('
', $errors),
+ 'code' => Response::HTTP_BAD_REQUEST,
+ ]);
+ }
+ }
+
+ // Actor delete form
+ /** @var ActorDeleteForm $actorDeleteForm */
+ $actorDeleteForm = $this->createNamedCustomForm('delete', ActorDeleteForm::class);
+ $actorDeleteForm->handleRequest($request);
+ if ($actorDeleteForm->isSubmitted() && $actorDeleteForm->isValid()) {
+ $errors = $actorDeleteForm->validate();
+ if (empty($errors)) {
+ $entityManager->remove($actor);
+ $entityManager->flush();
+ return $this->ajaxFormAnswer([
+ 'redirect' => $this->generateUrl('actors_actors', [], UrlGenerator::ABSOLUTE_PATH),
+ ]);
+ } else {
+ return $this->ajaxFormAnswer([
+ 'error' => join('
', $errors),
+ 'code' => Response::HTTP_BAD_REQUEST,
+ ]);
+ }
+ }
+
+ // Update fields
+ $actorEditForm->updateFields($actor);
+
+ return $this->render('actor/actor.html.twig', [
+ 'actor' => $actor,
+ 'editForm' => $actorEditForm,
+ 'deleteForm' => $actorDeleteForm,
+ ]);
+ }
+}
+
diff --git a/src/Controller/ActorsController.php b/src/Controller/ActorsController.php
deleted file mode 100644
index 8695895..0000000
--- a/src/Controller/ActorsController.php
+++ /dev/null
@@ -1,160 +0,0 @@
-getDoctrine()->getManager();
- /** @var ActorRepository $actorRepository */
- $actorRepository = $entityManager->getRepository(ActorEntity::class);
-
- // Actor add form
- /** @var ActorAddForm $actorAddFom */
- $actorAddFom = $this->createNamedCustomForm('actorAdd', ActorAddForm::class);
- $actorAddFom->handleRequest($request);
- if ($actorAddFom->isSubmitted() && $actorAddFom->isValid()) {
- $errors = $actorAddFom->validate();
- if (empty($errors)) {
- $actor = $actorAddFom->getActor();
- $entityManager->persist($actor);
- $entityManager->flush();
-
- return $this->ajaxFormAnswer([
- 'refresh' => true,
- 'reset' => true,
- 'message' => 'Acteur ajouté',
- ]);
- } else {
- return $this->ajaxFormAnswer([
- 'error' => join('
', $errors),
- 'code' => Response::HTTP_BAD_REQUEST,
- ]);
- }
- }
-
- // Actor delete form
- /** @var ActorDeleteForm $actorDeleteForm */
- $actorDeleteForm = $this->createNamedCustomForm('actorDelete', ActorDeleteForm::class);
- $actorDeleteForm->handleRequest($request);
- if ($actorDeleteForm->isSubmitted() && $actorDeleteForm->isValid()) {
- $errors = $actorDeleteForm->validate();
- if (empty($errors)) {
- $actor = $actorDeleteForm->getActor($actorRepository);
- if (!is_null($actor)) {
- $entityManager->remove($actor);
- $entityManager->flush();
- return $this->ajaxFormAnswer([
- 'refresh' => true,
- ]);
- } else {
- return $this->ajaxFormAnswer([
- 'error' => 'Utilisateur non trouvé',
- 'code' => Response::HTTP_BAD_REQUEST,
- ]);
- }
- } else {
- return $this->ajaxFormAnswer([
- 'error' => join('
', $errors),
- 'code' => Response::HTTP_BAD_REQUEST,
- ]);
- }
- }
-
- // Get actors
- $actors = $actorRepository->findAll();
-
- return $this->render('actors/actors.html.twig', [
- 'actorAddForm' => $actorAddFom,
- 'actorDeleteForm' => $actorDeleteForm,
- 'actors' => $actors,
- ]);
- }
-
- /**
- * Actor edition page
- *
- * @param Request $request
- * @param string $id
- * @return Response
- */
- public function actor(Request $request, string $id): Response
- {
- // Get repositories
- $entityManager = $this->getDoctrine()->getManager();
- /** @var ActorRepository $actorRepository */
- $actorRepository = $entityManager->getRepository(ActorEntity::class);
-
- // Get actor
- $actor = $actorRepository->find($id);
-
- // Actor edit form
- /** @var ActorEditForm $actorEditForm */
- $actorEditForm = $this->createNamedCustomForm('edit', ActorEditForm::class);
- $actorEditForm->handleRequest($request);
- if ($actorEditForm->isSubmitted() && $actorEditForm->isValid()) {
- $errors = $actorEditForm->validate();
- if (empty($errors)) {
- $actorEditForm->updateActor($actor);
- $entityManager->persist($actor);
- $entityManager->flush();
- return $this->ajaxFormAnswer([
- 'message' => 'Modification enregistrées',
- 'refresh' => true,
- ]);
- } else {
- return $this->ajaxFormAnswer([
- 'error' => join('
', $errors),
- 'code' => Response::HTTP_BAD_REQUEST,
- ]);
- }
- }
-
- // Actor delete form
- /** @var ActorDeleteForm $actorDeleteForm */
- $actorDeleteForm = $this->createNamedCustomForm('delete', ActorDeleteForm::class);
- $actorDeleteForm->handleRequest($request);
- if ($actorDeleteForm->isSubmitted() && $actorDeleteForm->isValid()) {
- $errors = $actorDeleteForm->validate();
- if (empty($errors)) {
- $entityManager->remove($actor);
- $entityManager->flush();
- return $this->ajaxFormAnswer([
- 'redirect' => $this->generateUrl('actors_actors', [], UrlGenerator::ABSOLUTE_PATH),
- ]);
- } else {
- return $this->ajaxFormAnswer([
- 'error' => join('
', $errors),
- 'code' => Response::HTTP_BAD_REQUEST,
- ]);
- }
- }
-
- // Update fields
- $actorEditForm->updateFields($actor);
-
- return $this->render('actors/actor.html.twig', [
- 'actor' => $actor,
- 'editForm' => $actorEditForm,
- 'deleteForm' => $actorDeleteForm,
- ]);
- }
-}
-
diff --git a/templates/_includes/html/arrays/activity.html.twig b/templates/_includes/html/arrays/activity.html.twig
new file mode 100644
index 0000000..7f016ad
--- /dev/null
+++ b/templates/_includes/html/arrays/activity.html.twig
@@ -0,0 +1,14 @@
+
Nom | +Status | +Acteur | +Début planifié | +Début réél | +Fin planifiée | +Fin rééle | +Actions | +