Skip to content

Commit

Permalink
Revert "Merge pull request hackzilla-project#123 from phansys/transla…
Browse files Browse the repository at this point in the history
…tion_domain"

This reverts commit 36f0493, reversing
changes made to 2ce57bb.
  • Loading branch information
phansys committed Jun 30, 2020
1 parent 49943cd commit 15609f2
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Command/AutoClosingCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
foreach ($resolved_tickets as $ticket) {
$message = $this->ticketManager->createMessage()
->setMessage(
$this->translator->trans('MESSAGE_STATUS_CHANGED', ['%status%' => $this->translator->trans('STATUS_CLOSED', [], 'HackzillaTicketBundle')], 'HackzillaTicketBundle')
$this->translator->trans('MESSAGE_STATUS_CHANGED', ['%status%' => $this->translator->trans('STATUS_CLOSED')])
)
->setStatus(TicketMessage::STATUS_CLOSED)
->setPriority($ticket->getPriority())
Expand Down
2 changes: 1 addition & 1 deletion Controller/TicketAttachmentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [], 'HackzillaTicketBundle'));
throw $this->createNotFoundException($this->get('translator')->trans('ERROR_FIND_TICKET_ENTITY'));
}

// check permissions
Expand Down
6 changes: 3 additions & 3 deletions Controller/TicketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [], 'HackzillaTicketBundle'));
$ticketState = $request->get('state', $this->get('translator')->trans('STATUS_OPEN'));
$ticketPriority = $request->get('priority', null);

$query = $ticketManager->getTicketListQuery(
Expand Down Expand Up @@ -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', [], 'HackzillaTicketBundle'));
throw $this->createNotFoundException($this->get('translator')->trans('ERROR_FIND_TICKET_ENTITY'));
}

$user = $this->getUserManager()->getCurrentUser();
Expand Down Expand Up @@ -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', [], 'HackzillaTicketBundle'));
throw $this->createNotFoundException($this->get('translator')->trans('ERROR_FIND_TICKET_ENTITY'));
}

$ticketManager->deleteTicket($ticket);
Expand Down
4 changes: 2 additions & 2 deletions Manager/TicketManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public function getTicketStatus($statusStr)
$statuses = [];

foreach (TicketMessageInterface::STATUSES as $id => $value) {
$statuses[$id] = $this->translator->trans($value, [], 'HackzillaTicketBundle');
$statuses[$id] = $this->translator->trans($value);
}
}

Expand All @@ -280,7 +280,7 @@ public function getTicketPriority($priorityStr)
$priorities = [];

foreach (TicketMessageInterface::PRIORITIES as $id => $value) {
$priorities[$id] = $this->translator->trans($value, [], 'HackzillaTicketBundle');
$priorities[$id] = $this->translator->trans($value);
}
}

Expand Down
18 changes: 9 additions & 9 deletions Resources/views/Macros/macros.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@
{% macro status_alert(status, text) %}
{% spaceless %}
{% if status == 10 %}
<div class="alert alert-warning" role="alert"><span class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }, 'HackzillaTicketBundle') }}
<div class="alert alert-warning" role="alert"><span class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }) }}
</div>
{% elseif status == 11 %}
<div class="alert alert-info" role="alert"><span
class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }, 'HackzillaTicketBundle') }}
class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }) }}
</div>
{% elseif status == 12 %}
<div class="alert alert-info" role="alert"><span
class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }, 'HackzillaTicketBundle') }}
class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }) }}
</div>
{% elseif status == 13 %}
<div class="alert alert-info" role="alert"><span
class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }, 'HackzillaTicketBundle') }}
class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }) }}
</div>
{% elseif status == 14 %}
<div class="alert alert-success" role="alert"><span class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }, 'HackzillaTicketBundle') }}
<div class="alert alert-success" role="alert"><span class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }) }}
</div>
{% elseif status == 15 %}
<div class="alert alert-danger" role="alert"><span class="glyphicon glyphicon-folder-close"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }, 'HackzillaTicketBundle') }}
<div class="alert alert-danger" role="alert"><span class="glyphicon glyphicon-folder-close"></span>&nbsp;&nbsp;{{ 'MESSAGE_STATUS_CHANGED'|trans({'%status%': text|upper }) }}
</div>
{% endif %}
{% endspaceless %}
Expand All @@ -67,14 +67,14 @@
{% spaceless %}
{% if priority <= 20 %}
<div class="alert alert-info"
role="alert">{{ 'MESSAGE_PRIORITY_CHANGED'|trans({'%priority%': text|upper }, 'HackzillaTicketBundle') }}</div>
role="alert">{{ 'MESSAGE_PRIORITY_CHANGED'|trans({'%priority%': text|upper }) }}</div>
{% elseif priority == 21 %}
<div class="alert alert-warning" role="alert"><span
class="glyphicon glyphicon-asterisk"></span>&nbsp;&nbsp;{{ 'MESSAGE_PRIORITY_CHANGED'|trans({'%priority%': text|upper }, 'HackzillaTicketBundle') }}
class="glyphicon glyphicon-asterisk"></span>&nbsp;&nbsp;{{ 'MESSAGE_PRIORITY_CHANGED'|trans({'%priority%': text|upper }) }}
</div>
{% else %}
<div class="alert alert-danger" role="alert"><span
class="glyphicon glyphicon-star"></span>&nbsp;&nbsp;{{ 'MESSAGE_PRIORITY_CHANGED'|trans({'%priority%': text|upper }, 'HackzillaTicketBundle') }}
class="glyphicon glyphicon-star"></span>&nbsp;&nbsp;{{ 'MESSAGE_PRIORITY_CHANGED'|trans({'%priority%': text|upper }) }}
</div>
{% endif %}
{% endspaceless %}
Expand Down
48 changes: 24 additions & 24 deletions Resources/views/Ticket/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
{% import 'hackzilla_ticket.templates.macros' as macros %}

{% block hackzilla_ticket_content -%}
<h1>{{ 'HEADING_TICKET_LIST'|trans({}, 'HackzillaTicketBundle') }}</h1>
<h1>{{ 'HEADING_TICKET_LIST'|trans }}</h1>

<div class="row">
<div class="col-xs-4">
<div class="btn-group">
<a href="{{ path('hackzilla_ticket', {'state': 'STATUS_OPEN'|trans({}, 'HackzillaTicketBundle')}) }}"
class="btn btn-default {{ ticketState != 'STATUS_CLOSED'|trans({}, 'HackzillaTicketBundle') ? 'active' : '' }}">{{ 'STATUS_OPEN'|trans({}, 'HackzillaTicketBundle')|upper }}</a>
<a href="{{ path('hackzilla_ticket', {'state': 'STATUS_CLOSED'|trans({}, 'HackzillaTicketBundle')}) }}"
class="btn btn-default {{ ticketState == 'STATUS_CLOSED'|trans({}, 'HackzillaTicketBundle') ? 'active' : '' }}">{{ 'STATUS_CLOSED'|trans({}, 'HackzillaTicketBundle')|upper }}</a>
<a href="{{ path('hackzilla_ticket', {'state': 'STATUS_OPEN'|trans}) }}"
class="btn btn-default {{ ticketState != 'STATUS_CLOSED'|trans ? 'active' : '' }}">{{ 'STATUS_OPEN'|trans|upper }}</a>
<a href="{{ path('hackzilla_ticket', {'state': 'STATUS_CLOSED'|trans}) }}"
class="btn btn-default {{ ticketState == 'STATUS_CLOSED'|trans ? 'active' : '' }}">{{ 'STATUS_CLOSED'|trans|upper }}</a>
</div>
</div>

Expand All @@ -19,33 +19,33 @@
<a href="{{ path('hackzilla_ticket') }}"
class="btn btn-default {{ ticketPriority is null ? 'active' : '' }}"><span
class="glyphicon glyphicon-remove"></span></a>
<a href="{{ path('hackzilla_ticket', {'priority': 'PRIORITY_HIGH'|trans({}, 'HackzillaTicketBundle')}) }}"
class="btn btn-danger {{ ticketPriority == 'PRIORITY_HIGH'|trans({}, 'HackzillaTicketBundle') ? 'active' : '' }}">{{ 'PRIORITY_HIGH'|trans({}, 'HackzillaTicketBundle')|upper }}</a>
<a href="{{ path('hackzilla_ticket', {'priority': 'PRIORITY_MEDIUM'|trans({}, 'HackzillaTicketBundle')}) }}"
class="btn btn-warning {{ ticketPriority == 'PRIORITY_MEDIUM'|trans({}, 'HackzillaTicketBundle') ? 'active' : '' }}">{{ 'PRIORITY_MEDIUM'|trans({}, 'HackzillaTicketBundle')|upper }}</a>
<a href="{{ path('hackzilla_ticket', {'priority': 'PRIORITY_LOW'|trans({}, 'HackzillaTicketBundle')}) }}"
class="btn btn-info {{ ticketPriority == 'PRIORITY_LOW'|trans({}, 'HackzillaTicketBundle') ? 'active' : '' }}">{{ 'PRIORITY_LOW'|trans({}, 'HackzillaTicketBundle')|upper }}</a>
<a href="{{ path('hackzilla_ticket', {'priority': 'PRIORITY_HIGH'|trans}) }}"
class="btn btn-danger {{ ticketPriority == 'PRIORITY_HIGH'|trans ? 'active' : '' }}">{{ 'PRIORITY_HIGH'|trans|upper }}</a>
<a href="{{ path('hackzilla_ticket', {'priority': 'PRIORITY_MEDIUM'|trans}) }}"
class="btn btn-warning {{ ticketPriority == 'PRIORITY_MEDIUM'|trans ? 'active' : '' }}">{{ 'PRIORITY_MEDIUM'|trans|upper }}</a>
<a href="{{ path('hackzilla_ticket', {'priority': 'PRIORITY_LOW'|trans}) }}"
class="btn btn-info {{ ticketPriority == 'PRIORITY_LOW'|trans ? 'active' : '' }}">{{ 'PRIORITY_LOW'|trans|upper }}</a>
</div>
</div>

<div class="col-xs-4 text-right">
<div class="btn-group">
<a href="{{ path('hackzilla_ticket_new') }}" class="btn btn-primary"><span
class="glyphicon glyphicon-plus"></span> {{ 'BUTTON_NEW'|trans({}, 'HackzillaTicketBundle') }}</a>
class="glyphicon glyphicon-plus"></span> {{ 'BUTTON_NEW'|trans }}</a>
</div>
</div>
</div>

<table class="table table-bordered table-striped">
<thead>
<tr>
<th class="col-xs-1">{{ knp_pagination_sortable(pagination, 'HEADING_TICKET'|trans({}, 'HackzillaTicketBundle'), 't.id') }}</th>
<th{% if pagination.isSorted('t.subject') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_SUBJECT'|trans({}, 'HackzillaTicketBundle'), 't.subject') }}</th>
<th{% if pagination.isSorted('t.userCreated') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_AUTHOR'|trans({}, 'HackzillaTicketBundle'), 't.userCreated') }}</th>
<th{% if pagination.isSorted('t.status') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_STATUS'|trans({}, 'HackzillaTicketBundle'), 't.status') }}</th>
<th{% if pagination.isSorted('t.priority') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_PRIORITY'|trans({}, 'HackzillaTicketBundle'), 't.priority') }}</th>
<th{% if pagination.isSorted('t.modified') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_MODIFIED'|trans({}, 'HackzillaTicketBundle'), 't.lastMessage') }}</th>
<th{% if pagination.isSorted('t.created') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_CREATED'|trans({}, 'HackzillaTicketBundle'), 't.createdAt') }}</th>
<th class="col-xs-1">{{ knp_pagination_sortable(pagination, 'HEADING_TICKET'|trans, 't.id') }}</th>
<th{% if pagination.isSorted('t.subject') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_SUBJECT'|trans, 't.subject') }}</th>
<th{% if pagination.isSorted('t.userCreated') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_AUTHOR'|trans, 't.userCreated') }}</th>
<th{% if pagination.isSorted('t.status') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_STATUS'|trans, 't.status') }}</th>
<th{% if pagination.isSorted('t.priority') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_PRIORITY'|trans, 't.priority') }}</th>
<th{% if pagination.isSorted('t.modified') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_MODIFIED'|trans, 't.lastMessage') }}</th>
<th{% if pagination.isSorted('t.created') %} class="sorted"{% endif %}>{{ knp_pagination_sortable(pagination, 'HEADING_CREATED'|trans, 't.createdAt') }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -54,14 +54,14 @@
<td><a href="{{ path('hackzilla_ticket_show', { 'ticketId': entity.id }) }}">{{ entity.id }}</a></td>
<td><a href="{{ path('hackzilla_ticket_show', { 'ticketId': entity.id }) }}">{{ entity.subject }}</a></td>
<td>{{ entity.userCreatedObject }}</td>
<td>{{ macros.status_btn(entity.status, entity.statusString|trans({}, 'HackzillaTicketBundle'), true) }}</td>
<td>{{ macros.priority_btn(entity.priority, entity.priorityString|trans({}, 'HackzillaTicketBundle'), true) }}</td>
<td>{% if entity.lastMessage %}{{ entity.lastMessage|date('LABEL_DATE_TIME_FORMAT'|trans({}, 'HackzillaTicketBundle')) }}{% endif %}</td>
<td>{% if entity.createdAt %}{{ entity.createdAt|date('LABEL_DATE_TIME_FORMAT'|trans({}, 'HackzillaTicketBundle')) }}{% endif %}</td>
<td>{{ macros.status_btn(entity.status, entity.statusString|trans, true) }}</td>
<td>{{ macros.priority_btn(entity.priority, entity.priorityString|trans, true) }}</td>
<td>{% if entity.lastMessage %}{{ entity.lastMessage|date('LABEL_DATE_TIME_FORMAT'|trans) }}{% endif %}</td>
<td>{% if entity.createdAt %}{{ entity.createdAt|date('LABEL_DATE_TIME_FORMAT'|trans) }}{% endif %}</td>
</tr>
{% else %}
<tr>
<td colspan="7">{{ 'MESSAGE_NO_TICKETS'|trans({}, 'HackzillaTicketBundle') }}.</td>
<td colspan="7">{{ 'MESSAGE_NO_TICKETS'|trans }}.</td>
</tr>
{% endfor %}
</tbody>
Expand Down
6 changes: 3 additions & 3 deletions Resources/views/Ticket/new.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends '@HackzillaTicket/layout.html.twig' %}

{% block hackzilla_ticket_content -%}
<h1>{{ 'HEADING_NEW_TICKET'|trans({}, 'HackzillaTicketBundle') }}</h1>
<h1>{{ 'HEADING_NEW_TICKET'|trans }}</h1>

<div class="well well-sm">
{{ form_start(form, {'method': 'POST', 'action': path('hackzilla_ticket_create')}) }}
Expand All @@ -23,10 +23,10 @@

<div class="form-group row">
<div class="col-lg-offset-2 col-lg-10 col-md-offset-2 col-md-10 col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">{{ 'BUTTON_CREATE'|trans({}, 'HackzillaTicketBundle') }}</button>
<button type="submit" class="btn btn-primary">{{ 'BUTTON_CREATE'|trans }}</button>

<a href="{{ path('hackzilla_ticket') }}" class="btn btn-default">
{{ 'BUTTON_BACK_TO_LIST'|trans({}, 'HackzillaTicketBundle') }}
{{ 'BUTTON_BACK_TO_LIST'|trans }}
</a>
</div>
</div>
Expand Down

0 comments on commit 15609f2

Please sign in to comment.