Skip to content

Commit

Permalink
Corrige le BUG de modification d'un ticket sponsor issue#1512
Browse files Browse the repository at this point in the history
  • Loading branch information
stakovicz committed Jul 3, 2024
1 parent ca075d8 commit 4d2df23
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sources/AppBundle/Controller/TicketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ public function sponsorTicketFormAction(Request $request, $eventSlug)
$ticketForm = $this->createForm(SponsorTicketType::class, $ticket, ['with_transport' => $event->getTransportInformationEnabled()]);
$ticketForm->handleRequest($request);

if ($ticketForm->isSubmitted() && $ticketForm->isValid() && $sponsorTicket->getPendingInvitations() > 0) {
if ($event->getDateEndSalesSponsorToken() < new \DateTime()) {
if ($ticketForm->isSubmitted() && $ticketForm->isValid()) {
// Si c'est l'ajout d'un ticket
// Et qu'il n'y a plus d'invitation
// ou que la date du sponsoring n'est pas passée
if ($ticket->getId() === null && ($sponsorTicket->getPendingInvitations() <= 0 || $event->getDateEndSalesSponsorToken() < new \DateTime())) {
return $this->render(':event/ticket:sold_out.html.twig', ['event' => $event]);
}

Expand Down

0 comments on commit 4d2df23

Please sign in to comment.