{% extends '@OroUI/actions/view.html.twig' %} {% set hasGrantedNameView = is_granted('VIEW', entity, 'name') %} {% oro_title_set({params : {"%opportunity.name%": hasGrantedNameView ? entity.name|default('N/A'|trans) : 'view %fieldName% not granted'|trans({'%fieldName%': 'oro.sales.opportunity.name.label'|trans}) }}) %} {% block navButtons %} {% import '@OroUI/macros.html.twig' as UI %} {% if is_granted('EDIT', entity) %} {{ UI.editButton({ 'path' : path('oro_sales_opportunity_update', { 'id': entity.id }), 'entity_label': 'oro.sales.opportunity.entity_label'|trans }) }} {% endif %} {% if is_granted('DELETE', entity) %} {{ UI.deleteButton({ 'dataUrl': path('oro_api_delete_opportunity', {'id': entity.id}), 'dataRedirect': path('oro_sales_opportunity_index'), 'aCss': 'no-hash remove-button', 'id': 'btn-remove-contact', 'dataId': entity.id, 'entity_label': 'oro.sales.opportunity.entity_label'|trans }) }} {% endif %} {% endblock navButtons %} {% block pageHeader %} {% import '@OroUI/macros.html.twig' as UI %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('oro_sales_opportunity_index'), 'indexLabel': 'oro.sales.opportunity.entity_plural_label'|trans, 'rawEntityTitle': not hasGrantedNameView, 'entityTitle': hasGrantedNameView ? entity.name|default('N/A'|trans) : UI.renderDisabledLabel('view %fieldName% not granted'|trans({'%fieldName%': 'oro.sales.opportunity.name.label'|trans})) } %} {{ parent() }} {% endblock pageHeader %} {% block stats %} {% if is_granted('VIEW', entity, 'createdAt') %}
  • {{ 'oro.ui.created_at'|trans }}: {{ entity.createdAt ? entity.createdAt|oro_format_datetime : 'N/A' }}
  • {% endif %} {% if is_granted('VIEW', entity, 'updatedAt') %}
  • {{ 'oro.ui.updated_at'|trans }}: {{ entity.updatedAt ? entity.updatedAt|oro_format_datetime : 'N/A' }}
  • {% endif %} {% endblock stats %} {% block breadcrumbs %} {% import '@OroUI/macros.html.twig' as UI %} {{ parent() }} {% if entity.status and is_granted('VIEW', entity, 'status') %} {{ UI.badge(entity.status.name, entity.status.id != 'lost' ? 'enabled' : 'disabled') }} {% endif %} {% endblock breadcrumbs %} {% block content_data %} {% set opportunityInfoWidget %} {{ oro_widget_render({ 'widgetType': 'block', 'url': path('oro_sales_opportunity_info', { id: entity.id }) }) }} {% endset %} {% set generalSubblocks = [{'data' : [opportunityInfoWidget] }] %} {% set dataBlocks = [ { 'title': 'General Information'|trans, 'subblocks': generalSubblocks } ] %} {% set id = 'opportunityView' %} {% set data = {'dataBlocks': dataBlocks} %} {{ parent() }} {% endblock content_data %}