Set the sms status to 'canceled'

This commit is contained in:
Julie Lenaerts 2024-12-18 13:48:56 +01:00
parent 33edb22b50
commit d87523beb7
2 changed files with 1 additions and 2 deletions

View File

@ -119,11 +119,9 @@ class CalendarController extends AbstractController
public function cancelAction(Calendar $calendar, Request $request): Response public function cancelAction(Calendar $calendar, Request $request): Response
{ {
// Add voter
// Deal with sms being sent or not // Deal with sms being sent or not
// Communicate cancellation with the remote calendar. // Communicate cancellation with the remote calendar.
$this->denyAccessUnlessGranted(CalendarVoter::EDIT, $calendar); $this->denyAccessUnlessGranted(CalendarVoter::EDIT, $calendar);
[$person, $accompanyingPeriod] = [$calendar->getPerson(), $calendar->getAccompanyingPeriod()]; [$person, $accompanyingPeriod] = [$calendar->getPerson(), $calendar->getAccompanyingPeriod()];
@ -146,6 +144,7 @@ class CalendarController extends AbstractController
if ($form->isSubmitted() && $form->isValid()) { if ($form->isSubmitted() && $form->isValid()) {
$calendar->setStatus($calendar::STATUS_CANCELED); $calendar->setStatus($calendar::STATUS_CANCELED);
$calendar->setSmsStatus($calendar::SMS_CANCEL_PENDING);
$this->em->flush(); $this->em->flush();
$this->addFlash('success', $this->translator->trans('chill_calendar.calendar_canceled')); $this->addFlash('success', $this->translator->trans('chill_calendar.calendar_canceled'));