get('net15.ticket.tickets.manager')->getAll(); $user = $this->getUser(); return $this->render("@TicketSupport/TicketItem/default.html.twig", [ 'ticketItemList' => $ticketItemList, 'lang' =>$request->getLocale() ]); } /** * @param Request $request * @return Response */ public function createAction(Request $request) { $ticketReasonlist = $this->get('net15.form.forge.reasons.manager')->getAll(); // $user = $this->getUser(); // if (!$user instanceof UserBase) // return null; $csrf = $this->get('security.csrf.token_manager'); $token = $csrf->refreshToken('_token'); $csrf->getToken($token); // $user =$this->getUser(); return $this->render("@TicketSupport/TicketItem/create.html.twig", [ 'ticketReasonList' =>$ticketReasonlist, 'lang' =>$request->getLocale(), 'token' =>$token ]); } /** * @param Request $request * @return RedirectResponse */ public function validateCreateItemAction(Request $request) { if($this->isCsrfTokenValid('support_ticket_new_item', $request->get('_csrf_token'))){ $ticketItem = $this->get('net15.ticket.tickets.manager')->createManually( $request->get('subject_item'), $request->get('message-item'), $locale = $request->getLocale(), $this->getUser() ); return $this->redirectToRoute('panel_support_ticket_item_list_panel',[]); } return $this->redirectToRoute('panel_support_ticket_item_create',[]); } /** * @param string $publicKey * @param Request $request * @return Response * @throws \Exception */ public function closeAction(string $publicKey, Request $request) { $ticketItem = $this->get('net15.ticket.tickets.manager')->getByPublicKey($publicKey); $ticketItemClosed = $this->get('net15.ticket.tickets.manager')->close($ticketItem, $request->get('comment'), true); return new Response($ticketItemClosed->getPublicKey()); } /** * @param string $publicKey */ public function updateAction(string $publicKey) { } /** * @param string $publicKey */ public function deleteAction(string $publicKey) { } }