/**
  * @Route("/accept/{id}",
  *      name="oro_calendar_event_accepted",
  *      requirements={"id"="\d+"}, defaults={"status"="accepted"})
  * @Route("/tentatively/{id}",
  *      name="oro_calendar_event_tentatively_accepted",
  *      requirements={"id"="\d+"}, defaults={"status"="tentatively_accepted"})
  * @Route("/decline/{id}",
  *      name="oro_calendar_event_declined",
  *      requirements={"id"="\d+"}, defaults={"status"="declined"})
  * @param CalendarEvent $entity
  * @param string $status
  * @return JsonResponse
  */
 public function changeStatus(CalendarEvent $entity, $status)
 {
     $em = $this->getDoctrine()->getManager();
     $entity->setInvitationStatus($status);
     $em->flush($entity);
     $this->get('oro_calendar.send_processor.email')->sendRespondNotification($entity);
     return new JsonResponse(['successful' => true]);
 }
Example #2
0
 /**
  * @param $status
  * @param $expected
  *
  * @dataProvider getAvailableDataProvider
  */
 public function testGetAvailableInvitationStatuses($status, $expected)
 {
     $event = new CalendarEvent();
     $event->setInvitationStatus($status);
     $actual = $event->getAvailableInvitationStatuses();
     $this->assertEmpty(array_diff($expected, $actual));
 }
Example #3
0
 /**
  * @param CalendarEvent $calendarEvent
  * @param string        $status
  */
 protected function setDefaultEventStatus(CalendarEvent $calendarEvent, $status = CalendarEvent::NOT_RESPONDED)
 {
     if (!$calendarEvent->getInvitationStatus()) {
         $calendarEvent->setInvitationStatus($status);
     }
 }