mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 17:28:23 +00:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			testing-20
			...
			fix-admin-
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| f680a35f49 | |||
| 7d0fe06651 | 
							
								
								
									
										6
									
								
								.changes/unreleased/Fixed-20250611-164623.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								.changes/unreleased/Fixed-20250611-164623.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| kind: Fixed | ||||
| body: Fix admin entity edit actions for event admin entities and activity reason (category) entities | ||||
| time: 2025-06-11T16:46:23.113506434+02:00 | ||||
| custom: | ||||
|     Issue: "" | ||||
|     SchemaChange: No schema change | ||||
| @@ -48,28 +48,6 @@ class ActivityReasonCategoryController extends AbstractController | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Displays a form to edit an existing ActivityReasonCategory entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/edit', name: 'chill_activity_activityreasoncategory_edit')] | ||||
|     public function editAction(mixed $id) | ||||
|     { | ||||
|         $em = $this->managerRegistry->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); | ||||
|  | ||||
|         if (!$entity) { | ||||
|             throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); | ||||
|         } | ||||
|  | ||||
|         $editForm = $this->createEditForm($entity); | ||||
|  | ||||
|         return $this->render('@ChillActivity/ActivityReasonCategory/edit.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|             'edit_form' => $editForm->createView(), | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Lists all ActivityReasonCategory entities. | ||||
|      */ | ||||
| @@ -100,29 +78,10 @@ class ActivityReasonCategoryController extends AbstractController | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Finds and displays a ActivityReasonCategory entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/show', name: 'chill_activity_activityreasoncategory_show')] | ||||
|     public function showAction(mixed $id) | ||||
|     { | ||||
|         $em = $this->managerRegistry->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); | ||||
|  | ||||
|         if (!$entity) { | ||||
|             throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); | ||||
|         } | ||||
|  | ||||
|         return $this->render('@ChillActivity/ActivityReasonCategory/show.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Edits an existing ActivityReasonCategory entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/update', name: 'chill_activity_activityreasoncategory_update', methods: ['POST', 'PUT'])] | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreasoncategory/{id}/update', name: 'chill_activity_activityreasoncategory_update')] | ||||
|     public function updateAction(Request $request, mixed $id) | ||||
|     { | ||||
|         $em = $this->managerRegistry->getManager(); | ||||
| @@ -139,7 +98,7 @@ class ActivityReasonCategoryController extends AbstractController | ||||
|         if ($editForm->isSubmitted() && $editForm->isValid()) { | ||||
|             $em->flush(); | ||||
|  | ||||
|             return $this->redirectToRoute('chill_activity_activityreasoncategory_edit', ['id' => $id]); | ||||
|             return $this->redirectToRoute('chill_activity_activityreasoncategory', ['id' => $id]); | ||||
|         } | ||||
|  | ||||
|         return $this->render('@ChillActivity/ActivityReasonCategory/edit.html.twig', [ | ||||
| @@ -178,7 +137,7 @@ class ActivityReasonCategoryController extends AbstractController | ||||
|     { | ||||
|         $form = $this->createForm(ActivityReasonCategoryType::class, $entity, [ | ||||
|             'action' => $this->generateUrl('chill_activity_activityreasoncategory_update', ['id' => $entity->getId()]), | ||||
|             'method' => 'PUT', | ||||
|             'method' => 'POST', | ||||
|         ]); | ||||
|  | ||||
|         $form->add('submit', SubmitType::class, ['label' => 'Update']); | ||||
|   | ||||
| @@ -50,28 +50,6 @@ class ActivityReasonController extends AbstractController | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Displays a form to edit an existing ActivityReason entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/edit', name: 'chill_activity_activityreason_edit')] | ||||
|     public function editAction(mixed $id) | ||||
|     { | ||||
|         $em = $this->managerRegistry->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(ActivityReason::class)->find($id); | ||||
|  | ||||
|         if (null === $entity) { | ||||
|             throw new NotFoundHttpException('Unable to find ActivityReason entity.'); | ||||
|         } | ||||
|  | ||||
|         $editForm = $this->createEditForm($entity); | ||||
|  | ||||
|         return $this->render('@ChillActivity/ActivityReason/edit.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|             'edit_form' => $editForm->createView(), | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Lists all ActivityReason entities. | ||||
|      */ | ||||
| @@ -102,29 +80,10 @@ class ActivityReasonController extends AbstractController | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Finds and displays a ActivityReason entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/show', name: 'chill_activity_activityreason_show')] | ||||
|     public function showAction(mixed $id) | ||||
|     { | ||||
|         $em = $this->managerRegistry->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(ActivityReason::class)->find($id); | ||||
|  | ||||
|         if (!$entity) { | ||||
|             throw $this->createNotFoundException('Unable to find ActivityReason entity.'); | ||||
|         } | ||||
|  | ||||
|         return $this->render('@ChillActivity/ActivityReason/show.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Edits an existing ActivityReason entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/update', name: 'chill_activity_activityreason_update', methods: ['POST', 'PUT'])] | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/activityreason/{id}/update', name: 'chill_activity_activityreason_update')] | ||||
|     public function updateAction(Request $request, mixed $id) | ||||
|     { | ||||
|         $em = $this->managerRegistry->getManager(); | ||||
| @@ -180,7 +139,7 @@ class ActivityReasonController extends AbstractController | ||||
|     { | ||||
|         $form = $this->createForm(ActivityReasonType::class, $entity, [ | ||||
|             'action' => $this->generateUrl('chill_activity_activityreason_update', ['id' => $entity->getId()]), | ||||
|             'method' => 'PUT', | ||||
|             'method' => 'POST', | ||||
|         ]); | ||||
|  | ||||
|         $form->add('submit', SubmitType::class, ['label' => 'Update']); | ||||
|   | ||||
| @@ -3,7 +3,7 @@ | ||||
| {% block admin_content %} | ||||
|     <h1>{{ 'ActivityReason list'|trans }}</h1> | ||||
|  | ||||
|     <table class="records_list"> | ||||
|     <table class="table table-bordered border-dark align-middle"> | ||||
|         <thead> | ||||
|             <tr> | ||||
|                 <th>{{ 'Name'|trans }}</th> | ||||
| @@ -29,10 +29,7 @@ | ||||
|                 <td> | ||||
|                     <ul class="record_actions"> | ||||
|                         <li> | ||||
|                             <a href="{{ path('chill_activity_activityreason_show', { 'id': entity.id }) }}" class="btn btn-show" title="{{ 'show'|trans }}"></a> | ||||
|                         </li> | ||||
|                         <li> | ||||
|                             <a href="{{ path('chill_activity_activityreason_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a> | ||||
|                             <a href="{{ path('chill_activity_activityreason_update', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a> | ||||
|                         </li> | ||||
|                     </ul> | ||||
|                 </td> | ||||
|   | ||||
| @@ -3,7 +3,7 @@ | ||||
| {% block admin_content %} | ||||
|     <h1>{{ 'ActivityReasonCategory list'|trans }}</h1> | ||||
|  | ||||
|     <table class="records_list"> | ||||
|     <table class="table table-bordered border-dark align-middle"> | ||||
|         <thead> | ||||
|             <tr> | ||||
|                 <th>{{ 'Name'|trans }}</th> | ||||
| @@ -23,10 +23,7 @@ | ||||
|                 <td> | ||||
|                     <ul class="record_actions"> | ||||
|                     <li> | ||||
|                         <a href="{{ path('chill_activity_activityreasoncategory_show', { 'id': entity.id }) }}" class="btn btn-show" title="{{ 'show'|trans }}"></a> | ||||
|                     </li> | ||||
|                     <li> | ||||
|                         <a href="{{ path('chill_activity_activityreasoncategory_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a> | ||||
|                         <a href="{{ path('chill_activity_activityreasoncategory_update', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a> | ||||
|                     </li> | ||||
|                 </ul> | ||||
|                 </td> | ||||
|   | ||||
| @@ -48,30 +48,6 @@ class EventTypeController extends AbstractController | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Deletes a EventType entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/event_type/{id}/delete', name: 'chill_eventtype_admin_delete', methods: ['POST', 'DELETE'])] | ||||
|     public function deleteAction(Request $request, mixed $id) | ||||
|     { | ||||
|         $form = $this->createDeleteForm($id); | ||||
|         $form->handleRequest($request); | ||||
|  | ||||
|         if ($form->isSubmitted() && $form->isValid()) { | ||||
|             $em = $this->managerRegistry->getManager(); | ||||
|             $entity = $em->getRepository(EventType::class)->find($id); | ||||
|  | ||||
|             if (!$entity) { | ||||
|                 throw $this->createNotFoundException('Unable to find EventType entity.'); | ||||
|             } | ||||
|  | ||||
|             $em->remove($entity); | ||||
|             $em->flush(); | ||||
|         } | ||||
|  | ||||
|         return $this->redirectToRoute('chill_eventtype_admin'); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Displays a form to edit an existing EventType entity. | ||||
|      */ | ||||
| @@ -87,12 +63,10 @@ class EventTypeController extends AbstractController | ||||
|         } | ||||
|  | ||||
|         $editForm = $this->createEditForm($entity); | ||||
|         $deleteForm = $this->createDeleteForm($id); | ||||
|  | ||||
|         return $this->render('@ChillEvent/EventType/edit.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|             'edit_form' => $editForm->createView(), | ||||
|             'delete_form' => $deleteForm->createView(), | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
| @@ -126,28 +100,6 @@ class EventTypeController extends AbstractController | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Finds and displays a EventType entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/event_type/{id}/show', name: 'chill_eventtype_admin_show')] | ||||
|     public function showAction(mixed $id) | ||||
|     { | ||||
|         $em = $this->managerRegistry->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(EventType::class)->find($id); | ||||
|  | ||||
|         if (!$entity) { | ||||
|             throw $this->createNotFoundException('Unable to find EventType entity.'); | ||||
|         } | ||||
|  | ||||
|         $deleteForm = $this->createDeleteForm($id); | ||||
|  | ||||
|         return $this->render('@ChillEvent/EventType/show.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|             'delete_form' => $deleteForm->createView(), | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Edits an existing EventType entity. | ||||
|      */ | ||||
| @@ -162,7 +114,6 @@ class EventTypeController extends AbstractController | ||||
|             throw $this->createNotFoundException('Unable to find EventType entity.'); | ||||
|         } | ||||
|  | ||||
|         $deleteForm = $this->createDeleteForm($id); | ||||
|         $editForm = $this->createEditForm($entity); | ||||
|         $editForm->handleRequest($request); | ||||
|  | ||||
| @@ -175,7 +126,6 @@ class EventTypeController extends AbstractController | ||||
|         return $this->render('@ChillEvent/EventType/edit.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|             'edit_form' => $editForm->createView(), | ||||
|             'delete_form' => $deleteForm->createView(), | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
| @@ -198,22 +148,6 @@ class EventTypeController extends AbstractController | ||||
|         return $form; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a form to delete a EventType entity by id. | ||||
|      * | ||||
|      * @return \Symfony\Component\Form\FormInterface The form | ||||
|      */ | ||||
|     private function createDeleteForm(mixed $id) | ||||
|     { | ||||
|         return $this->createFormBuilder() | ||||
|             ->setAction($this->generateUrl( | ||||
|                 'chill_eventtype_admin_delete', | ||||
|                 ['id' => $id] | ||||
|             )) | ||||
|             ->add('submit', SubmitType::class, ['label' => 'Delete']) | ||||
|             ->getForm(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a form to edit a EventType entity. | ||||
|      * | ||||
| @@ -228,7 +162,7 @@ class EventTypeController extends AbstractController | ||||
|                 'chill_eventtype_admin_update', | ||||
|                 ['id' => $entity->getId()] | ||||
|             ), | ||||
|             'method' => 'PUT', | ||||
|             'method' => 'POST', | ||||
|         ]); | ||||
|  | ||||
|         $form->add('submit', SubmitType::class, ['label' => 'Update']); | ||||
|   | ||||
| @@ -48,30 +48,6 @@ class RoleController extends AbstractController | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Deletes a Role entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/role/{id}/delete', name: 'chill_event_admin_role_delete', methods: ['POST', 'DELETE'])] | ||||
|     public function deleteAction(Request $request, mixed $id) | ||||
|     { | ||||
|         $form = $this->createDeleteForm($id); | ||||
|         $form->handleRequest($request); | ||||
|  | ||||
|         if ($form->isSubmitted() && $form->isValid()) { | ||||
|             $em = $this->managerRegistry->getManager(); | ||||
|             $entity = $em->getRepository(Role::class)->find($id); | ||||
|  | ||||
|             if (!$entity) { | ||||
|                 throw $this->createNotFoundException('Unable to find Role entity.'); | ||||
|             } | ||||
|  | ||||
|             $em->remove($entity); | ||||
|             $em->flush(); | ||||
|         } | ||||
|  | ||||
|         return $this->redirectToRoute('chill_event_admin_role'); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Displays a form to edit an existing Role entity. | ||||
|      */ | ||||
| @@ -87,12 +63,10 @@ class RoleController extends AbstractController | ||||
|         } | ||||
|  | ||||
|         $editForm = $this->createEditForm($entity); | ||||
|         $deleteForm = $this->createDeleteForm($id); | ||||
|  | ||||
|         return $this->render('@ChillEvent/Role/edit.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|             'edit_form' => $editForm->createView(), | ||||
|             'delete_form' => $deleteForm->createView(), | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
| @@ -126,28 +100,6 @@ class RoleController extends AbstractController | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Finds and displays a Role entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/role/{id}/show', name: 'chill_event_admin_role_show')] | ||||
|     public function showAction(mixed $id) | ||||
|     { | ||||
|         $em = $this->managerRegistry->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(Role::class)->find($id); | ||||
|  | ||||
|         if (!$entity) { | ||||
|             throw $this->createNotFoundException('Unable to find Role entity.'); | ||||
|         } | ||||
|  | ||||
|         $deleteForm = $this->createDeleteForm($id); | ||||
|  | ||||
|         return $this->render('@ChillEvent/Role/show.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|             'delete_form' => $deleteForm->createView(), | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Edits an existing Role entity. | ||||
|      */ | ||||
| @@ -162,7 +114,6 @@ class RoleController extends AbstractController | ||||
|             throw $this->createNotFoundException('Unable to find Role entity.'); | ||||
|         } | ||||
|  | ||||
|         $deleteForm = $this->createDeleteForm($id); | ||||
|         $editForm = $this->createEditForm($entity); | ||||
|         $editForm->handleRequest($request); | ||||
|  | ||||
| @@ -175,7 +126,6 @@ class RoleController extends AbstractController | ||||
|         return $this->render('@ChillEvent/Role/edit.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|             'edit_form' => $editForm->createView(), | ||||
|             'delete_form' => $deleteForm->createView(), | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
| @@ -198,20 +148,6 @@ class RoleController extends AbstractController | ||||
|         return $form; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a form to delete a Role entity by id. | ||||
|      * | ||||
|      * @return \Symfony\Component\Form\FormInterface The form | ||||
|      */ | ||||
|     private function createDeleteForm(mixed $id) | ||||
|     { | ||||
|         return $this->createFormBuilder() | ||||
|             ->setAction($this->generateUrl('chill_event_admin_role_delete', ['id' => $id])) | ||||
|             ->setMethod('DELETE') | ||||
|             ->add('submit', SubmitType::class, ['label' => 'Delete']) | ||||
|             ->getForm(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a form to edit a Role entity. | ||||
|      * | ||||
| @@ -226,7 +162,7 @@ class RoleController extends AbstractController | ||||
|                 'chill_event_admin_role_update', | ||||
|                 ['id' => $entity->getId()] | ||||
|             ), | ||||
|             'method' => 'PUT', | ||||
|             'method' => 'POST', | ||||
|         ]); | ||||
|  | ||||
|         $form->add('submit', SubmitType::class, ['label' => 'Update']); | ||||
|   | ||||
| @@ -48,30 +48,6 @@ class StatusController extends AbstractController | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Deletes a Status entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/status/{id}/delete', name: 'chill_event_admin_status_delete', methods: ['POST', 'DELETE'])] | ||||
|     public function deleteAction(Request $request, mixed $id) | ||||
|     { | ||||
|         $form = $this->createDeleteForm($id); | ||||
|         $form->handleRequest($request); | ||||
|  | ||||
|         if ($form->isSubmitted() && $form->isValid()) { | ||||
|             $em = $this->managerRegistry->getManager(); | ||||
|             $entity = $em->getRepository(Status::class)->find($id); | ||||
|  | ||||
|             if (!$entity) { | ||||
|                 throw $this->createNotFoundException('Unable to find Status entity.'); | ||||
|             } | ||||
|  | ||||
|             $em->remove($entity); | ||||
|             $em->flush(); | ||||
|         } | ||||
|  | ||||
|         return $this->redirectToRoute('chill_event_admin_status'); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Displays a form to edit an existing Status entity. | ||||
|      */ | ||||
| @@ -87,12 +63,10 @@ class StatusController extends AbstractController | ||||
|         } | ||||
|  | ||||
|         $editForm = $this->createEditForm($entity); | ||||
|         $deleteForm = $this->createDeleteForm($id); | ||||
|  | ||||
|         return $this->render('@ChillEvent/Status/edit.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|             'edit_form' => $editForm->createView(), | ||||
|             'delete_form' => $deleteForm->createView(), | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
| @@ -126,28 +100,6 @@ class StatusController extends AbstractController | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Finds and displays a Status entity. | ||||
|      */ | ||||
|     #[\Symfony\Component\Routing\Annotation\Route(path: '/{_locale}/admin/event/status/{id}/show', name: 'chill_event_admin_status_show')] | ||||
|     public function showAction(mixed $id) | ||||
|     { | ||||
|         $em = $this->managerRegistry->getManager(); | ||||
|  | ||||
|         $entity = $em->getRepository(Status::class)->find($id); | ||||
|  | ||||
|         if (!$entity) { | ||||
|             throw $this->createNotFoundException('Unable to find Status entity.'); | ||||
|         } | ||||
|  | ||||
|         $deleteForm = $this->createDeleteForm($id); | ||||
|  | ||||
|         return $this->render('@ChillEvent/Status/show.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|             'delete_form' => $deleteForm->createView(), | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Edits an existing Status entity. | ||||
|      */ | ||||
| @@ -162,7 +114,6 @@ class StatusController extends AbstractController | ||||
|             throw $this->createNotFoundException('Unable to find Status entity.'); | ||||
|         } | ||||
|  | ||||
|         $deleteForm = $this->createDeleteForm($id); | ||||
|         $editForm = $this->createEditForm($entity); | ||||
|         $editForm->handleRequest($request); | ||||
|  | ||||
| @@ -175,7 +126,6 @@ class StatusController extends AbstractController | ||||
|         return $this->render('@ChillEvent/Status/edit.html.twig', [ | ||||
|             'entity' => $entity, | ||||
|             'edit_form' => $editForm->createView(), | ||||
|             'delete_form' => $deleteForm->createView(), | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
| @@ -198,19 +148,6 @@ class StatusController extends AbstractController | ||||
|         return $form; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a form to delete a Status entity by id. | ||||
|      * | ||||
|      * @return \Symfony\Component\Form\FormInterface The form | ||||
|      */ | ||||
|     private function createDeleteForm(mixed $id) | ||||
|     { | ||||
|         return $this->createFormBuilder() | ||||
|             ->setAction($this->generateUrl('chill_event_admin_status_delete', ['id' => $id])) | ||||
|             ->add('submit', SubmitType::class, ['label' => 'Delete']) | ||||
|             ->getForm(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a form to edit a Status entity. | ||||
|      * | ||||
| @@ -222,7 +159,7 @@ class StatusController extends AbstractController | ||||
|     { | ||||
|         $form = $this->createForm(StatusType::class, $entity, [ | ||||
|             'action' => $this->generateUrl('chill_event_admin_status_update', ['id' => $entity->getId()]), | ||||
|             'method' => 'PUT', | ||||
|             'method' => 'POST', | ||||
|         ]); | ||||
|  | ||||
|         $form->add('submit', SubmitType::class, ['label' => 'Update']); | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|     {{ form_row(edit_form.name) }} | ||||
|     {{ form_row(edit_form.active) }} | ||||
|  | ||||
|     <ul class="record_actions"> | ||||
|     <ul class="record_actions sticky-form-buttons"> | ||||
|         <li class="cancel"> | ||||
|             <a href="{{ path('chill_eventtype_admin') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> | ||||
|         </li> | ||||
|   | ||||
| @@ -16,14 +16,11 @@ | ||||
|         <tbody> | ||||
|         {% for entity in entities %} | ||||
|             <tr> | ||||
|                 <td><a href="{{ path('chill_eventtype_admin_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td> | ||||
|                 <td>{{ entity.id }}</a></td> | ||||
|                 <td>{{ entity.name|localize_translatable_string }}</td> | ||||
|                 <td>{{ entity.active }}</td> | ||||
|                 <td><i class="fa {% if entity.active %}fa-check-square-o{% else %}fa-square-o{% endif %}"></i></td> | ||||
|                 <td> | ||||
|                 <ul class="record_actions"> | ||||
|                     <li> | ||||
|                         <a href="{{ path('chill_eventtype_admin_show', { 'id': entity.id }) }}" class="btn btn-show" title="{{ 'show'|trans }}"></a> | ||||
|                     </li> | ||||
|                     <li> | ||||
|                         <a href="{{ path('chill_eventtype_admin_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a> | ||||
|                     </li> | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|     {{ form_row(form.name) }} | ||||
|     {{ form_row(form.active) }} | ||||
|  | ||||
|     <ul class="record_actions"> | ||||
|     <ul class="record_actions sticky-form-buttons"> | ||||
|         <li class="cancel"> | ||||
|             <a href="{{ path('chill_eventtype_admin') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> | ||||
|         </li> | ||||
|   | ||||
| @@ -21,17 +21,12 @@ | ||||
|         </tbody> | ||||
|     </table> | ||||
|  | ||||
|     <ul class="record_actions"> | ||||
|     <ul class="record_actions sticky-form-buttons"> | ||||
|         <li class="cancel"> | ||||
|             <a href="{{ path('chill_eventtype_admin') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> | ||||
|         </li> | ||||
|         <li> | ||||
|             <a href="{{ path('chill_eventtype_admin_edit', { 'id': entity.id }) }}" class="btn btn-edit">{{ 'Edit'|trans }}</a> | ||||
|         </li> | ||||
|         <li> | ||||
|             {{ form_start(delete_form) }} | ||||
|             {{ form_row(delete_form.submit, { 'attr': { 'class' : 'btn btn-delete' }}) }} | ||||
|             {{ form_end(delete_form) }} | ||||
|         </li> | ||||
|     </ul> | ||||
| {% endblock %} | ||||
|   | ||||
| @@ -8,12 +8,12 @@ | ||||
|     {{ form_row(edit_form.type) }} | ||||
|     {{ form_row(edit_form.active) }} | ||||
|  | ||||
|     <ul class="record_actions"> | ||||
|     <ul class="record_actions sticky-form-buttons"> | ||||
|         <li class="cancel"> | ||||
|             <a href="{{ path('chill_event_admin_role') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> | ||||
|         </li> | ||||
|         <li> | ||||
|             {{ form_row(edit_form.submit, { 'attr': { 'class' : 'btn btn-edit' }}) }} | ||||
|             {{ form_row(edit_form.submit, { 'attr': { 'class' : 'btn btn-update' }}) }} | ||||
|         </li> | ||||
|     </ul> | ||||
|  | ||||
|   | ||||
| @@ -17,15 +17,12 @@ | ||||
|         <tbody> | ||||
|         {% for entity in entities %} | ||||
|             <tr> | ||||
|                 <td><a href="{{ path('chill_event_admin_role_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td> | ||||
|                 <td>{{ entity.id }}</a></td> | ||||
|                 <td>{{ entity.name|localize_translatable_string }}</td> | ||||
|                 <td>{{ entity.type.name|localize_translatable_string }}</td> | ||||
|                 <td>{{ entity.active }}</td> | ||||
|                 <td><i class="fa {% if entity.active %}fa-check-square-o{% else %}fa-square-o{% endif %}"></i></td> | ||||
|                 <td> | ||||
|                     <ul class="record_actions"> | ||||
|                         <li> | ||||
|                             <a href="{{ path('chill_event_admin_role_show', { 'id': entity.id }) }}" class="btn btn-show" title="{{ 'show'|trans }}"></a> | ||||
|                         </li> | ||||
|                         <li> | ||||
|                             <a href="{{ path('chill_event_admin_role_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a> | ||||
|                         </li> | ||||
|   | ||||
| @@ -9,7 +9,7 @@ | ||||
|     {{ form_row(form.type) }} | ||||
|     {{ form_row(form.active) }} | ||||
|  | ||||
|     <ul class="record_actions"> | ||||
|     <ul class="record_actions sticky-form-buttons"> | ||||
|         <li class="cancel"> | ||||
|             <a href="{{ path('chill_event_admin_role') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> | ||||
|         </li> | ||||
|   | ||||
| @@ -25,17 +25,12 @@ | ||||
|         </tbody> | ||||
|     </table> | ||||
|  | ||||
|     <ul class="record_actions"> | ||||
|     <ul class="record_actions sticky-form-buttons"> | ||||
|         <li class="cancel"> | ||||
|             <a href="{{ path('chill_event_admin_role') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> | ||||
|         </li> | ||||
|         <li> | ||||
|             <a href="{{ path('chill_event_admin_role_edit', { 'id': entity.id }) }}" class="btn btn-edit">{{ 'Edit'|trans }}</a> | ||||
|         </li> | ||||
|         <li> | ||||
|             {{ form_start(delete_form) }} | ||||
|             {{ form_row(delete_form.submit, { 'attr': { 'class' : 'btn btn-delete' }}) }} | ||||
|             {{ form_end(delete_form) }} | ||||
|         </li> | ||||
|     </ul> | ||||
| {% endblock %} | ||||
|   | ||||
| @@ -9,7 +9,7 @@ | ||||
|     {{ form_row(edit_form.type) }} | ||||
|     {{ form_row(edit_form.active) }} | ||||
|  | ||||
|     <ul class="record_actions"> | ||||
|     <ul class="record_actions sticky-form-buttons"> | ||||
|         <li class="cancel"> | ||||
|             <a href="{{ path('chill_event_admin_status') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> | ||||
|         </li> | ||||
|   | ||||
| @@ -17,15 +17,12 @@ | ||||
|         <tbody> | ||||
|         {% for entity in entities %} | ||||
|             <tr> | ||||
|                 <td><a href="{{ path('chill_event_admin_status_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td> | ||||
|                 <td>{{ entity.id }}</a></td> | ||||
|                 <td>{{ entity.name|localize_translatable_string }}</td> | ||||
|                 <td>{{ entity.type.name|localize_translatable_string }}</td> | ||||
|                 <td>{{ entity.active }}</td> | ||||
|                 <td><i class="fa {% if entity.active %}fa-check-square-o{% else %}fa-square-o{% endif %}"></i></td> | ||||
|                 <td> | ||||
|                 <ul class="record_actions"> | ||||
|                     <li> | ||||
|                         <a href="{{ path('chill_event_admin_status_show', { 'id': entity.id }) }}" class="btn btn-show" title="{{ 'show'|trans }}"></a> | ||||
|                     </li> | ||||
|                     <li> | ||||
|                         <a href="{{ path('chill_event_admin_status_edit', { 'id': entity.id }) }}" class="btn btn-edit" title="{{ 'edit'|trans }}"></a> | ||||
|                     </li> | ||||
|   | ||||
| @@ -9,7 +9,7 @@ | ||||
|     {{ form_row(form.type) }} | ||||
|     {{ form_row(form.active) }} | ||||
|  | ||||
|     <ul class="record_actions"> | ||||
|     <ul class="record_actions sticky-form-buttons"> | ||||
|         <li class="cancel"> | ||||
|             <a href="{{ path('chill_event_admin_status') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> | ||||
|         </li> | ||||
|   | ||||
| @@ -25,17 +25,12 @@ | ||||
|         </tbody> | ||||
|     </table> | ||||
|  | ||||
|     <ul class="record_actions"> | ||||
|     <ul class="record_actions sticky-form-buttons"> | ||||
|         <li class="cancel"> | ||||
|             <a href="{{ path('chill_event_admin_status') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> | ||||
|         </li> | ||||
|         <li> | ||||
|             <a href="{{ path('chill_event_admin_status_edit', { 'id': entity.id }) }}" class="btn btn-edit">{{ 'Edit'|trans }}</a> | ||||
|         </li> | ||||
|         <li> | ||||
|             {{ form_start(delete_form) }} | ||||
|             {{ form_row(delete_form.submit, { 'attr': { 'class' : 'btn btn-delete' }}) }} | ||||
|             {{ form_end(delete_form) }} | ||||
|         </li> | ||||
|     </ul> | ||||
| {% endblock %} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user