diff --git a/Command/AutoClosingCommand.php b/Command/AutoClosingCommand.php index 170dcddd..b0e1236b 100644 --- a/Command/AutoClosingCommand.php +++ b/Command/AutoClosingCommand.php @@ -54,7 +54,7 @@ protected function execute(InputInterface $input, OutputInterface $output) foreach ($resolved_tickets as $ticket) { $message = $ticket_manager->createMessage() ->setMessage( - $translator->trans('MESSAGE_STATUS_CHANGED', ['%status%' => $translator->trans('STATUS_CLOSED')]) + $translator->trans('MESSAGE_STATUS_CHANGED', ['%status%' => $translator->trans('STATUS_CLOSED', [], 'HackzillaTicketBundle')], 'HackzillaTicketBundle') ) ->setStatus(TicketMessage::STATUS_CLOSED) ->setPriority($ticket->getPriority()) diff --git a/Controller/TicketAttachmentController.php b/Controller/TicketAttachmentController.php index e0716c9d..c8945ad2 100644 --- a/Controller/TicketAttachmentController.php +++ b/Controller/TicketAttachmentController.php @@ -25,7 +25,7 @@ public function downloadAction($ticketMessageId) $ticketMessage = $ticketManager->getMessageById($ticketMessageId); if (!$ticketMessage || !$ticketMessage instanceof TicketMessageWithAttachment) { - throw $this->createNotFoundException($this->get('translator')->trans('ERROR_FIND_TICKET_ENTITY')); + throw $this->createNotFoundException($this->get('translator')->trans('ERROR_FIND_TICKET_ENTITY', [], 'HackzillaTicketBundle')); } // check permissions diff --git a/Controller/TicketController.php b/Controller/TicketController.php index 1df4ea66..fdfab7cd 100644 --- a/Controller/TicketController.php +++ b/Controller/TicketController.php @@ -30,7 +30,7 @@ public function indexAction(Request $request) $userManager = $this->getUserManager(); $ticketManager = $this->get('hackzilla_ticket.ticket_manager'); - $ticketState = $request->get('state', $this->get('translator')->trans('STATUS_OPEN')); + $ticketState = $request->get('state', $this->get('translator')->trans('STATUS_OPEN', [], 'HackzillaTicketBundle')); $ticketPriority = $request->get('priority', null); $query = $ticketManager->getTicketList( @@ -157,7 +157,7 @@ public function replyAction(Request $request, $ticketId) $ticket = $ticketManager->getTicketById($ticketId); if (!$ticket) { - throw $this->createNotFoundException($this->get('translator')->trans('ERROR_FIND_TICKET_ENTITY')); + throw $this->createNotFoundException($this->get('translator')->trans('ERROR_FIND_TICKET_ENTITY', [], 'HackzillaTicketBundle')); } $user = $this->getUserManager()->getCurrentUser(); @@ -212,7 +212,7 @@ public function deleteAction(Request $request, $ticketId) $ticket = $ticketManager->getTicketById($ticketId); if (!$ticket) { - throw $this->createNotFoundException($this->get('translator')->trans('ERROR_FIND_TICKET_ENTITY')); + throw $this->createNotFoundException($this->get('translator')->trans('ERROR_FIND_TICKET_ENTITY', [], 'HackzillaTicketBundle')); } $ticketManager->deleteTicket($ticket); diff --git a/Manager/TicketManager.php b/Manager/TicketManager.php index 54c54126..8d6ec352 100644 --- a/Manager/TicketManager.php +++ b/Manager/TicketManager.php @@ -266,7 +266,7 @@ public function getTicketStatus($statusStr) $statuses = []; foreach (TicketMessageInterface::STATUSES as $id => $value) { - $statuses[$id] = $this->translator->trans($value); + $statuses[$id] = $this->translator->trans($value, [], 'HackzillaTicketBundle'); } } @@ -288,7 +288,7 @@ public function getTicketPriority($priorityStr) $priorities = []; foreach (TicketMessageInterface::PRIORITIES as $id => $value) { - $priorities[$id] = $this->translator->trans($value); + $priorities[$id] = $this->translator->trans($value, [], 'HackzillaTicketBundle'); } } diff --git a/Resources/views/Macros/macros.html.twig b/Resources/views/Macros/macros.html.twig index 84cce4d5..0a9629de 100644 --- a/Resources/views/Macros/macros.html.twig +++ b/Resources/views/Macros/macros.html.twig @@ -25,25 +25,25 @@ {% macro status_alert(status, text) %} {% spaceless %} {% if status == 10 %} -
{{ knp_pagination_sortable(pagination, 'HEADING_TICKET'|trans, 't.id') }} | -{{ knp_pagination_sortable(pagination, 'HEADING_SUBJECT'|trans, 't.subject') }} | -{{ knp_pagination_sortable(pagination, 'HEADING_AUTHOR'|trans, 't.userCreated') }} | -{{ knp_pagination_sortable(pagination, 'HEADING_STATUS'|trans, 't.status') }} | -{{ knp_pagination_sortable(pagination, 'HEADING_PRIORITY'|trans, 't.priority') }} | -{{ knp_pagination_sortable(pagination, 'HEADING_MODIFIED'|trans, 't.lastMessage') }} | -{{ knp_pagination_sortable(pagination, 'HEADING_CREATED'|trans, 't.createdAt') }} | +{{ knp_pagination_sortable(pagination, 'HEADING_TICKET'|trans({}, 'HackzillaTicketBundle'), 't.id') }} | +{{ knp_pagination_sortable(pagination, 'HEADING_SUBJECT'|trans({}, 'HackzillaTicketBundle'), 't.subject') }} | +{{ knp_pagination_sortable(pagination, 'HEADING_AUTHOR'|trans({}, 'HackzillaTicketBundle'), 't.userCreated') }} | +{{ knp_pagination_sortable(pagination, 'HEADING_STATUS'|trans({}, 'HackzillaTicketBundle'), 't.status') }} | +{{ knp_pagination_sortable(pagination, 'HEADING_PRIORITY'|trans({}, 'HackzillaTicketBundle'), 't.priority') }} | +{{ knp_pagination_sortable(pagination, 'HEADING_MODIFIED'|trans({}, 'HackzillaTicketBundle'), 't.lastMessage') }} | +{{ knp_pagination_sortable(pagination, 'HEADING_CREATED'|trans({}, 'HackzillaTicketBundle'), 't.createdAt') }} | {{ entity.id }} | {{ entity.subject }} | {{ entity.userCreatedObject }} | -{{ macros.status_btn(entity.status, entity.statusString|trans, true) }} | -{{ macros.priority_btn(entity.priority, entity.priorityString|trans, true) }} | -{% if entity.lastMessage %}{{ entity.lastMessage|date('LABEL_DATE_TIME_FORMAT'|trans) }}{% endif %} | -{% if entity.createdAt %}{{ entity.createdAt|date('LABEL_DATE_TIME_FORMAT'|trans) }}{% endif %} | +{{ macros.status_btn(entity.status, entity.statusString|trans({}, 'HackzillaTicketBundle'), true) }} | +{{ macros.priority_btn(entity.priority, entity.priorityString|trans({}, 'HackzillaTicketBundle'), true) }} | +{% if entity.lastMessage %}{{ entity.lastMessage|date('LABEL_DATE_TIME_FORMAT'|trans({}, 'HackzillaTicketBundle')) }}{% endif %} | +{% if entity.createdAt %}{{ entity.createdAt|date('LABEL_DATE_TIME_FORMAT'|trans({}, 'HackzillaTicketBundle')) }}{% endif %} | {% else %}
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ 'MESSAGE_NO_TICKETS'|trans }}. | +{{ 'MESSAGE_NO_TICKETS'|trans({}, 'HackzillaTicketBundle') }}. |