{% extends 'OroUIBundle:actions:update.html.twig' %} {% import 'OroCRMChannelBundle::macros.html.twig' as channelMacro %} {% set entity = form.vars.value %} {% set formAction = entity.id ? path('orocrm_channel_update', { id: entity.id }) : path('orocrm_channel_create') %} {% if entity.id %} {% oro_title_set({params : {"%channel.name%": entity.name } }) %} {% endif %} {% block pageHeader %} {% if entity.id %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('orocrm_channel_index'), 'indexLabel': 'orocrm.channel.entity_plural_label'|trans, 'entityTitle': entity.name|default('N/A') } %} {{ parent() }} {% else %} {% set title = 'oro.ui.create_entity'|trans({'%entityName%': 'orocrm.channel.entity_label'|trans}) %} {% include 'OroUIBundle::page_title_block.html.twig' with { title: title }%} {% endif %} {% endblock pageHeader %} {% block navButtons %} {% if entity.id and resource_granted('DELETE', entity) %} {{ UI.deleteButton({ 'dataUrl': path('orocrm_api_delete_channel', {'id': entity.id}), 'dataRedirect': path('orocrm_channel_index'), 'aCss': 'no-hash remove-button', 'id': 'btn-remove-channel', 'dataId': entity.id, 'entity_label': 'orocrm.channel.entity_label'|trans, }) }} {{ UI.buttonSeparator() }} {% endif %} {{ UI.cancelButton(path('orocrm_channel_index')) }} {% set html = UI.saveAndCloseButton() %} {% if form.vars.value.id or resource_granted('orocrm_channel_update') %} {% set html = html ~ UI.saveAndStayButton() %} {% endif %} {{ UI.dropdownSaveButton({'html': html}) }} {% endblock %} {% block breadcrumbs %} {{ parent() }}
{% if entity.status %}
{{ 'orocrm.channel.active.label'|trans }}
{% else %}
{{ 'orocrm.channel.inactive.label'|trans }}
{% endif %}
{% endblock breadcrumbs %} {% block content_data %} {% set id = 'channel-update' %} {% set dataBlocks = [ { 'title': 'General'|trans, 'subblocks': [{ 'title': '', 'data': [ form_row(form.status), form_row(form.name), form_row(form.channelType), form.dataSource is defined ? form_row(form.dataSource) : '', ] }] }, { 'title': 'Entities'|trans, 'subblocks': [{ 'title': '', 'data': [ form_row(form.entities) ] }] } ] %} {% set data = { 'formErrors': form_errors(form)? form_errors(form) : null, 'dataBlocks': dataBlocks, } %} {{ parent() }} {{ channelMacro.initializeChannelForm(form, orocrm_channel_entities_metadata(), entity.customerIdentity) }} {% endblock %}