{% macro renderRestrictionsView(scopeEntities, scopes) %} {% import _self as self %} {% if scopes is empty or oro_scope_is_empty(scopeEntities, scopes) %} {{ 'N/A'|trans }} {% else %} {% set gridHtml = self.renderRestrictionsViewGrid(scopeEntities, scopes) %} {{ gridHtml }} {% endif %} {% endmacro %} {% macro renderRestrictionsViewGrid(scopeEntities, scopes, extraData = []) %}
{{ _self.renderRestrictionsViewGridHead(scopeEntities, extraData|first|keys) }} {{ _self.renderRestrictionsViewGridRows(scopeEntities, scopes, extraData) }}
{% endmacro %} {% macro renderRestrictionsViewGridHead(scopeEntities, extraColumns = []) %} {% for entityClass in scopeEntities %} {{ oro_entity_config_value(entityClass, 'label')|trans }} {% endfor %} {% for extraColumn in extraColumns %} {{ extraColumn }} {% endfor %} {% endmacro %} {% macro renderRestrictionsViewGridRows(scopeEntities, scopes, extraData = []) %} {% for key, scope in scopes %} {% for fieldName, entityClass in scopeEntities %} {{ attribute(scope, fieldName) ? : 'Any'|trans }} {% endfor %} {% for extraDataValue in extraData[key] ?? [] %} {{ extraDataValue != '' ? extraDataValue : 'Any'|trans }} {% endfor %} {% endfor %} {% endmacro %}