{% macro displaySession(studentSession, formation, specificCounters) %} {% import "Pdf/session.html.twig" as sessionItem %} {% set aircraft = studentSession.session.aircraft %}

{% set lessonLabel = studentSession.session.formation.ato.dictionary.lesson.label %} {{ lessonLabel }} {{ studentSession.session.lesson ? studentSession.session.lesson.name : studentSession.session.lessonExtra ? studentSession.session.lessonExtra.name ~ " - " : '' }} {% if studentSession.session.lessonExtra and studentSession.session.lessonExtra.isTest %} {{ lessonLabel }} {{ "de test"|trans }} {% elseif studentSession.session.lessonExtra and studentSession.session.lessonExtra.lesson is not null %} {{ lessonLabel }} {{ "dupliqué"|trans }} {% elseif studentSession.session.lessonExtra %} {{ lessonLabel }} {{ "supplémentaire"|trans }} {% endif %} {# Lesson ratings #} {% if (studentSession.session.lesson is not null and studentSession.session.lesson.notation is not null) or formation.lessonNotation is not null %} | {% for ratingValue in (studentSession.session.lesson is not null and studentSession.session.lesson.notation is not null ? studentSession.session.lesson.notation.ratingValues : formation.lessonNotation.ratingValues) %} {% if ratingValue.mediaValue is not empty %} note {% else %} {{ ratingValue.value }} {% endif %} {% endfor %} {% endif %}

{{ "Informations" }}
{{ "Date"|trans }}: {{ studentSession.session.startAt | localizeddate('short', 'none') }}
{{ "Appareil"|trans }}: {% if aircraft is not null %}{{ studentSession.session.aircraft.registration }}{% else %}{{ "Non défini"|trans }}{% endif %}
{{ "Instructeur"|trans }}: {{ studentSession.session.instructor.user.completeName }} - {{ studentSession.session.instructor.user.licenceNumber }}
{% if (studentSession.session.lessonExtra is not null ? studentSession.session.lessonExtra : studentSession.session.lesson).goals %}
{{ "Objectifs"|trans }}: {{ (studentSession.session.lessonExtra is not null ? studentSession.session.lessonExtra : studentSession.session.lesson).goals }}
{% endif %} {% if (studentSession.session.lessonExtra is not null ? studentSession.session.lessonExtra : studentSession.session.lesson).description %}
{{ "Description"|trans }}: {{ (studentSession.session.lessonExtra is not null ? studentSession.session.lessonExtra : studentSession.session.lesson).description }}
{% endif %}
{{ "Durée" | trans }}: {% if studentSession.session.sessionDuration %} {{ studentSession.session.sessionDuration }} {# {{ calculateTimeLeft(convertStringToMinute(studentSession.session.sessionDuration), studentSession.session.lesson ? studentSession.session.lesson.expectedDuration ?? studentSession.session.lesson.standardDuration : studentSession.session.sessionDuration) }} #} {% else %} {{ "Non défini" |trans }} {% endif %}
{{ "Temps de bloc" | trans }}: {% if formation.timeBlocManagement %} {{ convertMinuteToString(studentSession.session.blocTime) }} {# {{ calculateTimeLeft(studentSession.session.blocTime, studentSession.session.lesson ? studentSession.session.lesson.expectedDuration ?? studentSession.session.lesson.standardDuration : studentSession.session.sessionDuration) }} #} {% else %} {{ "Non défini" |trans }} {% endif %}
{{ "Temps de vol" | trans }}: {% if formation.flightTimeManagment %} {{ convertMinuteToString(studentSession.session.flightTime) }} {# {{ calculateTimeLeft(studentSession.session.flightTime, studentSession.session.lesson ? studentSession.session.lesson.expectedDuration ?? studentSession.session.lesson.standardDuration : studentSession.session.sessionDuration) }} #} {% else %} {{ "Non défini" |trans }} {% endif %}
{{ "Départ" }}
  • {{ "Date et heure" }}: {{ studentSession.session.startAt | date('d/m/Y h:i') }}
  • {{ "Aérodrome" }}: {% if studentSession.session.departureAirport is not null %} {{ studentSession.session.departureAirport.code }}{% endif %}
{{ "Arrivée" }}
  • {{ "Date et heure" }}: {{ studentSession.session.endAt | date('d/m/Y h:i') }}
  • {{ "Aérodrome" }}: {% if studentSession.session.arrivalAirport is not null %} {{ studentSession.session.arrivalAirport.code }}{% endif %}
{% if studentSession.session.counters is not empty %}
{{ "Indicateurs"|trans }}

{% endif %} {% if studentSession.session.sessionSkills is not empty %}
{{ "CT et CNT" }}

{{ "CT" | trans }}


    {% for sessionSkill in studentSession.session.technicalSkills %}
  • {{ sessionSkill.skill.name }}{% if sessionSkill.note %}: {% endif %} {{ sessionSkill.note ? sessionSkill.note.value : "" }}
  • {% endfor %}

{{ "CNT" | trans }}


    {% for sessionSkill in studentSession.session.notTechnicalSkills %}
  • {{ sessionSkill.skill.name }}{% if sessionSkill.note %}: {% endif %} {{ sessionSkill.note ? sessionSkill.note.value : "" }}
  • {% endfor %}

{% endif %}
{{ "Contenu de la séance"|trans }} {% if studentSession.session.lesson is not null %} {{ sessionItem.children_render(studentSession.session.lesson.children, studentSession.session.formation, studentSession.session.lesson, 0, studentSession.session) }}
{% elseif studentSession.session.lessonExtra is not null %} {{ sessionItem.children_render(studentSession.session.lessonExtra.children, studentSession.session.formation, studentSession.session.lessonExtra, 0, studentSession.session) }}
{% endif %}

{% if studentSession.session.additionalItems is not empty %} {% set notations = get_notations(formation.children, formation) %}
{{ "{exerciseLabel}s additionnels" | trans({'{exerciseLabel}': formation.ato.dictionary["exercise"]['label']}) }} {% for additionalItem in studentSession.session.additionalItems %} {% set childType = "App\\Entity\\Formation\\Exercise" %} {% if additionalItem.formationItem.notation %} {% set notation = additionalItem.formationItem.notation %} {% else %} {% set notation = formation.exercisesNotation %} {% endif %} {% if isExercise(additionalItem.formationItem) and formation.evaluateSkillsInExercises and additionalItem.formationItem.skills.count > 0 %} {% for skill in additionalItem.formationItem.skills %} {% set skillValue = get_skill_notation_value(additionalItem, skill) %} {% if formation.evaluateSkillsIndicators and skill.ratingSystemIndicator and skill.details and skill.details.count > 0 %} {% for detail in skill.details %} {% set indicatorValue = get_indicator_notation_value(additionalItem, detail) %} {% endfor %} {% endif %} {% endfor %} {% endif %} {% endfor %}
{{ additionalItem.formationItem.name }}
{% if additionalItem.formationItem.description %}
{{ additionalItem.formationItem.description }}
{% endif %} {% if additionalItem.formationItem.goals %}
{{ additionalItem.formationItem.goals }}
{% endif %}
{% if notation is defined and notation is not null %} {% for ratingValue in notation.ratingValues %} {% endfor %}
{% if ratingValue.mediaValue is not empty %} note {% else %} {{ ratingValue.value }} {% endif %}
{% endif %}
{{ skill.name }} ({{ (skill.type == "technical" ? "compétence technique" : skill.type == "non technical" ? "compétence non technique" : "compétence ni technique ni non technique")|trans }})
{% if skill.description %}
{{ skill.description }}
{% endif %}
{% if formation.skillsNotation is defined and formation.skillsNotation is not null %} {% for ratingValue in formation.skillsNotation.ratingValues %} {% endfor %}
{% if ratingValue.mediaValue is not empty %} note {% else %} {{ ratingValue.value }} {% endif %}
{% endif %}
{{ detail.description }}
{% if formation.indicatorsNotation is defined and formation.indicatorsNotation is not null %} {% for ratingValue in formation.indicatorsNotation.ratingValues %} {% endfor %}
{% if ratingValue.mediaValue is not empty %} note {% else %} {{ ratingValue.value }} {% endif %}
{% endif %}

{% endif %}
{{ "Commentaire de l'instructeur"|trans }}
{{ studentSession.session.comments }}

{{ "Signatures" }}
{{ "Instructeur"|trans }}: {{ studentSession.session.instructorSignature ? studentSession.session.instructorSignature.atoUser.user.completeName ~ " - " ~ studentSession.session.instructorSignature.atoUser.user.licenceNumber : "" }}
{{ "Date"|trans }}: {{ studentSession.session.instructorSignature ? studentSession.session.instructorSignature.date | date('d/m/Y h:i:s') : "" }}
{{ "Pilote"|trans }}: {{ studentSession.signature ? studentSession.signature.atoUser.user.completeName : "" }}
{{ "Date"|trans }}: {{ studentSession.signature ? studentSession.signature.date | date('d/m/Y h:i:s') : "" }}
{% endmacro %}