{% extends '@OroUI/actions/update.html.twig' %} {% form_theme form with ['@OroAddress/Include/fields.html.twig', '@OroForm/Form/fields.html.twig'] %} {% oro_title_set({params : {"%lead.name%": entity.name} }) %} {% set formAction = form.vars.value.id ? path('oro_sales_lead_update', { 'id': form.vars.value.id }) : path('oro_sales_lead_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.deleteButton({ 'dataUrl': path('oro_api_delete_lead', {'id': form.vars.value.id}), 'dataRedirect': path('oro_sales_lead_index'), 'aCss': 'no-hash remove-button', 'id': 'btn-remove-lead', 'dataId': form.vars.value.id, 'entity_label': 'oro.sales.lead.entity_label'|trans }) }} {{ UI.buttonSeparator() }} {% endif %} {{ UI.cancelButton(path('oro_sales_lead_index')) }} {% set html = UI.saveAndCloseButton({ 'route': 'oro_sales_lead_view', 'params': {'id': '$id'} }) %} {% if is_granted('oro_sales_lead_create') %} {% set html = html ~ UI.saveAndNewButton({ 'route': 'oro_sales_lead_create' }) %} {% endif %} {% if form.vars.value.id or is_granted('oro_sales_lead_update') %} {% set html = html ~ UI.saveAndStayButton({ 'route': 'oro_sales_lead_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_lead_index'), 'indexLabel': 'oro.sales.lead.entity_plural_label'|trans, 'entityTitle': entity.name } %} {{ parent() }} {% else %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'oro.sales.lead.entity_label'|trans}) %} {% include '@OroUI/page_title_block.html.twig' with { title: title } %} {% endif %} {% endblock pageHeader %} {% block stats %}
  • {{ 'oro.ui.created_at'|trans }}: {{ entity.createdAt ? entity.createdAt|oro_format_datetime : 'N/A' }}
  • {{ 'oro.ui.updated_at'|trans }}: {{ entity.updatedAt ? entity.updatedAt|oro_format_datetime : 'N/A' }}
  • {% endblock stats %} {% block breadcrumbs %} {% import '@OroUI/macros.html.twig' as UI %} {{ parent() }} {{ UI.badge(entity.status.name, entity.status.id != 'canceled' ? 'enabled' : 'disabled') }} {% endblock breadcrumbs %} {% block content_data %} {% set id = 'lead-profile' %} {% set formFields = [] %} {% if form.owner is defined %} {% set formFields = formFields|merge([form_row(form.owner)]) %} {% endif %} {% set secondInformationBlock = [ form_row(form.source) ] %} {% if feature_enabled('marketing') %} {% set secondInformationBlock = secondInformationBlock | merge([ form_row(form.campaign) ]) %} {% endif %} {% set secondInformationBlock = secondInformationBlock | merge([ form_row(form.notes) ]) %} {% set dataBlocks = [{ 'title': 'General'|trans, 'subblocks': [ { 'title': 'oro.sales.lead.information'|trans, 'data': formFields|merge([ form_row(form.name), form_row(form.status), form_row(form.companyName), ]) }, { 'data': secondInformationBlock }, ] }] %} {% set dataBlocks = dataBlocks|merge([{ 'title': 'oro.sales.lead.contact_information.label'|trans, 'subblocks': [ { 'data': [ form_row(form.namePrefix), form_row(form.firstName), form_row(form.middleName), form_row(form.lastName), form_row(form.nameSuffix), form_row(form.jobTitle), form_row(form.emails), form_row(form.phones), form_row(form.contact), form_row(form.customerAssociation), form_row(form.twitter), form_row(form.linkedIn) ] }, { 'title': 'oro.contact.addresses.label'|trans, 'data': [ form_widget(form.addresses) ] }, ] }] ) %} {% set additionalData = [ form_row(form.website), form_row(form.numberOfEmployees), form_row(form.industry) ] %} {% set dataBlocks = dataBlocks|merge(oro_form_additional_data(form, 'Additional'|trans, additionalData)) %} {% set data = { 'formErrors': form_errors(form)? form_errors(form) : null, 'dataBlocks': dataBlocks, } %} {{ parent() }} {% endblock content_data %}