Example #1
0
 private static function handleTool(Event &$event, EntityManager $doctrineManager)
 {
     $toolName = $event->getType();
     $tool = $doctrineManager->getRepository('BauerIncidentDashboardCoreBundle:Tool')->findOneBy(array('project' => $event->getEventIdentifier()->getProject(), 'identifier' => $toolName));
     if (is_null($tool)) {
         $tool = new Tool();
         $tool->setProject($event->getEventIdentifier()->getProject());
         $tool->setIdentifier($toolName);
         $tool->setActive(false);
         $doctrineManager->persist($tool);
         $doctrineManager->flush();
     }
     $event->getEventIdentifier()->setTool($tool);
 }
 public function closeAction(Event $event)
 {
     $this->assertUserRights(UserRole::ROLE_COLLABORATOR);
     $closeEvent = new Event();
     $closeEvent->setEventIdentifier($event->getEventIdentifier());
     $closeEvent->setSystem($event->getSystem());
     $closeEvent->setStatus(Event::STATUS_SUCCESS);
     $closeEvent->setIsStatusChange(true);
     $closeEvent->setUnique($event->isUnique());
     $closeEvent->setType($event->getType());
     $closeEvent->setMessage('Manually closed by ' . $this->getUser()->getUsername() . '.');
     ProjectHelper::addEvent($this->get("Router"), $this->getDoctrine()->getEntityManager(), $closeEvent);
     return $this->redirect($this->generateUrl("bauer_incident_dashboard_core_homepage", array("project" => $event->getEventIdentifier()->getProject()->getIdentifier())));
 }