{% if is_granted('oro_case_view') %} {% import '@OroUI/macros.html.twig' as UI %} {% import '@OroEmail/macros.html.twig' as email %} {% import _self as caseTicketInfo %} {% macro render_zendesk_user(label, user) %} {% import '@OroUI/macros.html.twig' as UI %} {% import _self as caseTicketInfo %} {%- set userHtml -%} {%- if user -%} {% if user.relatedUser and is_granted('VIEW', user.relatedUser) %} {{ user.name|escape }} {% elseif user.relatedContact and is_granted('VIEW', user.relatedContact) %} {{ user.name|escape }} {% else %} {{ user.name|escape }} {% endif %} {%- endif -%} {%- endset -%} {% if label %} {{ UI.renderHtmlProperty(label, userHtml) }} {% else %} {{ userHtml }} {% endif %} {% endmacro %} {% set ticket = oro_zendesk_ticket_by_related_case(entity) %} {% if ticket %}
{{ "oro.zendesk.ticket_info_title"|trans }}
{% set link %} {% set url = oro_zendesk_ticket_url(ticket) %} {% if url %} {{ ticket.originId }} {% elseif ticket.originId %} {{ ticket.originId }} {% else %} {{ 'oro.ui.empty'|trans }} {% endif %} {% endset %} {{ UI.renderHtmlProperty('oro.zendesk.ticket.origin_id.label'|trans, link) }} {% set recipient %} {{ email.email_address_simple(ticket.recipient) }} {% endset %} {{ UI.renderHtmlProperty('oro.zendesk.ticket.recipient.label'|trans, recipient|trim) }} {{ UI.renderProperty('oro.zendesk.ticket.status.label'|trans, ticket.status.label|default(false)) }} {{ UI.renderProperty('oro.zendesk.ticket.type.label'|trans, ticket.type.label|default(false)) }} {{ caseTicketInfo.render_zendesk_user('oro.zendesk.ticket.submitter.label'|trans, ticket.submitter) }} {{ caseTicketInfo.render_zendesk_user('oro.zendesk.ticket.assignee.label'|trans, ticket.assignee) }} {{ caseTicketInfo.render_zendesk_user('oro.zendesk.ticket.requester.label'|trans, ticket.requester) }} {{ UI.renderProperty('oro.zendesk.ticket.priority.label'|trans, ticket.priority.label|default(false)) }} {% set problem %} {% if ticket.problem and ticket.problem.relatedCase %} {{ ticket.problem.subject }} {% endif %} {% endset %} {{ UI.renderHtmlProperty('oro.zendesk.ticket.problem.label'|trans, problem|oro_html_sanitize|trim) }} {% set collaborators %} {% if ticket.collaborators %} {% for collaborator in ticket.collaborators %} {{ caseTicketInfo.render_zendesk_user(false, collaborator) }} {% if loop.length > 1 and not loop.last %} ,  {% endif %} {% endfor %} {% endif %} {% endset %} {{ UI.renderHtmlProperty('oro.zendesk.ticket.collaborators.label'|trans, collaborators|trim) }}
{% endif %} {% endif %}