{% extends '@OroUI/actions/update.html.twig' %} {% form_theme form with ['@OroForm/Form/fields.html.twig'] %} {% oro_title_set({params : {"%b2bcustomer.name%": entity.name} }) %} {% set formAction = form.vars.value.id ? path('oro_sales_b2bcustomer_update', { 'id': form.vars.value.id }) : path('oro_sales_b2bcustomer_create') %} {% 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.buttonSeparator() }} {% endif %} {{ UI.cancelButton(path('oro_sales_b2bcustomer_index')) }} {% set html = UI.saveAndCloseButton({ 'route': 'oro_sales_b2bcustomer_view', 'params': {'id': '$id'} }) %} {% if is_granted('oro_sales_b2bcustomer_create') %} {% set html = html ~ UI.saveAndNewButton({ 'route': 'oro_sales_b2bcustomer_create' }) %} {% endif %} {% if form.vars.value.id or is_granted('oro_sales_b2bcustomer_update') %} {% set html = html ~ UI.saveAndStayButton({ 'route': 'oro_sales_b2bcustomer_update', 'params': {'id': '$id'} }) %} {% endif %} {{ UI.dropdownSaveButton({'html': html}) }} {% endblock %} {% block pageHeader %} {% if form.vars.value.id %} {% set breadcrumbs = { 'entity': form.vars.value, 'indexPath': path('oro_sales_b2bcustomer_index'), 'indexLabel': 'oro.sales.b2bcustomer.entity_plural_label'|trans, 'entityTitle': entity.name } %} {{ parent() }} {% else %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.sales.b2bcustomer.entity_label'|trans}) %} {% include '@OroUI/page_title_block.html.twig' with { title: title } %} {% endif %} {% endblock pageHeader %} {% block stats %} {{ parent() }} {% endblock stats %} {% block content_data %} {% set id = 'b2bcustomer-profile' %} {% set formFields = [] %} {% if form.owner is defined %} {% set formFields = formFields|merge([form_row(form.owner)]) %} {% endif %} {% set formFields = formFields|merge([ form_row(form.name), form_row(form.dataChannel), form_row(form.contact), form_row(form.phones), form_row(form.emails) ]) %} {% set dataBlocks = [{ 'title': 'General'|trans, 'subblocks': [{ 'title': 'oro.sales.widgets.b2bcustomer_information'|trans, 'data': formFields }] }] %} {% set dataBlocks = dataBlocks|merge( [{ 'title' : 'Addresses'|trans, 'subblocks': [ { 'title': 'oro.sales.b2bcustomer.billing_address.label'|trans, 'data': [form_widget(form.billingAddress)] }, { 'title': 'oro.sales.b2bcustomer.shipping_address.label'|trans, 'data': [form_widget(form.shippingAddress)] }, ] }] ) %} {% set dataBlocks = dataBlocks|merge(oro_form_additional_data(form, 'Additional'|trans)) %} {% set data = { 'formErrors': form_errors(form)? form_errors(form) : null, 'dataBlocks': dataBlocks, } %}