{% extends 'OroUIBundle:actions:view.html.twig' %} {% oro_title_set({params : {"%account.name%": entity.name|default('N/A')} }) %} {% block navButtons %} {% if resource_granted('EDIT', entity) %} {{ UI.editButton({ 'path': path('orocrm_account_update', {'id': entity.id}), 'entity_label': 'orocrm.account.entity_label'|trans }) }} {% endif %} {% if resource_granted('DELETE', entity) %} {{ UI.deleteButton({ 'dataUrl': path('oro_api_delete_account', {'id': entity.id}), 'dataRedirect': path('orocrm_account_index'), 'aCss': 'no-hash remove-button', 'dataId': entity.id, 'id': 'btn-remove-account', 'entity_label': 'orocrm.account.entity_label'|trans }) }} {% endif %} {% endblock navButtons %} {% block pageHeader %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('orocrm_account_index'), 'indexLabel': 'orocrm.account.entity_plural_label'|trans, 'entityTitle': entity.name|default('N/A') } %} {{ parent() }} {% endblock pageHeader %} {% block stats %} {{ parent() }}
  • {{ 'orocrm.account.lifetime_value.label'|trans }}: {{ orocrm_channel_account_lifetime(entity)|oro_format_currency }}
  • {% endblock stats %} {% block content_data %} {% set accountInformationWidget %} {{ oro_widget_render({ 'widgetType': 'block', 'title': 'orocrm.account.widgets.account_information'|trans, 'url': path('orocrm_account_widget_info', {id: entity.id}) }) }} {% endset %} {% set generalSectionBlocks = [{'data' : [accountInformationWidget]}]%} {% if resource_granted('orocrm_contact_view') %} {% set contactsInformationWidget %}
    {{ oro_widget_render({ 'widgetType': 'block', 'url': path('orocrm_account_widget_contacts', {id: entity.id}), 'title': 'orocrm.contact.widgets.account_contacts'|trans }) }}
    {% endset %} {% set generalSectionBlocks = generalSectionBlocks|merge( [{'data': [contactsInformationWidget]}] ) %} {% endif %} {% set salesInformationWidget %} {{ oro_widget_render({ 'widgetType': 'block', 'title': '', 'url': path('orocrm_sales_account_sales_info', {id: entity.id})}) }} {% endset %} {% set dataBlocks = [ { 'title': 'orocrm.account.sections.general'|trans, 'class': 'active', 'subblocks': generalSectionBlocks }, { 'title': 'Leads/Opportunites', 'subblocks': [{'data': [salesInformationWidget]}] } ] %} {# Render account channels #} {% for channel in channels %} {%- set accountChannelInfoSection -%} {% spaceless %} {% set placeHolderName = 'orocrm_account_channel_info_' ~ channel.channelType %} {{ placeholder(placeHolderName, {'accountId': entity.id, 'channelId': channel.id}) }} {% endspaceless %} {%- endset -%} {% if accountChannelInfoSection|striptags|trim is not empty %} {% set dataBlocks = dataBlocks|merge([ { 'title': channel.name, 'priority': 255, 'subblocks': [ {'data' : [accountChannelInfoSection]} ] } ]) %} {% endif %} {% endfor %} {% set id = 'accountView' %} {% set data = {'dataBlocks': dataBlocks} %} {{ parent() }} {% endblock content_data %}