{% extends '@OroUI/actions/update.html.twig' %} {% set formAction = form.vars.value.id ? path('oro_contactus_request_update', { 'id': form.vars.value.id }) : path('oro_contactus_request_create') %} {% set fullname = form.vars.value|oro_format_name|default('N/A'|trans) %} {% oro_title_set({ params : {"%request.clientName%": fullname} }) %} {% set formAttr = { "data-validation": { "Oro\\Bundle\\ContactUsBundle\\Validator\\ContactRequestCallbackValidator": { "target": "preferredContactMethod", "deps": { "oro.contactus.contactrequest.method.both": ["emailAddress", "phone"], "oro.contactus.contactrequest.method.phone": "phone", "oro.contactus.contactrequest.method.email": "emailAddress" } } } } %} {% block navButtons %} {% import '@OroUI/macros.html.twig' as UI %} {% if form.vars.value.id and is_granted('oro_contactus_request_delete') %} {{ UI.deleteButton({ 'dataUrl': path('oro_contactus_request_delete', {'id': form.vars.value.id}), 'dataRedirect': path('oro_contactus_request_index'), 'aCss': 'no-hash remove-button', 'id': 'btn-remove-contact-request-form', 'dataId': form.vars.value.id, 'entity_label': 'oro.contactus.contactrequest.entity_label'|trans, }) }} {{ UI.buttonSeparator() }} {% endif %} {{ UI.button({'path' : path('oro_contactus_request_index'), 'title' : 'Cancel'|trans, 'label' : 'Cancel'|trans}) }} {% set html = UI.saveAndCloseButton({ 'route': 'oro_contactus_request_view', 'params': {'id': '$id'} }) %} {% if is_granted('oro_contactus_request_create') %} {% set html = html ~ UI.saveAndNewButton({ 'route': 'oro_contactus_request_create' }) %} {% endif %} {% if is_granted('oro_contactus_request_edit') %} {% set html = html ~ UI.saveAndStayButton({ 'route': 'oro_contactus_request_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_contactus_request_index'), 'indexLabel': 'oro.contactus.contactrequest.entity_plural_label'|trans, 'entityTitle': fullname } %} {{ parent() }} {% else %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.contactus.contactrequest.entity_label'|trans}) %} {% include '@OroUI/page_title_block.html.twig' with { title: title } %} {% endif %} {% endblock pageHeader %} {% block content_data %} {% set id = 'contact-request-form' %} {% set dataBlocks = [{ 'title': 'oro.contactus.block.general'|trans, 'class': 'active', 'subblocks': [ { 'title': 'oro.contactus.block.request_information'|trans, 'data': [ form_row(form.firstName), form_row(form.lastName), form_row(form.organizationName), form_row(form.preferredContactMethod), form_row(form.phone), form_row(form.emailAddress), form_row(form.contactReason), form_row(form.comment) ] } ] }] %} {% set dataBlocks = dataBlocks|merge(oro_form_additional_data(form, 'oro.contactus.block.additional'|trans)) %} {% set data = { 'formErrors': form_errors(form)? form_errors(form) : null, 'dataBlocks': dataBlocks, } %} {{ parent() }} {% endblock content_data %}