<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* intervention/_popup_history_planification.html.twig */
class __TwigTemplate_5212440924be97082ac782d01c4828ab9864478fa204214db1a64a3a2820d5f8 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "intervention/_popup_history_planification.html.twig"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "intervention/_popup_history_planification.html.twig"));

        // line 1
        yield "<div id=\"popup-history-planification-";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["intervention"]) || array_key_exists("intervention", $context) ? $context["intervention"] : (function () { throw new RuntimeError('Variable "intervention" does not exist.', 1, $this->source); })()), "id", [], "any", false, false, false, 1), "html", null, true);
        yield "\" style=\"display:none\">
    ";
        // line 2
        $context["historiquePlanification"] = ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["intervention"]) || array_key_exists("intervention", $context) ? $context["intervention"] : (function () { throw new RuntimeError('Variable "intervention" does not exist.', 2, $this->source); })()), "planning", [], "any", false, false, false, 2)) ? (Twig\Extension\CoreExtension::sort($this->env, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["intervention"]) || array_key_exists("intervention", $context) ? $context["intervention"] : (function () { throw new RuntimeError('Variable "intervention" does not exist.', 2, $this->source); })()), "planning", [], "any", false, false, false, 2), "getPlanningHistoriqueModifications", [], "any", false, false, false, 2), function ($__a__, $__b__) use ($context, $macros) { $context["a"] = $__a__; $context["b"] = $__b__; return (((1 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, (isset($context["a"]) || array_key_exists("a", $context) ? $context["a"] : (function () { throw new RuntimeError('Variable "a" does not exist.', 2, $this->source); })()), "dateAction", [], "any", false, false, false, 2), CoreExtension::getAttribute($this->env, $this->source, (isset($context["b"]) || array_key_exists("b", $context) ? $context["b"] : (function () { throw new RuntimeError('Variable "b" does not exist.', 2, $this->source); })()), "dateAction", [], "any", false, false, false, 2)))) ? ( -1) : (1)); })) : ([]));
        // line 3
        yield "    <table class=\"table table-responsive table-bordered table-sm table-inverse-color-datagrid mb-0\">
        <thead align=\"center\" style=\"vertical-align: middle!important;\">
            <th>Date action</th>
            <th>Utilisateur</th>
            <th>Motif action</th>
            <th>Type planification</th>
            <th>Agent planning</th>
            <th>Agent terrain</th>
        </thead>
        <tbody>
            ";
        // line 13
        if ((1 === CoreExtension::compare(Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["historiquePlanification"]) || array_key_exists("historiquePlanification", $context) ? $context["historiquePlanification"] : (function () { throw new RuntimeError('Variable "historiquePlanification" does not exist.', 13, $this->source); })())), 0))) {
            // line 14
            yield "                ";
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable((isset($context["historiquePlanification"]) || array_key_exists("historiquePlanification", $context) ? $context["historiquePlanification"] : (function () { throw new RuntimeError('Variable "historiquePlanification" does not exist.', 14, $this->source); })()));
            foreach ($context['_seq'] as $context["_key"] => $context["historique"]) {
                // line 15
                yield "                    <tr>
                        <td class=\"text-center\">";
                // line 16
                ((CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "dateAction", [], "any", false, false, false, 16)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "dateAction", [], "any", false, false, false, 16), "d/m/Y H:i"), "html", null, true)) : (yield ""));
                yield "</td>
                        <td class=\"text-center\">";
                // line 17
                ((CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "utilisateur", [], "any", false, false, false, 17)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "utilisateur", [], "any", false, false, false, 17), "getCodeNom", [], "any", false, false, false, 17), "html", null, true)) : (yield ""));
                yield "</td>
                        <td class=\"text-center\">";
                // line 18
                ((CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "planningAction", [], "any", false, false, false, 18)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "planningAction", [], "any", false, false, false, 18), "libelle", [], "any", false, false, false, 18), "html", null, true)) : (yield ""));
                yield "</td>
                        <td class=\"text-center\">";
                // line 19
                ((CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "typePlanification", [], "any", false, false, false, 19)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "typePlanification", [], "any", false, false, false, 19), "code", [], "any", false, false, false, 19), "html", null, true)) : (yield ""));
                yield "</td>
                        <td class=\"text-center\">";
                // line 20
                ((CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "utilisateurPlanning", [], "any", false, false, false, 20)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "utilisateurPlanning", [], "any", false, false, false, 20), "getCodeNom", [], "any", false, false, false, 20), "html", null, true)) : (yield ""));
                yield "</td>
                        <td class=\"text-center\">";
                // line 21
                ((CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "utilisateurAgent", [], "any", false, false, false, 21)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["historique"], "utilisateurAgent", [], "any", false, false, false, 21), "getCodeNom", [], "any", false, false, false, 21), "html", null, true)) : (yield ""));
                yield "</td>
                    </tr>
                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['historique'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 24
            yield "            ";
        } else {
            // line 25
            yield "                <tr style=\"height: 40px\">
                    <td colspan=\"6\" class=\"text-center\">Aucun historique disponible</td>
                </tr>
            ";
        }
        // line 29
        yield "        </tbody>
    </table>
</div>

";
        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        return; yield '';
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName()
    {
        return "intervention/_popup_history_planification.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable()
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array (  111 => 29,  105 => 25,  102 => 24,  93 => 21,  89 => 20,  85 => 19,  81 => 18,  77 => 17,  73 => 16,  70 => 15,  65 => 14,  63 => 13,  51 => 3,  49 => 2,  44 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("<div id=\"popup-history-planification-{{ intervention.id }}\" style=\"display:none\">
    {% set historiquePlanification = intervention.planning ? intervention.planning.getPlanningHistoriqueModifications|sort((a, b) => a.dateAction > b.dateAction ? -1 : 1) : [] %}
    <table class=\"table table-responsive table-bordered table-sm table-inverse-color-datagrid mb-0\">
        <thead align=\"center\" style=\"vertical-align: middle!important;\">
            <th>Date action</th>
            <th>Utilisateur</th>
            <th>Motif action</th>
            <th>Type planification</th>
            <th>Agent planning</th>
            <th>Agent terrain</th>
        </thead>
        <tbody>
            {% if historiquePlanification|length > 0 %}
                {% for historique in historiquePlanification %}
                    <tr>
                        <td class=\"text-center\">{{ historique.dateAction ? historique.dateAction|date('d/m/Y H:i') : '' }}</td>
                        <td class=\"text-center\">{{ historique.utilisateur ? historique.utilisateur.getCodeNom : '' }}</td>
                        <td class=\"text-center\">{{ historique.planningAction ? historique.planningAction.libelle : '' }}</td>
                        <td class=\"text-center\">{{ historique.typePlanification ? historique.typePlanification.code : '' }}</td>
                        <td class=\"text-center\">{{ historique.utilisateurPlanning ? historique.utilisateurPlanning.getCodeNom : '' }}</td>
                        <td class=\"text-center\">{{ historique.utilisateurAgent ? historique.utilisateurAgent.getCodeNom : '' }}</td>
                    </tr>
                {% endfor %}
            {% else %}
                <tr style=\"height: 40px\">
                    <td colspan=\"6\" class=\"text-center\">Aucun historique disponible</td>
                </tr>
            {% endif %}
        </tbody>
    </table>
</div>

", "intervention/_popup_history_planification.html.twig", "/builds/dev/refonte_sav/templates/intervention/_popup_history_planification.html.twig");
    }
}
