mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-19 16:54:25 +00:00
Fix admin entity edit actions for event admin entities and activity reason (category) entities
This commit is contained in:
parent
5ee8a6bc82
commit
7d0fe06651
@ -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.
|
* Lists all ActivityReasonCategory entities.
|
||||||
*/
|
*/
|
||||||
@ -122,7 +100,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
/**
|
/**
|
||||||
* Edits an existing ActivityReasonCategory 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)
|
public function updateAction(Request $request, mixed $id)
|
||||||
{
|
{
|
||||||
$em = $this->managerRegistry->getManager();
|
$em = $this->managerRegistry->getManager();
|
||||||
@ -139,7 +117,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||||
$em->flush();
|
$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', [
|
return $this->render('@ChillActivity/ActivityReasonCategory/edit.html.twig', [
|
||||||
@ -178,7 +156,7 @@ class ActivityReasonCategoryController extends AbstractController
|
|||||||
{
|
{
|
||||||
$form = $this->createForm(ActivityReasonCategoryType::class, $entity, [
|
$form = $this->createForm(ActivityReasonCategoryType::class, $entity, [
|
||||||
'action' => $this->generateUrl('chill_activity_activityreasoncategory_update', ['id' => $entity->getId()]),
|
'action' => $this->generateUrl('chill_activity_activityreasoncategory_update', ['id' => $entity->getId()]),
|
||||||
'method' => 'PUT',
|
'method' => 'POST',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$form->add('submit', SubmitType::class, ['label' => 'Update']);
|
$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.
|
* Lists all ActivityReason entities.
|
||||||
*/
|
*/
|
||||||
@ -180,7 +158,7 @@ class ActivityReasonController extends AbstractController
|
|||||||
{
|
{
|
||||||
$form = $this->createForm(ActivityReasonType::class, $entity, [
|
$form = $this->createForm(ActivityReasonType::class, $entity, [
|
||||||
'action' => $this->generateUrl('chill_activity_activityreason_update', ['id' => $entity->getId()]),
|
'action' => $this->generateUrl('chill_activity_activityreason_update', ['id' => $entity->getId()]),
|
||||||
'method' => 'PUT',
|
'method' => 'POST',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$form->add('submit', SubmitType::class, ['label' => 'Update']);
|
$form->add('submit', SubmitType::class, ['label' => 'Update']);
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<a href="{{ path('chill_activity_activityreasoncategory_show', { 'id': entity.id }) }}" class="btn btn-show" title="{{ 'show'|trans }}"></a>
|
<a href="{{ path('chill_activity_activityreasoncategory_show', { 'id': entity.id }) }}" class="btn btn-show" title="{{ 'show'|trans }}"></a>
|
||||||
</li>
|
</li>
|
||||||
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
|
@ -87,12 +87,10 @@ class EventTypeController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$editForm = $this->createEditForm($entity);
|
$editForm = $this->createEditForm($entity);
|
||||||
$deleteForm = $this->createDeleteForm($id);
|
|
||||||
|
|
||||||
return $this->render('@ChillEvent/EventType/edit.html.twig', [
|
return $this->render('@ChillEvent/EventType/edit.html.twig', [
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
'edit_form' => $editForm->createView(),
|
'edit_form' => $editForm->createView(),
|
||||||
'delete_form' => $deleteForm->createView(),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,7 +226,7 @@ class EventTypeController extends AbstractController
|
|||||||
'chill_eventtype_admin_update',
|
'chill_eventtype_admin_update',
|
||||||
['id' => $entity->getId()]
|
['id' => $entity->getId()]
|
||||||
),
|
),
|
||||||
'method' => 'PUT',
|
'method' => 'POST',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$form->add('submit', SubmitType::class, ['label' => 'Update']);
|
$form->add('submit', SubmitType::class, ['label' => 'Update']);
|
||||||
|
@ -226,7 +226,7 @@ class RoleController extends AbstractController
|
|||||||
'chill_event_admin_role_update',
|
'chill_event_admin_role_update',
|
||||||
['id' => $entity->getId()]
|
['id' => $entity->getId()]
|
||||||
),
|
),
|
||||||
'method' => 'PUT',
|
'method' => 'POST',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$form->add('submit', SubmitType::class, ['label' => 'Update']);
|
$form->add('submit', SubmitType::class, ['label' => 'Update']);
|
||||||
|
@ -222,7 +222,7 @@ class StatusController extends AbstractController
|
|||||||
{
|
{
|
||||||
$form = $this->createForm(StatusType::class, $entity, [
|
$form = $this->createForm(StatusType::class, $entity, [
|
||||||
'action' => $this->generateUrl('chill_event_admin_status_update', ['id' => $entity->getId()]),
|
'action' => $this->generateUrl('chill_event_admin_status_update', ['id' => $entity->getId()]),
|
||||||
'method' => 'PUT',
|
'method' => 'POST',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$form->add('submit', SubmitType::class, ['label' => 'Update']);
|
$form->add('submit', SubmitType::class, ['label' => 'Update']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user