Пример #1
0
 /**
  * ActivityToEvent
  *
  * @param Activity $activity
  * @return array
  */
 public function ActivityToEvent(Activity $activity)
 {
     $event = array('id' => $activity->getId(), 'title' => $activity->getAccount()->getName(), 'activity_author' => $activity->getUser() == $this->userManager->getCurrent() ? 0 : $activity->getUser()->getFirstname() . ' ' . $activity->getUser()->getName(), 'activity_agency' => $activity->getUser()->getAgency()->getName(), 'activity_replanned' => $activity->getReplanned() ? $activity->getReplanned()->getDateStart()->format('d-m-Y à H:i') : 0, 'activity_type' => $this->translator->trans('enigmatic.crm.activity_type.field.type.' . $activity->getType()->getType()), 'activity_type_name' => $activity->getType()->getTitle(), 'description' => $activity->getComment(), 'start' => $activity->getDateStart()->format('c'), 'end' => $activity->getDateStart() == $activity->getDateEnd() ? $activity->getDateEnd()->modify('+15 mins')->format('c') : $activity->getDateEnd()->format('c'), 'editable' => $activity->getReplanned() ? false : ($this->authorizationChecker->isGranted('ROLE_RCA') ? true : ($activity->getUser() == $this->userManager->getCurrent() ? true : false)), 'color' => $this->getColor($activity, $activity->getReplanned(), $activity->getType()->getType()));
     return $event;
 }