Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List ticket types in alphabetical order and display ticket type name instead of description #566

Merged
merged 18 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions PreparedResponse/Actions/Ticket/UpdateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ public static function getOptions(ContainerInterface $container)
return array_map(function ($ticketType) {
return [
'id' => $ticketType->getId(),
'name' => $ticketType->getDescription(),
'name' => $ticketType->getCode(),
];
}, $entityManager->getRepository('UVDeskCoreFrameworkBundle:TicketType')->findAll());
}, $entityManager->getRepository('UVDeskCoreFrameworkBundle:TicketType')
->findBy(['isActive' => true], ['code' => 'ASC']));
}

public static function applyAction(ContainerInterface $container, $entity, $value = null)
Expand Down
8 changes: 4 additions & 4 deletions Resources/views/Snippets/createMemberTicket.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
<div class="uv-field-block">
<select name="type" class="uv-select create-ticket" id="type">
<option value="">{{ 'Select type'|trans }}</option>

{% for type in ticketTypeCollection %}
<option value="{{ type.id }}">{{ type.description }}</option>
{% endfor %}
{% for type in ticket_service.getTypes() %}
<option value="{{ type.id }}" {{ post.type is defined and post.type == type.id ? 'selected' : '' }}>{{ type.name }}
</option>
{% endfor %}
</select>
</div>
<span class="uv-field-info">{{ 'Choose ticket type'|trans }}</span>
Expand Down
8 changes: 4 additions & 4 deletions Resources/views/ticket.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@
<label class="uv-aside-select-label">{{ 'Type'|trans }}</label>
<div>
{% if user_service.isAccessAuthorized('ROLE_AGENT_UPDATE_TICKET_TYPE') %}
<span class="uv-aside-select-value uv-dropdown-other uv-aside-drop-icon" data-id="{{ ticket.type ? ticket.type.id : '-- --' }}">{{ ticket.type ? ticket.type.description : 'Not Assigned'|trans }}</span>
<span class="uv-aside-select-value uv-dropdown-other uv-aside-drop-icon" data-id="{{ ticket.type ? ticket.type.id : '-- --' }}">{{ ticket.type ? ticket.type.code : 'Not Assigned'|trans }}</span>
<div class="uv-dropdown-list uv-bottom-left">
<div class="uv-dropdown-container">
<label>{{ 'Type'|trans }}</label>
Expand All @@ -565,14 +565,14 @@
</div>

<ul class="uv-search-list type" data-action="type">
{% for type in ticketTypeCollection %}
<li data-index="{{ type.id }}"><a href="#">{{ type.code }}</a></li>
{% for type in ticket_service.getTypes() %}
<li data-index="{{ type.id }}"><a href="#">{{ type.name }}</a></li>
{% endfor %}
</ul>
</div>
{% else %}
<span class="uv-aside-select-value">
{{ ticket.type ? ticket.type.description : 'Not Assigned'|trans }}
{{ ticket.type ? ticket.type.code : 'Not Assigned'|trans }}
</span>
{% endif %}
</div>
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/ticketList.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@
</div>

<ul class="uv-search-list type" data-action="type">
{% for type in ticketTypeCollection %}
<li data-index="{{ type.id }}"><a href="#">{{ type.description }}</a></li>
{% for type in ticket_service.getTypes() %}
<li data-index="{{ type.id }}"><a href="#">{{ type.name }}</a></li>
{% endfor %}
</ul>
</div>
Expand Down
5 changes: 3 additions & 2 deletions Workflow/Actions/Ticket/UpdateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ public static function getOptions(ContainerInterface $container)
return array_map(function ($ticketType) {
return [
'id' => $ticketType->getId(),
'name' => $ticketType->getDescription(),
'name' => $ticketType->getCode(),
];
}, $entityManager->getRepository('UVDeskCoreFrameworkBundle:TicketType')->findByIsActive(1));
}, $entityManager->getRepository('UVDeskCoreFrameworkBundle:TicketType')
->findBy(['isActive' => true], ['code' => 'ASC']));
}

public static function applyAction(ContainerInterface $container, $entity, $value = null)
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"psr-4": { "Webkul\\UVDesk\\CoreFrameworkBundle\\": "" }
},
"extra": {
"uvdesk-package-extension": "Webkul\\UVDesk\\CoreFrameworkBundle\\Package\\Composer"
"uvdesk-package-extension": "Webkul\\UVDesk\\CoreFrameworkBundle\\Package\\Composer",
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"minimum-stability": "stable"
}