{% extends 'OroUIBundle:actions:view.html.twig' %} {% import 'OroUIBundle::macros.html.twig' as macros %} {% oro_title_set({params : {"%cart.id%": entity.originId} }) %} {% block pageHeader %} {% set breadcrumbs = { 'entity': entity, 'indexPath': path('orocrm_magento_cart_index'), 'indexLabel': 'orocrm.magento.cart.entity_plural_label'|trans, 'entityTitle': 'orocrm.magento.entity_number'|trans({'%entityName%': 'orocrm.magento.cart.entity_label'|trans, '%entityNumber%': entity.originId}) } %} {{ parent() }} {% endblock pageHeader %} {% block breadcrumbMessage %} {% if entity.statusMessage %}
{{ entity.statusMessage|trans }}
{% endif %} {% endblock breadcrumbMessage %} {% block navButtons %} {{ UI.button({ 'path': path('orocrm_magento_cart_actualize', {'id': entity.id}), 'label': 'orocrm.magento.cart.refresh_label'|trans, 'title': 'orocrm.magento.cart.refresh_label'|trans, 'iCss': 'icon-refresh' }) }} {% endblock navButtons %} {% block content_data %} {% set generalSubblocks = [] %} {% set cartInformationWidget %} {{ oro_widget_render({ 'widgetType': 'block', 'url': path('orocrm_magento_cart_widget_info', {id: entity.id}), 'title': 'orocrm.magento.cart_information'|trans }) }} {% endset %} {% set generalSubblocks = generalSubblocks|merge([{'data' : [cartInformationWidget] }]) %} {% if entity.customer %} {% set customerInformationWidget %} {{ oro_widget_render({ 'widgetType': 'block', 'url': path('orocrm_magento_customer_info', {id: entity.customer.id}), 'title': 'orocrm.magento.customer_information'|trans }) }} {% endset %} {% set generalSubblocks = generalSubblocks|merge([{'data' : [customerInformationWidget] }]) %} {% endif %} {% if entity.opportunity %} {% set opportunityInfoWidget %} {{ oro_widget_render({ 'widgetType': 'block', 'url': path('orocrm_sales_opportunity_info', { id: entity.opportunity.id }), 'title': 'Opportunity Information' }) }} {% endset %} {% set generalSubblocks = generalSubblocks|merge([{'data' : [opportunityInfoWidget] }]) %} {% endif %} {% set cartItemsWidget %} {{ oro_widget_render({ 'widgetType': 'block', 'url': path('orocrm_magento_cart_widget_items', {id: entity.id}) }) }} {% endset %} {% set dataBlocks = [ { 'title': 'orocrm.magento.general_information'|trans, 'class': 'active', 'subblocks': generalSubblocks }, { 'title': 'orocrm.magento.cart.cart_items.label'|trans, 'subblocks': [ {'data' : [cartItemsWidget] } ] }, ] %} {% set relatedInformation = [] %} {% if resource_granted('oro_email_view') %} {% set emailIds = [] %} {% for email in entity.getRelatedEmails %} {% set emailIds = emailIds|merge([email.id]) %} {% endfor %} {% if emailIds is empty %} {% set emailIds = [0] %} {% endif %} {% set cartEmailsWidget %} {{ oro_widget_render({ 'widgetType': 'block', 'url': path('oro_email_widget_base_emails', {'emailIds': emailIds}), 'title': 'oro.email.entity_plural_label'|trans, 'alias': 'cart_emails' }) }} {% endset %} {% set relatedInformation = relatedInformation|merge([ {'data' : [cartEmailsWidget]} ]) %} {% endif %} {% if resource_granted('orocrm_call_view') %} {% set callIds = [] %} {% for call in entity.getRelatedCalls %} {% set callIds = callIds|merge([call.id]) %} {% endfor %} {% if callIds is empty %} {% set callIds = [0] %} {% endif %} {% set cartCallsWidget %} {{ oro_widget_render({ 'widgetType': 'block', 'url': path('orocrm_call_base_widget_calls', {'callIds': callIds}), 'title': 'orocrm.call.entity_plural_label'|trans, 'alias': 'cart_calls' }) }} {% endset %} {% set relatedInformation = relatedInformation|merge([ {'data' : [cartCallsWidget]} ]) %} {% endif %} {% if relatedInformation is not empty %} {% set dataBlocks = dataBlocks|merge([ { 'title': 'orocrm.magento.communications'|trans, 'subblocks': relatedInformation } ]) %} {% endif %} {% set id = 'magentoCartView' %} {% set data = {'dataBlocks': dataBlocks} %} {{ parent() }} {% endblock content_data %}