Add view order button in stats, resend invitation button
- Stats tab: "Voir" button on each order linking to public order page - Invitations tab: "Renvoyer" button to resend invitation email - New route app_account_event_resend_invitation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -773,6 +773,29 @@ class AccountController extends AbstractController
|
||||
return $this->redirectToRoute('app_account_edit_event', ['id' => $event->getId(), 'tab' => 'invitations']);
|
||||
}
|
||||
|
||||
#[Route('/mon-compte/evenement/{id}/invitation/{orderId}/renvoyer', name: 'app_account_event_resend_invitation', methods: ['POST'])]
|
||||
public function resendInvitation(Event $event, int $orderId, EntityManagerInterface $em, BilletOrderService $billetOrderService): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ORGANIZER');
|
||||
|
||||
/** @var User $user */
|
||||
$user = $this->getUser();
|
||||
if ($event->getAccount()->getId() !== $user->getId()) {
|
||||
throw $this->createAccessDeniedException();
|
||||
}
|
||||
|
||||
$order = $em->getRepository(BilletBuyer::class)->find($orderId);
|
||||
if (!$order || $order->getEvent()->getId() !== $event->getId()) {
|
||||
throw $this->createNotFoundException();
|
||||
}
|
||||
|
||||
$billetOrderService->generateAndSendTickets($order);
|
||||
|
||||
$this->addFlash('success', 'Invitation renvoyee a '.$order->getEmail().'.');
|
||||
|
||||
return $this->redirectToRoute('app_account_edit_event', ['id' => $event->getId(), 'tab' => 'invitations']);
|
||||
}
|
||||
|
||||
#[Route('/mon-compte/evenement/{id}/commande/{orderId}/annuler', name: 'app_account_event_cancel_order', methods: ['POST'])]
|
||||
public function cancelOrder(Event $event, int $orderId, EntityManagerInterface $em): Response
|
||||
{
|
||||
|
||||
@@ -451,6 +451,9 @@
|
||||
{% else %}
|
||||
<span class="badge-yellow text-[10px] font-black uppercase">{{ order.status }}</span>
|
||||
{% endif %}
|
||||
<form method="post" action="{{ path('app_account_event_resend_invitation', {id: event.id, orderId: order.id}) }}">
|
||||
<button type="submit" class="px-3 py-1 border-2 border-gray-900 bg-white text-xs font-black uppercase cursor-pointer hover:bg-indigo-600 hover:text-white transition-all">Renvoyer</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -525,16 +528,17 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if order.status == 'paid' %}
|
||||
<div class="flex gap-2 mt-2">
|
||||
<a href="{{ path('app_order_public', {orderNumber: order.orderNumber, token: order.accessToken}) }}" class="px-3 py-1 border-2 border-gray-900 bg-white text-xs font-black uppercase hover:bg-gray-100 transition-all" target="_blank">Voir</a>
|
||||
{% if order.status == 'paid' %}
|
||||
<form method="post" action="{{ path('app_account_event_cancel_order', {id: event.id, orderId: order.id}) }}" data-confirm="Annuler cette commande ? Les billets seront invalides.">
|
||||
<button type="submit" class="px-3 py-1 border-2 border-red-800 bg-red-600 text-white text-xs font-black uppercase cursor-pointer hover:bg-red-800 transition-all">Annuler</button>
|
||||
</form>
|
||||
<form method="post" action="{{ path('app_account_event_refund_order', {id: event.id, orderId: order.id}) }}" data-confirm="Rembourser cette commande ? Le montant sera restitue au client.">
|
||||
<button type="submit" class="px-3 py-1 border-2 border-gray-900 bg-[#fabf04] text-xs font-black uppercase cursor-pointer hover:bg-yellow-500 transition-all">Rembourser</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user