{% extends '@OroUI/actions/update.html.twig' %} {% if saveFormAction is defined %} {% set formAction = path(saveFormAction.route, saveFormAction.parameters) %} {% else %} {% set formAction = entity.id ? path('oro_customer_customer_update', {id: entity.id}) : path('oro_customer_customer_create') %} {% endif %} {% oro_title_set({params : {"%customerName%": entity.name|default('N/A'|trans), '%entityName%': 'oro.customer.customer.entity_label'|trans} }) %} {% block navButtons %} {% import '@OroUI/macros.html.twig' as UI %} {{ parent() }} {{ UI.cancelButton(path('oro_customer_customer_index')) }} {% set html = '' %} {% if is_granted('oro_customer_customer_view') %} {% set html = html ~ UI.saveAndCloseButton({ 'route': 'oro_customer_customer_view', 'params': {'id': '$id'} }) %} {% endif %} {% if is_granted('oro_customer_customer_update') %} {% set html = html ~ UI.saveAndStayButton({ 'route': 'oro_customer_customer_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 %} {% if entity.id %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('oro_customer_customer_index'), 'indexLabel': 'oro.customer.customer.entity_plural_label'|trans, 'entityTitle': entity.name|default('N/A'|trans) } %} {{ parent() }} {% else %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.customer.customer.entity_label'|trans}) %} {% include '@OroUI/page_title_block.html.twig' with { title: title } %} {% endif %} {% endblock pageHeader %} {% block content_data %} {% set id = 'customer-edit' %} {% set subblocks = [{ 'data': [ form_row(form.name), form_row(form.group), form_row(form.parent), form_row(form.internal_rating), form_row(form.salesRepresentatives), ] }] %} {% if is_granted('oro_customer_customer_address_update') %} {% set subblocks = subblocks|merge([{ 'title': 'oro.customer.sections.addresses'|trans, 'data': [ form_widget(form.addresses), ] }]) %} {% endif %} {% set dataBlocks = [ { 'title': 'oro.customer.sections.general'|trans, 'subblocks': subblocks } ] %} {% set dataBlocks = dataBlocks|merge(oro_form_additional_data(form, 'oro.customer.sections.additional'|trans)) %} {% set data = { 'formErrors': form_errors(form), 'dataBlocks': dataBlocks }%}
{{ parent() }}
{% endblock content_data %}