{% extends '@App/app.html.twig' %} {% block title %}Préparation manager{% endblock %} {% block page_header %}{% endblock %} {% block content %} {% set employee = interview.salarie %} {% set photo_path = employee.photo ? employee.photo|trim : null %} {% set avatar_src = photo_path ? (photo_path starts with 'http://' or photo_path starts with 'https://' ? photo_path : asset(photo_path starts with '/' ? photo_path|slice(1) : photo_path)) : null %} {% set initials = ((employee.prenom|default('')|first) ~ (employee.nom|default('')|first))|upper ?: 'S' %} {% set questions_by_section = {} %} {% set orphan_questions = [] %} {% for question in questions %} {% if question.section %} {% set key = 'section_' ~ question.section.id %} {% set questions_by_section = questions_by_section|merge({(key): (questions_by_section[key]|default([]))|merge([question])}) %} {% else %} {% set orphan_questions = orphan_questions|merge([question]) %} {% endif %} {% endfor %} {% macro render_question(question, answers) %} {% set answer = answers[question.id]|default(null) %} {% set value = answer ? (answer.answerJson ?: answer.answerText) : '' %}
{% endmacro %} {% macro objective_fields(objective, key) %}
{% if not objective %}{% endif %}
{% endmacro %} {% import _self as manager_form %}

Préparation manager

Retour à la liste
{% if avatar_src %}{{ employee }}{% else %}{{ initials }}{% endif %}
{{ employee }}{{ employee.poste ?: 'Fonction non renseignée' }}
Service
{{ employee.service ?: 'Non renseigné' }}
Type d’entretien
{{ interview.type.nom }}
Date prévue
{{ interview.scheduledAt ? interview.scheduledAt|date('d/m/Y') : 'Non définie' }}
Statut
Préparation manager
{% set section_number = 0 %} {% for section in sections %} {% set section_key = 'section_' ~ section.id %} {% set section_questions = questions_by_section[section_key]|default([]) %} {% if section_questions is not empty %} {% set section_number = section_number + 1 %}

{{ section_number }}. {{ section.titre }}

{% if section.description %}

{{ section.description }}

{% endif %}
{% for question in section_questions %}{{ manager_form.render_question(question, answers) }}{% endfor %}
{% endif %} {% endfor %} {% if orphan_questions is not empty %} {% set section_number = section_number + 1 %}

{{ section_number }}. Questions complémentaires

{% for question in orphan_questions %}{{ manager_form.render_question(question, answers) }}{% endfor %}
{% endif %} {% set section_number = section_number + 1 %}

{{ section_number }}. Objectifs précédents

ObjectifStatutProgressionCommentaire manager
{% for objective in previous_objectives %}
{{ objective.title }}{{ objective.targetDate ? 'Échéance : ' ~ objective.targetDate|date('d/m/Y') : 'Sans échéance' }}
{{ objective.progress >= 100 ? 'Atteint' : 'En cours' }}
{{ objective.progress }}%
{% else %}
Aucun objectif précédent n’est enregistré pour ce salarié.
{% endfor %}
{% set section_number = section_number + 1 %}

{{ section_number }}. Évaluation des compétences

{% for assessment in skill_assessments %}
{{ assessment.skill.nom }}{{ assessment.skill.description ?: 'Compétence à évaluer' }}
{% for rating in 1..5 %}{% endfor %}
{% else %}
Aucune compétence n’est associée à cet entretien.
{% endfor %}
{% set section_number = section_number + 1 %}

{{ section_number }}. Objectifs à proposer

{% for objective in proposed_objectives %}{{ manager_form.objective_fields(objective, objective.id) }}{% endfor %} {{ manager_form.objective_fields(null, 'new_0') }}
{% endblock %}