@@ -30,7 +30,9 @@ public function indexAction(Request $request)
3030 $ userManager = $ this ->getUserManager ();
3131 $ ticketManager = $ this ->get ('hackzilla_ticket.ticket_manager ' );
3232
33- $ ticketState = $ request ->get ('state ' , $ this ->get ('translator ' )->trans ('STATUS_OPEN ' ));
33+ $ translationDomain = $ this ->getParameter ('hackzilla_ticket.translation_domain ' );
34+
35+ $ ticketState = $ request ->get ('state ' , $ this ->get ('translator ' )->trans ('STATUS_OPEN ' , [], $ translationDomain ));
3436 $ ticketPriority = $ request ->get ('priority ' , null );
3537
3638 $ query = $ ticketManager ->getTicketListQuery (
@@ -48,9 +50,10 @@ public function indexAction(Request $request)
4850 return $ this ->render (
4951 $ this ->container ->getParameter ('hackzilla_ticket.templates ' )['index ' ],
5052 [
51- 'pagination ' => $ pagination ,
52- 'ticketState ' => $ ticketState ,
53- 'ticketPriority ' => $ ticketPriority ,
53+ 'pagination ' => $ pagination ,
54+ 'ticketState ' => $ ticketState ,
55+ 'ticketPriority ' => $ ticketPriority ,
56+ 'translationDomain ' => $ translationDomain ,
5457 ]
5558 );
5659 }
@@ -81,11 +84,14 @@ public function createAction(Request $request)
8184 return $ this ->redirect ($ this ->generateUrl ('hackzilla_ticket_show ' , ['ticketId ' => $ ticket ->getId ()]));
8285 }
8386
87+ $ translationDomain = $ this ->getParameter ('hackzilla_ticket.translation_domain ' );
88+
8489 return $ this ->render (
8590 $ this ->container ->getParameter ('hackzilla_ticket.templates ' )['new ' ],
8691 [
87- 'entity ' => $ ticket ,
88- 'form ' => $ form ->createView (),
92+ 'entity ' => $ ticket ,
93+ 'form ' => $ form ->createView (),
94+ 'translationDomain ' => $ translationDomain ,
8995 ]
9096 );
9197 }
@@ -100,11 +106,14 @@ public function newAction()
100106
101107 $ form = $ this ->createForm (TicketType::class, $ entity );
102108
109+ $ translationDomain = $ this ->getParameter ('hackzilla_ticket.translation_domain ' );
110+
103111 return $ this ->render (
104112 $ this ->container ->getParameter ('hackzilla_ticket.templates ' )['new ' ],
105113 [
106- 'entity ' => $ entity ,
107- 'form ' => $ form ->createView (),
114+ 'entity ' => $ entity ,
115+ 'form ' => $ form ->createView (),
116+ 'translationDomain ' => $ translationDomain ,
108117 ]
109118 );
110119 }
@@ -128,7 +137,9 @@ public function showAction($ticketId)
128137 $ currentUser = $ this ->getUserManager ()->getCurrentUser ();
129138 $ this ->getUserManager ()->hasPermission ($ currentUser , $ ticket );
130139
131- $ data = ['ticket ' => $ ticket ];
140+ $ translationDomain = $ this ->getParameter ('hackzilla_ticket.translation_domain ' );
141+
142+ $ data = ['ticket ' => $ ticket , 'translationDomain ' => $ translationDomain ];
132143
133144 $ message = $ ticketManager ->createMessage ($ ticket );
134145
@@ -156,8 +167,10 @@ public function replyAction(Request $request, $ticketId)
156167 $ ticketManager = $ this ->get ('hackzilla_ticket.ticket_manager ' );
157168 $ ticket = $ ticketManager ->getTicketById ($ ticketId );
158169
170+ $ translationDomain = $ this ->getParameter ('hackzilla_ticket.translation_domain ' );
171+
159172 if (!$ ticket ) {
160- throw $ this ->createNotFoundException ($ this ->get ('translator ' )->trans ('ERROR_FIND_TICKET_ENTITY ' ));
173+ throw $ this ->createNotFoundException ($ this ->get ('translator ' )->trans ('ERROR_FIND_TICKET_ENTITY ' , [], $ translationDomain ));
161174 }
162175
163176 $ user = $ this ->getUserManager ()->getCurrentUser ();
@@ -176,7 +189,7 @@ public function replyAction(Request $request, $ticketId)
176189 return $ this ->redirect ($ this ->generateUrl ('hackzilla_ticket_show ' , ['ticketId ' => $ ticket ->getId ()]));
177190 }
178191
179- $ data = ['ticket ' => $ ticket , 'form ' => $ form ->createView ()];
192+ $ data = ['ticket ' => $ ticket , 'form ' => $ form ->createView (), ' translationDomain ' => $ translationDomain ];
180193
181194 if ($ user && $ this ->get ('hackzilla_ticket.user_manager ' )->hasRole ($ user , TicketRole::ADMIN )) {
182195 $ data ['delete_form ' ] = $ this ->createDeleteForm ($ ticket ->getId ())->createView ();
@@ -212,7 +225,9 @@ public function deleteAction(Request $request, $ticketId)
212225 $ ticket = $ ticketManager ->getTicketById ($ ticketId );
213226
214227 if (!$ ticket ) {
215- throw $ this ->createNotFoundException ($ this ->get ('translator ' )->trans ('ERROR_FIND_TICKET_ENTITY ' ));
228+ $ translationDomain = $ this ->getParameter ('hackzilla_ticket.translation_domain ' );
229+
230+ throw $ this ->createNotFoundException ($ this ->get ('translator ' )->trans ('ERROR_FIND_TICKET_ENTITY ' , [], $ translationDomain ));
216231 }
217232
218233 $ ticketManager ->deleteTicket ($ ticket );
@@ -264,8 +279,6 @@ private function createMessageForm(TicketMessageInterface $message)
264279 */
265280 private function getUserManager ()
266281 {
267- $ userManager = $ this ->get ('hackzilla_ticket.user_manager ' );
268-
269- return $ userManager ;
282+ return $ this ->get ('hackzilla_ticket.user_manager ' );
270283 }
271284}
0 commit comments