{% extends '@OroUI/actions/update.html.twig' %} {% set name = 'N/A' %} {% if entity.name %} {% set name = is_granted('VIEW', entity, 'name') ? entity.name|default('N/A'|trans) : 'view %fieldName% not granted'|trans({'%fieldName%': 'oro.sales.opportunity.name.label'|trans}) %} {% endif %} {% oro_title_set({params : {"%opportunity.name%": name} }) %} {% set pageComponent = { 'module': 'oroui/js/app/components/view-component', 'options': {'view': 'orosales/js/app/views/update-page-view'}, 'layout': 'separate' } %} {% if saveFormAction is defined %} {% set formAction = path(saveFormAction.route, saveFormAction.parameters) %} {% else %} {% set formAction = form.vars.value.id ? path('oro_sales_opportunity_update', { 'id': form.vars.value.id }) : path('oro_sales_opportunity_create') %} {% endif %} {% block head_script %} {{ parent() }} {% block stylesheets %} {{ form_stylesheet(form) }} {% endblock %} {% endblock %} {% block navButtons %} {% import '@OroUI/macros.html.twig' as UI %} {% if form.vars.value.id and is_granted('DELETE', form.vars.value) %} {{ UI.deleteButton({ 'dataUrl': path('oro_api_delete_opportunity', {'id': form.vars.value.id}), 'dataRedirect': path('oro_sales_opportunity_index'), 'aCss': 'no-hash remove-button', 'id': 'btn-remove-oppotunity', 'dataId': form.vars.value.id, 'entity_label': 'oro.sales.opportunity.entity_label'|trans, }) }} {{ UI.buttonSeparator() }} {% endif %} {{ UI.cancelButton(path('oro_sales_opportunity_index')) }} {% set html = UI.saveAndCloseButton({ 'route': 'oro_sales_opportunity_view', 'params': {'id': '$id'} }) %} {% if is_granted('oro_sales_opportunity_create') %} {% set html = html ~ UI.saveAndNewButton({ 'route': 'oro_sales_opportunity_create' }) %} {% endif %} {% if form.vars.value.id or is_granted('oro_sales_opportunity_update') %} {% set html = html ~ UI.saveAndStayButton({ 'route': 'oro_sales_opportunity_update', 'params': {'id': '$id'} }) %} {% endif %} {% if returnAction is defined and is_granted(returnAction.aclRole) %} {% set html = html ~ UI.saveAndReturnButton({ 'route': returnAction.route, 'params': returnAction.parameters }) %} {% endif %} {{ UI.dropdownSaveButton({'html': html}) }} {% endblock %} {% block pageHeader %} {% import '@OroUI/macros.html.twig' as UI %} {% if form.vars.value.id %} {% set name = 'N/A' %} {% if entity.name %} {% set name = is_granted('VIEW', entity, 'name') ? entity.name|default('N/A'|trans) : UI.renderDisabledLabel('view %fieldName% not granted'|trans({'%fieldName%': 'oro.sales.opportunity.name.label'|trans})) %} {% endif %} {% set breadcrumbs = { 'entity': form.vars.value, 'indexPath': path('oro_sales_opportunity_index'), 'indexLabel': 'oro.sales.opportunity.entity_plural_label'|trans, 'entityTitle': name } %} {{ parent() }} {% else %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.sales.opportunity.entity_label'|trans}) %} {% include '@OroUI/page_title_block.html.twig' with { title: title } %} {% endif %} {% endblock pageHeader %} {% block stats %} {% if is_granted('VIEW', entity, 'createdAt') %}