{% extends 'showElements_base.html.twig' %} {% block title %}{{ 'All actions'|trans }}{% endblock %} {% block breadcrumb_buttons %} {% set filter_privileges = {"user": app.user, "role": "ROLE_CREATE"} %} {% if plan %} {% set filter_privileges = filter_privileges|merge({'plan': plan}) %} {% endif %} {% if privileges.canAction(filter_privileges) %} {% endif %} {% endblock %} {% block extra_breadcrumb_buttons %} {% endblock %} {% block body_content %}
{% if plan_company_entity and plan_company_entity.validated %}
{{ 'actions.plan_is_closed'|trans|upper }}
{% endif %}
{% if plan and plans_edition is not empty and plans_edition|length > 1 %} {% elseif plan %} {{ 'actions.plan'|trans }}: {{plan.title}} {% endif %}
{% if plan_rowid and plan_status and app.user.fkCompanyEntity.fkLevel.rowid < 3 %}
{% for pc in partner_contracts %}
{{pc.getName()}}
{% endfor %}
{% for pc in partner_contracts %}
{% endfor %}
{% for dep in departments %}
{{dep.getName()}}
{% for pc in partner_contracts %}
{{plan_status[dep.rowid][pc.rowid]['m'][0]}} {{ "n_of_m"|trans }} {{plan_status[dep.rowid][pc.rowid]['m'][1]}} {% if plan_status[dep.rowid][pc.rowid]['m'][0] < plan_status[dep.rowid][pc.rowid]['m'][1] %} {% set can_validate = 0 %} {% if privileges.canAction({'plan': plan, 'user': app.user, 'role': 'ROLE_CREATE'}) %} {% else %} {% endif %} {% else %} {% endif %}
{{plan_status[dep.rowid][pc.rowid]['a'][0]}} {{ "n_of_m"|trans }} {{plan_status[dep.rowid][pc.rowid]['a'][1]}} {% if plan_status[dep.getRowid()][pc.getRowid]['a'][0] < plan_status[dep.getRowid()][pc.getRowid]['a'][1] %} {% set can_validate = 0 %} {% if privileges.canAction({'plan': plan, 'user': app.user, 'role': 'ROLE_CREATE'}) %} {% else %} {% endif %} {% else %} {% endif %}
{% endfor %}
{% endfor %} {% endif %} {% if plan_rowid is empty %} {% endif %} {% for action in actions %} {# ToDo: Desplazar la comprobación de si la acción va, o no va, al propio controlador #} {% if (privileges.canAction({"user": app.user, "action": action, "role": "ROLE_READ"})) and ((plan_rowid and plan_status and (app.user.fkCompanyEntity.fkLevel.rowid == action.fklevel.rowid)) or (not plan_rowid)) %} {% set bmandatory = (( action.fklevel.code == "europe" or action.fklevel.code == "market") and action.mandatory == 1) %} {% if plan_rowid is empty %} {% endif %} {% set can_edit_action = privileges.canAction({"user": app.user, "action": action, "role": "ROLE_UPDATE"}) %} {% set can_delete_action = privileges.canAction({"user": app.user, "action": action, "role": "ROLE_DELETE"}) %} {% set can_read_plan = is_granted("ROLE_EUROPE") and privileges.canAction({"user": app.user, "action": action, "role": "ROLE_READ"}) %} {% set can_milestone = privileges.canMilestone({ "user": app.user, "role": "ROLE_CREATE" }) %} {% endif %} {% endfor %}
{{ 'actions.title'|trans }} {{ 'actions.description'|trans }}{{ 'actions.plan'|trans }}{{ 'actions.timing'|trans }} {{ 'actions.notification_from'|trans }} {{ 'actions.documents'|trans }} {{ 'actions.options'|trans }}
{{ action.rowid }}
{% if action.fklevel.code == "europe" %}
{% if bmandatory %} {%endif %}
{% elseif action.fklevel.code == "market" %}
{% if bmandatory %} {%endif %}
{% else %}
{% endif %}
{{action.fkDepartment.code|upper}}
{% if action.partnerContracts|length == 3 %}
{{'all'|trans}}
{% else %} {%for pc in action.partnerContracts %}
{{pc.code}}
{% endfor %} {% endif %}
{{ action.title }} {{ action.description }}{{ action.fkPlan.title }}{{ action.getTimingString() }} {{ (action.getNotificationFrom())?action.getNotificationFrom().format('Y-m-d'):"" }} {% if can_edit_action or can_delete_action or can_read_plan %} {% endif %}
{% if plan and is_granted("ROLE_MARKET") and is_granted("ROLE_APPROVE") and can_validate and privileges.canAction({"user": app.user, "plan": plan, "role": "ROLE_APPROVE"})%}
{% endif %}
{% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}