Skip to content

Commit

Permalink
Merge pull request afup#1513 from stakovicz/fix-modificaiton-ticket-s…
Browse files Browse the repository at this point in the history
…ponsor

Corrige le BUG de modification d'un ticket sponsor issue#1512
  • Loading branch information
stakovicz authored Jul 7, 2024
2 parents 3dafb5a + 4ddc108 commit 1fec830
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 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 1fec830

Please sign in to comment.