{% import 'OroUIBundle::macros.html.twig' as UI %} {% macro renderCollection(collection, sale) %} {% import 'OroUIBundle::macros.html.twig' as UI %} {% set pos = [] %} {% set saleId = sale %} {% for element in collection %} {% set pos = pos|merge([element]) %} {% endfor %} {% for po in pos %} {% import 'OroUIBundle::macros.html.twig' as UI %}
{{ UI.clientLink({ 'dataUrl': path('sv_po_update', { 'id': po.id, 'saleId': saleId }), 'aCss': 'no-hash', 'class': 'btn item-edit-button', 'iCss': 'icon-edit hide-text', 'widget' : { 'type' : 'dialog', 'multiple' : false, 'options' : { 'alias': 'po-dialog', 'dialogOptions' : { 'title' : 'Edit PO', 'allowMaximize': true, 'allowMinimize': true, 'dblclick': 'maximize', 'maximizedHeightDecreaseBy': 'minimize-bar', 'width': 1000 } } }, }) }} {{ UI.clientLink({ 'dataUrl': path('sv_api_delete_po', {'id': po.id}) , 'dataRedirect': path('svwd_sale_view', { 'id': saleId}), 'aCss': 'no-hash', 'class': 'item-remove-button', 'iCss': 'icon-trash hide-text', 'id': 'btn-remove-contact', 'dataId': po.id, 'entity_label': 'PO', }) }}

{{po.poNumber}}

{% endfor %} {% endmacro %}
{# JS template for address view #} {% include "OroAddressBundle:Js:address.js.twig" %} {# widget container and actions #}
{{ UI.clientLink({ 'dataUrl': path('sv_po_create', { 'saleId': entity.id }), 'aCss': 'no-hash', 'class': 'btn btn-mini btn-primary btn-uppercase', 'label': '+ Add PO', 'widget' : { 'type' : 'dialog', 'multiple' : false, 'options' : { 'alias': 'po-dialog', 'dialogOptions' : { 'title' : 'Add PO', 'allowMaximize': true, 'allowMinimize': true, 'dblclick': 'maximize', 'maximizedHeightDecreaseBy': 'minimize-bar', 'width': 1000 } } }, }) }}
{{ entity.poNumbers.count ? _self.renderCollection(entity.poNumbers, entity.id) : null }}