<?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;
use Twig\TemplateWrapper;

/* plan/evaluation_list.html.twig */
class __TwigTemplate_22c3c0d9304eb6954504e7bd09d2dd0d extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

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

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

        $this->blocks = [
            'page_title' => [$this, 'block_page_title'],
            'page_content' => [$this, 'block_page_content'],
            'javascripts' => [$this, 'block_javascripts'],
            'stylesheets' => [$this, 'block_stylesheets'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 1
        return "@AdminLTE/layout/mesodd-layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "plan/evaluation_list.html.twig"));

        $this->parent = $this->load("@AdminLTE/layout/mesodd-layout.html.twig", 1);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

    }

    // line 3
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_title(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_title"));

        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("evaluation.title", [], "messages");
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    // line 6
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_content(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_content"));

        // line 7
        yield "    ";
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 7, $this->source); })()), 'form_start');
        yield "
  
        ";
        // line 9
        yield from $this->load("plan/evaluation_list.html.twig", 9, "183353405")->unwrap()->yield($context);
        // line 27
        yield "     
        ";
        // line 28
        if (((isset($context["actionId"]) || array_key_exists("actionId", $context) ? $context["actionId"] : (function () { throw new RuntimeError('Variable "actionId" does not exist.', 28, $this->source); })()) > 0)) {
            // line 29
            yield "        ";
            yield from $this->load("plan/evaluation_list.html.twig", 29, "469973766")->unwrap()->yield($context);
            // line 95
            yield "
        ";
        } else {
            // line 97
            yield "        <div class=\"alert alert-info\" role=\"alert\">
            ";
            // line 98
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Veuillez sélectionner une action  pour voir ces activités", [], "messages");
            // line 99
            yield "        </div>
        ";
        }
        // line 101
        yield "              
    ";
        // line 102
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 102, $this->source); })()), 'form_end');
        yield "

";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    // line 106
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_javascripts(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));

        // line 107
        yield "    <script src=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables/French.json"), "html", null, true);
        yield "\"></script>
    <script>
        
        \$(document).on('change', '#evaluation_type, #evaluation_entite, #evaluation_programm', function () {
            let \$type = \$('#evaluation_type')
            let \$entite = \$('#evaluation_entite')
            let \$form = \$(this).closest('form')

            let data = {}
            data[\$type.attr('name')] = \$type.val()
            data[\$entite.attr('name')] = \$entite.val()
            data[\$(this).attr('name')] = \$(this).val()
            
            let \$field = \$(this).attr('id')
            \$.ajax({
                url: \$form.attr('action'),
                type: \$form.attr('method'),
                data: data,
                success: function(html) {
                    if (\$field == 'evaluation_type') {
                        \$('#evaluation_entite').replaceWith(
                            \$(html).find('#evaluation_entite')
                        )
                        \$('#evaluation_programm').replaceWith(
                            \$(html).find('#evaluation_programm')
                        )
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                    if (\$field == 'evaluation_entite') { 
                        \$('#evaluation_programm').replaceWith(
                            \$(html).find('#evaluation_programm')
                        )
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                    if (\$field == 'evaluation_programm') {
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                }
            });
        });

        \$(function () {
            \$(\"#planAppreciationTable\").DataTable({
                \"searching\": false,
                \"pageLength\": 25,
                \"language\": {
                        \"url\": \"";
        // line 159
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables/French.json"), "html", null, true);
        yield "\"
                    },
                \"lengthChange\": false,
                \"columnDefs\": [
                  { \"orderable\": false, \"targets\": -1 }
                ]
            });
        });
        
        \$(document).ready(function() {
            // Setup - add a text input to each footer cell
            /*\$('#planAppreciationTable thead tr').clone(true).appendTo( '#planAppreciationTable thead' );
            \$('#planAppreciationTable thead tr:eq(1) th').each( function (i) {
                var title = \$(this).text();
                \$(this).html( '<input type=\"text\" placeholder=\"Search '+title+'\" />' );
        
                \$( 'input', this ).on( 'keyup change', function () {
                    if ( table.column(i).search() !== this.value ) {
                        table
                            .column(i)
                            .search( this.value )
                            .draw();
                    }
                } );
            } );
        
            var table = \$('#planAppreciationTable').DataTable( {
                orderCellsTop: true,
                fixedHeader: true
            } );*/

            \$('#planAppreciationTables').DataTable( {
        initComplete: function () {
            this.api().columns().every( function () {
                var column = this;
                var select = \$('<select><option value=\"\"></option></select>')
                    .appendTo( \$(column.header()).empty() )
                    .on( 'change', function () {
                        var val = \$.fn.dataTable.util.escapeRegex(
                            \$(this).val()
                        );
 
                        column
                            .search( val ? '^'+val+'\$' : '', true, false )
                            .draw();
                    } );
 
                column.data().unique().sort().each( function ( d, j ) {
                    select.append( '<option value=\"'+d+'\">'+d+'</option>' )
                } );
            } );
        }
    } );

        } );

    </script>

    <script src=\"";
        // line 217
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables/jquery.dataTables.js"), "html", null, true);
        yield "\"></script>
    <script src=\"";
        // line 218
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables-bs4/js/dataTables.bootstrap4.js"), "html", null, true);
        yield "\"></script>
";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    // line 221
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_stylesheets(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));

        // line 222
        yield "    <link rel=\"stylesheet\" href=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables-bs4/css/dataTables.bootstrap4.css"), "html", null, true);
        yield "\">
";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "plan/evaluation_list.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  281 => 222,  271 => 221,  261 => 218,  257 => 217,  196 => 159,  140 => 107,  130 => 106,  119 => 102,  116 => 101,  112 => 99,  110 => 98,  107 => 97,  103 => 95,  100 => 29,  98 => 28,  95 => 27,  93 => 9,  87 => 7,  77 => 6,  60 => 3,  43 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("{% extends '@AdminLTE/layout/mesodd-layout.html.twig' %}

{% block page_title %}{% trans %}evaluation.title{% endtrans %}{% endblock %}


{% block page_content %}
    {{ form_start(form) }}
  
        {% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
            {% block box_body %}
                <div class=\"text-right\">
                    <a href=\"{{ path('app_notations', { 'id': actionId }) }}\" class=\"btn btn-primary\">
                        <i class=\"fas fa-angle-double-left\"></i> {% trans %}basics.processus{% endtrans %}
                    </a>
                </div><br>
                {% if is_granted('ROLE_MANAGER') %}
                    {{ form_row(form.type) }}
                    {{ form_row(form.entite) }}
                {% endif %}
                {% if is_granted('ROLE_DDD') %}
                    {{ form_row(form.entite) }}
                {% endif %}
                {{ form_row(form.programm) }}
                {{ form_row(form.action) }}
            {% endblock %}
        {% endembed %}
     
        {% if actionId > 0 %}
        {% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
            {% block box_body %}
                <table id=\"planAppreciationTable\" class=\"table table-striped\">
                <thead>
                    <th>Activité</th>
                    <th>Nature</th>
                    <th>Cible</th>
                    <th style=\"width: 50px\">{{(app.session.get('_commune') or app.session.get('_departement')) ? '# Arr.' : '# Com.'}}</th>
                    <th style=\"width: 75px\">Sensibilité</th>
                    <th style=\"width: 75px\">Appréciation</th>
                    {% if (is_granted('ROLE_MANAGER')) %}
                    <th style=\"width:100px\"></th>
                    {% endif %}
                </thead>
                {% for notation in notations %}
                <tr>
                    <td>{{ notation.activity.code }} - {{ notation.activity.name }}</td>
                    <td>{{ notation.nature.name }}</td>
                    <td>
                        {% if notation.target %}
                            {{ notation.target.name }}
                        {% endif %}
                    </td>
                    <td class=\"text-center\">{{ notation.nbOfLocation }}</td>
                    <td class=\"text-right\">{{ notation.sensitivity|number_format(2) }} %</td>
                    <td class=\"text-left\"><span class=\"badge bg-{{ notation.appreciation.flag }}\">{{ notation.appreciation.name }}</span></td>
                    {% if (is_granted('ROLE_MANAGER')) %}
                    <td class=\"text-center mb-2\">
                        <a href=\"{{ path('app_notation_edit', { 'id': notation.id }) }}\" class=\"btn btn-sm btn-secondary\">{% trans %}basics.update{% endtrans %}</a>
                        <br><br>
                        {% if notation.duplicated %}
                            <a href=\"#\" data-toggle=\"modal\" data-target=\"#modal-delete-{{ notation.id }}\" class=\"btn btn-sm btn-default\">{% trans %}basics.delete{% endtrans %}</a>
                            
                            <div class=\"modal fade\" id=\"modal-delete-{{ notation.id }}\">
                                <div class=\"modal-dialog\">
                                    <div class=\"modal-content\">
                                        <div class=\"modal-header\">
                                            <h5 class=\"modal-title\">{% trans %}basics.delete.title{% endtrans %}</h5>
                                            <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
                                                <span aria-hidden=\"true\">&times;</span>
                                            </button>
                                        </div>
                                        <div class=\"modal-body\">
                                            <p>{% trans %}evaluation.delete.message{% endtrans %}</p>
                                            <b>{% trans %}basics.activity{% endtrans %}:</b> {{ notation.activity.name }}</br>
                                            <b>{% trans %}basics.nature{% endtrans %}:</b> {{ notation.nature.name }}</br>
                                            {% if notation.target %}<b>{% trans %}basics.target{% endtrans %}:</b> {{ notation.target.name }}</br>{% endif %}
                                            <b>{% trans %}basics.sensitivity{% endtrans %}:</b> {{ notation.sensitivity }}%</br>
                                        </div>
                                        <div class=\"modal-footer justify-content-between\">
                                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">{% trans %}basics.no{% endtrans %}</button>
                                            <a href=\"{{ path('app_notation_delete', { 'id': notation.id }) }}\" class=\"btn btn-danger\">{% trans %}basics.yes{% endtrans %}</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {% else %}
                            <a href=\"{{ path('app_notation_duplicate', { 'id': notation.id }) }}\" class=\"btn btn-sm btn-default\">{% trans %}basics.duplicate{% endtrans %}</a>
                        {% endif %}
                    </td>
                    {% endif %}
                </tr>
                {% endfor %}
                </table>
            {% endblock %}
        {% endembed %}

        {% else %}
        <div class=\"alert alert-info\" role=\"alert\">
            {% trans %}Veuillez sélectionner une action  pour voir ces activités{% endtrans %}
        </div>
        {% endif %}
              
    {{ form_end(form) }}

{% endblock %}

{% block javascripts %}
    <script src=\"{{ asset('plugins/datatables/French.json') }}\"></script>
    <script>
        
        \$(document).on('change', '#evaluation_type, #evaluation_entite, #evaluation_programm', function () {
            let \$type = \$('#evaluation_type')
            let \$entite = \$('#evaluation_entite')
            let \$form = \$(this).closest('form')

            let data = {}
            data[\$type.attr('name')] = \$type.val()
            data[\$entite.attr('name')] = \$entite.val()
            data[\$(this).attr('name')] = \$(this).val()
            
            let \$field = \$(this).attr('id')
            \$.ajax({
                url: \$form.attr('action'),
                type: \$form.attr('method'),
                data: data,
                success: function(html) {
                    if (\$field == 'evaluation_type') {
                        \$('#evaluation_entite').replaceWith(
                            \$(html).find('#evaluation_entite')
                        )
                        \$('#evaluation_programm').replaceWith(
                            \$(html).find('#evaluation_programm')
                        )
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                    if (\$field == 'evaluation_entite') { 
                        \$('#evaluation_programm').replaceWith(
                            \$(html).find('#evaluation_programm')
                        )
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                    if (\$field == 'evaluation_programm') {
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                }
            });
        });

        \$(function () {
            \$(\"#planAppreciationTable\").DataTable({
                \"searching\": false,
                \"pageLength\": 25,
                \"language\": {
                        \"url\": \"{{ asset('plugins/datatables/French.json') }}\"
                    },
                \"lengthChange\": false,
                \"columnDefs\": [
                  { \"orderable\": false, \"targets\": -1 }
                ]
            });
        });
        
        \$(document).ready(function() {
            // Setup - add a text input to each footer cell
            /*\$('#planAppreciationTable thead tr').clone(true).appendTo( '#planAppreciationTable thead' );
            \$('#planAppreciationTable thead tr:eq(1) th').each( function (i) {
                var title = \$(this).text();
                \$(this).html( '<input type=\"text\" placeholder=\"Search '+title+'\" />' );
        
                \$( 'input', this ).on( 'keyup change', function () {
                    if ( table.column(i).search() !== this.value ) {
                        table
                            .column(i)
                            .search( this.value )
                            .draw();
                    }
                } );
            } );
        
            var table = \$('#planAppreciationTable').DataTable( {
                orderCellsTop: true,
                fixedHeader: true
            } );*/

            \$('#planAppreciationTables').DataTable( {
        initComplete: function () {
            this.api().columns().every( function () {
                var column = this;
                var select = \$('<select><option value=\"\"></option></select>')
                    .appendTo( \$(column.header()).empty() )
                    .on( 'change', function () {
                        var val = \$.fn.dataTable.util.escapeRegex(
                            \$(this).val()
                        );
 
                        column
                            .search( val ? '^'+val+'\$' : '', true, false )
                            .draw();
                    } );
 
                column.data().unique().sort().each( function ( d, j ) {
                    select.append( '<option value=\"'+d+'\">'+d+'</option>' )
                } );
            } );
        }
    } );

        } );

    </script>

    <script src=\"{{ asset('plugins/datatables/jquery.dataTables.js') }}\"></script>
    <script src=\"{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.js') }}\"></script>
{% endblock %}

{% block stylesheets %}
    <link rel=\"stylesheet\" href=\"{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.css') }}\">
{% endblock %}", "plan/evaluation_list.html.twig", "/var/www/vhosts/sigodd.gouv.bj/httpdocs/templates/plan/evaluation_list.html.twig");
    }
}


/* plan/evaluation_list.html.twig */
class __TwigTemplate_22c3c0d9304eb6954504e7bd09d2dd0d___183353405 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

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

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

        $this->blocks = [
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 9
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "plan/evaluation_list.html.twig"));

        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 9);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

    }

    // line 10
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "box_body"));

        // line 11
        yield "                <div class=\"text-right\">
                    <a href=\"";
        // line 12
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_notations", ["id" => (isset($context["actionId"]) || array_key_exists("actionId", $context) ? $context["actionId"] : (function () { throw new RuntimeError('Variable "actionId" does not exist.', 12, $this->source); })())]), "html", null, true);
        yield "\" class=\"btn btn-primary\">
                        <i class=\"fas fa-angle-double-left\"></i> ";
        // line 13
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.processus", [], "messages");
        // line 14
        yield "                    </a>
                </div><br>
                ";
        // line 16
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 17
            yield "                    ";
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 17, $this->source); })()), "type", [], "any", false, false, false, 17), 'row');
            yield "
                    ";
            // line 18
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 18, $this->source); })()), "entite", [], "any", false, false, false, 18), 'row');
            yield "
                ";
        }
        // line 20
        yield "                ";
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_DDD")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 21
            yield "                    ";
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 21, $this->source); })()), "entite", [], "any", false, false, false, 21), 'row');
            yield "
                ";
        }
        // line 23
        yield "                ";
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 23, $this->source); })()), "programm", [], "any", false, false, false, 23), 'row');
        yield "
                ";
        // line 24
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 24, $this->source); })()), "action", [], "any", false, false, false, 24), 'row');
        yield "
            ";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "plan/evaluation_list.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  633 => 24,  628 => 23,  622 => 21,  619 => 20,  614 => 18,  609 => 17,  607 => 16,  603 => 14,  601 => 13,  597 => 12,  594 => 11,  584 => 10,  567 => 9,  281 => 222,  271 => 221,  261 => 218,  257 => 217,  196 => 159,  140 => 107,  130 => 106,  119 => 102,  116 => 101,  112 => 99,  110 => 98,  107 => 97,  103 => 95,  100 => 29,  98 => 28,  95 => 27,  93 => 9,  87 => 7,  77 => 6,  60 => 3,  43 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("{% extends '@AdminLTE/layout/mesodd-layout.html.twig' %}

{% block page_title %}{% trans %}evaluation.title{% endtrans %}{% endblock %}


{% block page_content %}
    {{ form_start(form) }}
  
        {% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
            {% block box_body %}
                <div class=\"text-right\">
                    <a href=\"{{ path('app_notations', { 'id': actionId }) }}\" class=\"btn btn-primary\">
                        <i class=\"fas fa-angle-double-left\"></i> {% trans %}basics.processus{% endtrans %}
                    </a>
                </div><br>
                {% if is_granted('ROLE_MANAGER') %}
                    {{ form_row(form.type) }}
                    {{ form_row(form.entite) }}
                {% endif %}
                {% if is_granted('ROLE_DDD') %}
                    {{ form_row(form.entite) }}
                {% endif %}
                {{ form_row(form.programm) }}
                {{ form_row(form.action) }}
            {% endblock %}
        {% endembed %}
     
        {% if actionId > 0 %}
        {% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
            {% block box_body %}
                <table id=\"planAppreciationTable\" class=\"table table-striped\">
                <thead>
                    <th>Activité</th>
                    <th>Nature</th>
                    <th>Cible</th>
                    <th style=\"width: 50px\">{{(app.session.get('_commune') or app.session.get('_departement')) ? '# Arr.' : '# Com.'}}</th>
                    <th style=\"width: 75px\">Sensibilité</th>
                    <th style=\"width: 75px\">Appréciation</th>
                    {% if (is_granted('ROLE_MANAGER')) %}
                    <th style=\"width:100px\"></th>
                    {% endif %}
                </thead>
                {% for notation in notations %}
                <tr>
                    <td>{{ notation.activity.code }} - {{ notation.activity.name }}</td>
                    <td>{{ notation.nature.name }}</td>
                    <td>
                        {% if notation.target %}
                            {{ notation.target.name }}
                        {% endif %}
                    </td>
                    <td class=\"text-center\">{{ notation.nbOfLocation }}</td>
                    <td class=\"text-right\">{{ notation.sensitivity|number_format(2) }} %</td>
                    <td class=\"text-left\"><span class=\"badge bg-{{ notation.appreciation.flag }}\">{{ notation.appreciation.name }}</span></td>
                    {% if (is_granted('ROLE_MANAGER')) %}
                    <td class=\"text-center mb-2\">
                        <a href=\"{{ path('app_notation_edit', { 'id': notation.id }) }}\" class=\"btn btn-sm btn-secondary\">{% trans %}basics.update{% endtrans %}</a>
                        <br><br>
                        {% if notation.duplicated %}
                            <a href=\"#\" data-toggle=\"modal\" data-target=\"#modal-delete-{{ notation.id }}\" class=\"btn btn-sm btn-default\">{% trans %}basics.delete{% endtrans %}</a>
                            
                            <div class=\"modal fade\" id=\"modal-delete-{{ notation.id }}\">
                                <div class=\"modal-dialog\">
                                    <div class=\"modal-content\">
                                        <div class=\"modal-header\">
                                            <h5 class=\"modal-title\">{% trans %}basics.delete.title{% endtrans %}</h5>
                                            <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
                                                <span aria-hidden=\"true\">&times;</span>
                                            </button>
                                        </div>
                                        <div class=\"modal-body\">
                                            <p>{% trans %}evaluation.delete.message{% endtrans %}</p>
                                            <b>{% trans %}basics.activity{% endtrans %}:</b> {{ notation.activity.name }}</br>
                                            <b>{% trans %}basics.nature{% endtrans %}:</b> {{ notation.nature.name }}</br>
                                            {% if notation.target %}<b>{% trans %}basics.target{% endtrans %}:</b> {{ notation.target.name }}</br>{% endif %}
                                            <b>{% trans %}basics.sensitivity{% endtrans %}:</b> {{ notation.sensitivity }}%</br>
                                        </div>
                                        <div class=\"modal-footer justify-content-between\">
                                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">{% trans %}basics.no{% endtrans %}</button>
                                            <a href=\"{{ path('app_notation_delete', { 'id': notation.id }) }}\" class=\"btn btn-danger\">{% trans %}basics.yes{% endtrans %}</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {% else %}
                            <a href=\"{{ path('app_notation_duplicate', { 'id': notation.id }) }}\" class=\"btn btn-sm btn-default\">{% trans %}basics.duplicate{% endtrans %}</a>
                        {% endif %}
                    </td>
                    {% endif %}
                </tr>
                {% endfor %}
                </table>
            {% endblock %}
        {% endembed %}

        {% else %}
        <div class=\"alert alert-info\" role=\"alert\">
            {% trans %}Veuillez sélectionner une action  pour voir ces activités{% endtrans %}
        </div>
        {% endif %}
              
    {{ form_end(form) }}

{% endblock %}

{% block javascripts %}
    <script src=\"{{ asset('plugins/datatables/French.json') }}\"></script>
    <script>
        
        \$(document).on('change', '#evaluation_type, #evaluation_entite, #evaluation_programm', function () {
            let \$type = \$('#evaluation_type')
            let \$entite = \$('#evaluation_entite')
            let \$form = \$(this).closest('form')

            let data = {}
            data[\$type.attr('name')] = \$type.val()
            data[\$entite.attr('name')] = \$entite.val()
            data[\$(this).attr('name')] = \$(this).val()
            
            let \$field = \$(this).attr('id')
            \$.ajax({
                url: \$form.attr('action'),
                type: \$form.attr('method'),
                data: data,
                success: function(html) {
                    if (\$field == 'evaluation_type') {
                        \$('#evaluation_entite').replaceWith(
                            \$(html).find('#evaluation_entite')
                        )
                        \$('#evaluation_programm').replaceWith(
                            \$(html).find('#evaluation_programm')
                        )
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                    if (\$field == 'evaluation_entite') { 
                        \$('#evaluation_programm').replaceWith(
                            \$(html).find('#evaluation_programm')
                        )
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                    if (\$field == 'evaluation_programm') {
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                }
            });
        });

        \$(function () {
            \$(\"#planAppreciationTable\").DataTable({
                \"searching\": false,
                \"pageLength\": 25,
                \"language\": {
                        \"url\": \"{{ asset('plugins/datatables/French.json') }}\"
                    },
                \"lengthChange\": false,
                \"columnDefs\": [
                  { \"orderable\": false, \"targets\": -1 }
                ]
            });
        });
        
        \$(document).ready(function() {
            // Setup - add a text input to each footer cell
            /*\$('#planAppreciationTable thead tr').clone(true).appendTo( '#planAppreciationTable thead' );
            \$('#planAppreciationTable thead tr:eq(1) th').each( function (i) {
                var title = \$(this).text();
                \$(this).html( '<input type=\"text\" placeholder=\"Search '+title+'\" />' );
        
                \$( 'input', this ).on( 'keyup change', function () {
                    if ( table.column(i).search() !== this.value ) {
                        table
                            .column(i)
                            .search( this.value )
                            .draw();
                    }
                } );
            } );
        
            var table = \$('#planAppreciationTable').DataTable( {
                orderCellsTop: true,
                fixedHeader: true
            } );*/

            \$('#planAppreciationTables').DataTable( {
        initComplete: function () {
            this.api().columns().every( function () {
                var column = this;
                var select = \$('<select><option value=\"\"></option></select>')
                    .appendTo( \$(column.header()).empty() )
                    .on( 'change', function () {
                        var val = \$.fn.dataTable.util.escapeRegex(
                            \$(this).val()
                        );
 
                        column
                            .search( val ? '^'+val+'\$' : '', true, false )
                            .draw();
                    } );
 
                column.data().unique().sort().each( function ( d, j ) {
                    select.append( '<option value=\"'+d+'\">'+d+'</option>' )
                } );
            } );
        }
    } );

        } );

    </script>

    <script src=\"{{ asset('plugins/datatables/jquery.dataTables.js') }}\"></script>
    <script src=\"{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.js') }}\"></script>
{% endblock %}

{% block stylesheets %}
    <link rel=\"stylesheet\" href=\"{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.css') }}\">
{% endblock %}", "plan/evaluation_list.html.twig", "/var/www/vhosts/sigodd.gouv.bj/httpdocs/templates/plan/evaluation_list.html.twig");
    }
}


/* plan/evaluation_list.html.twig */
class __TwigTemplate_22c3c0d9304eb6954504e7bd09d2dd0d___469973766 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

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

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

        $this->blocks = [
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 29
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "plan/evaluation_list.html.twig"));

        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 29);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

    }

    // line 30
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "box_body"));

        // line 31
        yield "                <table id=\"planAppreciationTable\" class=\"table table-striped\">
                <thead>
                    <th>Activité</th>
                    <th>Nature</th>
                    <th>Cible</th>
                    <th style=\"width: 50px\">";
        // line 36
        yield (((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 36, $this->source); })()), "session", [], "any", false, false, false, 36), "get", ["_commune"], "method", false, false, false, 36) || CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 36, $this->source); })()), "session", [], "any", false, false, false, 36), "get", ["_departement"], "method", false, false, false, 36))) ? ("# Arr.") : ("# Com."));
        yield "</th>
                    <th style=\"width: 75px\">Sensibilité</th>
                    <th style=\"width: 75px\">Appréciation</th>
                    ";
        // line 39
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 40
            yield "                    <th style=\"width:100px\"></th>
                    ";
        }
        // line 42
        yield "                </thead>
                ";
        // line 43
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable((isset($context["notations"]) || array_key_exists("notations", $context) ? $context["notations"] : (function () { throw new RuntimeError('Variable "notations" does not exist.', 43, $this->source); })()));
        foreach ($context['_seq'] as $context["_key"] => $context["notation"]) {
            // line 44
            yield "                <tr>
                    <td>";
            // line 45
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "activity", [], "any", false, false, false, 45), "code", [], "any", false, false, false, 45), "html", null, true);
            yield " - ";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "activity", [], "any", false, false, false, 45), "name", [], "any", false, false, false, 45), "html", null, true);
            yield "</td>
                    <td>";
            // line 46
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "nature", [], "any", false, false, false, 46), "name", [], "any", false, false, false, 46), "html", null, true);
            yield "</td>
                    <td>
                        ";
            // line 48
            if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "target", [], "any", false, false, false, 48)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                // line 49
                yield "                            ";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "target", [], "any", false, false, false, 49), "name", [], "any", false, false, false, 49), "html", null, true);
                yield "
                        ";
            }
            // line 51
            yield "                    </td>
                    <td class=\"text-center\">";
            // line 52
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "nbOfLocation", [], "any", false, false, false, 52), "html", null, true);
            yield "</td>
                    <td class=\"text-right\">";
            // line 53
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber(CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "sensitivity", [], "any", false, false, false, 53), 2), "html", null, true);
            yield " %</td>
                    <td class=\"text-left\"><span class=\"badge bg-";
            // line 54
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "appreciation", [], "any", false, false, false, 54), "flag", [], "any", false, false, false, 54), "html", null, true);
            yield "\">";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "appreciation", [], "any", false, false, false, 54), "name", [], "any", false, false, false, 54), "html", null, true);
            yield "</span></td>
                    ";
            // line 55
            if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                // line 56
                yield "                    <td class=\"text-center mb-2\">
                        <a href=\"";
                // line 57
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_notation_edit", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "id", [], "any", false, false, false, 57)]), "html", null, true);
                yield "\" class=\"btn btn-sm btn-secondary\">";
                yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.update", [], "messages");
                yield "</a>
                        <br><br>
                        ";
                // line 59
                if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "duplicated", [], "any", false, false, false, 59)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                    // line 60
                    yield "                            <a href=\"#\" data-toggle=\"modal\" data-target=\"#modal-delete-";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "id", [], "any", false, false, false, 60), "html", null, true);
                    yield "\" class=\"btn btn-sm btn-default\">";
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.delete", [], "messages");
                    yield "</a>
                            
                            <div class=\"modal fade\" id=\"modal-delete-";
                    // line 62
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "id", [], "any", false, false, false, 62), "html", null, true);
                    yield "\">
                                <div class=\"modal-dialog\">
                                    <div class=\"modal-content\">
                                        <div class=\"modal-header\">
                                            <h5 class=\"modal-title\">";
                    // line 66
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.delete.title", [], "messages");
                    yield "</h5>
                                            <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
                                                <span aria-hidden=\"true\">&times;</span>
                                            </button>
                                        </div>
                                        <div class=\"modal-body\">
                                            <p>";
                    // line 72
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("evaluation.delete.message", [], "messages");
                    yield "</p>
                                            <b>";
                    // line 73
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.activity", [], "messages");
                    yield ":</b> ";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "activity", [], "any", false, false, false, 73), "name", [], "any", false, false, false, 73), "html", null, true);
                    yield "</br>
                                            <b>";
                    // line 74
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.nature", [], "messages");
                    yield ":</b> ";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "nature", [], "any", false, false, false, 74), "name", [], "any", false, false, false, 74), "html", null, true);
                    yield "</br>
                                            ";
                    // line 75
                    if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "target", [], "any", false, false, false, 75)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                        yield "<b>";
                        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.target", [], "messages");
                        yield ":</b> ";
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "target", [], "any", false, false, false, 75), "name", [], "any", false, false, false, 75), "html", null, true);
                        yield "</br>";
                    }
                    // line 76
                    yield "                                            <b>";
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.sensitivity", [], "messages");
                    yield ":</b> ";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "sensitivity", [], "any", false, false, false, 76), "html", null, true);
                    yield "%</br>
                                        </div>
                                        <div class=\"modal-footer justify-content-between\">
                                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">";
                    // line 79
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.no", [], "messages");
                    yield "</button>
                                            <a href=\"";
                    // line 80
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_notation_delete", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "id", [], "any", false, false, false, 80)]), "html", null, true);
                    yield "\" class=\"btn btn-danger\">";
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.yes", [], "messages");
                    yield "</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        ";
                } else {
                    // line 86
                    yield "                            <a href=\"";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_notation_duplicate", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "id", [], "any", false, false, false, 86)]), "html", null, true);
                    yield "\" class=\"btn btn-sm btn-default\">";
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.duplicate", [], "messages");
                    yield "</a>
                        ";
                }
                // line 88
                yield "                    </td>
                    ";
            }
            // line 90
            yield "                </tr>
                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['notation'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 92
        yield "                </table>
            ";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "plan/evaluation_list.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  1115 => 92,  1108 => 90,  1104 => 88,  1096 => 86,  1085 => 80,  1081 => 79,  1072 => 76,  1064 => 75,  1058 => 74,  1052 => 73,  1048 => 72,  1039 => 66,  1032 => 62,  1024 => 60,  1022 => 59,  1015 => 57,  1012 => 56,  1010 => 55,  1004 => 54,  1000 => 53,  996 => 52,  993 => 51,  987 => 49,  985 => 48,  980 => 46,  974 => 45,  971 => 44,  967 => 43,  964 => 42,  960 => 40,  958 => 39,  952 => 36,  945 => 31,  935 => 30,  918 => 29,  633 => 24,  628 => 23,  622 => 21,  619 => 20,  614 => 18,  609 => 17,  607 => 16,  603 => 14,  601 => 13,  597 => 12,  594 => 11,  584 => 10,  567 => 9,  281 => 222,  271 => 221,  261 => 218,  257 => 217,  196 => 159,  140 => 107,  130 => 106,  119 => 102,  116 => 101,  112 => 99,  110 => 98,  107 => 97,  103 => 95,  100 => 29,  98 => 28,  95 => 27,  93 => 9,  87 => 7,  77 => 6,  60 => 3,  43 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("{% extends '@AdminLTE/layout/mesodd-layout.html.twig' %}

{% block page_title %}{% trans %}evaluation.title{% endtrans %}{% endblock %}


{% block page_content %}
    {{ form_start(form) }}
  
        {% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
            {% block box_body %}
                <div class=\"text-right\">
                    <a href=\"{{ path('app_notations', { 'id': actionId }) }}\" class=\"btn btn-primary\">
                        <i class=\"fas fa-angle-double-left\"></i> {% trans %}basics.processus{% endtrans %}
                    </a>
                </div><br>
                {% if is_granted('ROLE_MANAGER') %}
                    {{ form_row(form.type) }}
                    {{ form_row(form.entite) }}
                {% endif %}
                {% if is_granted('ROLE_DDD') %}
                    {{ form_row(form.entite) }}
                {% endif %}
                {{ form_row(form.programm) }}
                {{ form_row(form.action) }}
            {% endblock %}
        {% endembed %}
     
        {% if actionId > 0 %}
        {% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
            {% block box_body %}
                <table id=\"planAppreciationTable\" class=\"table table-striped\">
                <thead>
                    <th>Activité</th>
                    <th>Nature</th>
                    <th>Cible</th>
                    <th style=\"width: 50px\">{{(app.session.get('_commune') or app.session.get('_departement')) ? '# Arr.' : '# Com.'}}</th>
                    <th style=\"width: 75px\">Sensibilité</th>
                    <th style=\"width: 75px\">Appréciation</th>
                    {% if (is_granted('ROLE_MANAGER')) %}
                    <th style=\"width:100px\"></th>
                    {% endif %}
                </thead>
                {% for notation in notations %}
                <tr>
                    <td>{{ notation.activity.code }} - {{ notation.activity.name }}</td>
                    <td>{{ notation.nature.name }}</td>
                    <td>
                        {% if notation.target %}
                            {{ notation.target.name }}
                        {% endif %}
                    </td>
                    <td class=\"text-center\">{{ notation.nbOfLocation }}</td>
                    <td class=\"text-right\">{{ notation.sensitivity|number_format(2) }} %</td>
                    <td class=\"text-left\"><span class=\"badge bg-{{ notation.appreciation.flag }}\">{{ notation.appreciation.name }}</span></td>
                    {% if (is_granted('ROLE_MANAGER')) %}
                    <td class=\"text-center mb-2\">
                        <a href=\"{{ path('app_notation_edit', { 'id': notation.id }) }}\" class=\"btn btn-sm btn-secondary\">{% trans %}basics.update{% endtrans %}</a>
                        <br><br>
                        {% if notation.duplicated %}
                            <a href=\"#\" data-toggle=\"modal\" data-target=\"#modal-delete-{{ notation.id }}\" class=\"btn btn-sm btn-default\">{% trans %}basics.delete{% endtrans %}</a>
                            
                            <div class=\"modal fade\" id=\"modal-delete-{{ notation.id }}\">
                                <div class=\"modal-dialog\">
                                    <div class=\"modal-content\">
                                        <div class=\"modal-header\">
                                            <h5 class=\"modal-title\">{% trans %}basics.delete.title{% endtrans %}</h5>
                                            <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
                                                <span aria-hidden=\"true\">&times;</span>
                                            </button>
                                        </div>
                                        <div class=\"modal-body\">
                                            <p>{% trans %}evaluation.delete.message{% endtrans %}</p>
                                            <b>{% trans %}basics.activity{% endtrans %}:</b> {{ notation.activity.name }}</br>
                                            <b>{% trans %}basics.nature{% endtrans %}:</b> {{ notation.nature.name }}</br>
                                            {% if notation.target %}<b>{% trans %}basics.target{% endtrans %}:</b> {{ notation.target.name }}</br>{% endif %}
                                            <b>{% trans %}basics.sensitivity{% endtrans %}:</b> {{ notation.sensitivity }}%</br>
                                        </div>
                                        <div class=\"modal-footer justify-content-between\">
                                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">{% trans %}basics.no{% endtrans %}</button>
                                            <a href=\"{{ path('app_notation_delete', { 'id': notation.id }) }}\" class=\"btn btn-danger\">{% trans %}basics.yes{% endtrans %}</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        {% else %}
                            <a href=\"{{ path('app_notation_duplicate', { 'id': notation.id }) }}\" class=\"btn btn-sm btn-default\">{% trans %}basics.duplicate{% endtrans %}</a>
                        {% endif %}
                    </td>
                    {% endif %}
                </tr>
                {% endfor %}
                </table>
            {% endblock %}
        {% endembed %}

        {% else %}
        <div class=\"alert alert-info\" role=\"alert\">
            {% trans %}Veuillez sélectionner une action  pour voir ces activités{% endtrans %}
        </div>
        {% endif %}
              
    {{ form_end(form) }}

{% endblock %}

{% block javascripts %}
    <script src=\"{{ asset('plugins/datatables/French.json') }}\"></script>
    <script>
        
        \$(document).on('change', '#evaluation_type, #evaluation_entite, #evaluation_programm', function () {
            let \$type = \$('#evaluation_type')
            let \$entite = \$('#evaluation_entite')
            let \$form = \$(this).closest('form')

            let data = {}
            data[\$type.attr('name')] = \$type.val()
            data[\$entite.attr('name')] = \$entite.val()
            data[\$(this).attr('name')] = \$(this).val()
            
            let \$field = \$(this).attr('id')
            \$.ajax({
                url: \$form.attr('action'),
                type: \$form.attr('method'),
                data: data,
                success: function(html) {
                    if (\$field == 'evaluation_type') {
                        \$('#evaluation_entite').replaceWith(
                            \$(html).find('#evaluation_entite')
                        )
                        \$('#evaluation_programm').replaceWith(
                            \$(html).find('#evaluation_programm')
                        )
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                    if (\$field == 'evaluation_entite') { 
                        \$('#evaluation_programm').replaceWith(
                            \$(html).find('#evaluation_programm')
                        )
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                    if (\$field == 'evaluation_programm') {
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                }
            });
        });

        \$(function () {
            \$(\"#planAppreciationTable\").DataTable({
                \"searching\": false,
                \"pageLength\": 25,
                \"language\": {
                        \"url\": \"{{ asset('plugins/datatables/French.json') }}\"
                    },
                \"lengthChange\": false,
                \"columnDefs\": [
                  { \"orderable\": false, \"targets\": -1 }
                ]
            });
        });
        
        \$(document).ready(function() {
            // Setup - add a text input to each footer cell
            /*\$('#planAppreciationTable thead tr').clone(true).appendTo( '#planAppreciationTable thead' );
            \$('#planAppreciationTable thead tr:eq(1) th').each( function (i) {
                var title = \$(this).text();
                \$(this).html( '<input type=\"text\" placeholder=\"Search '+title+'\" />' );
        
                \$( 'input', this ).on( 'keyup change', function () {
                    if ( table.column(i).search() !== this.value ) {
                        table
                            .column(i)
                            .search( this.value )
                            .draw();
                    }
                } );
            } );
        
            var table = \$('#planAppreciationTable').DataTable( {
                orderCellsTop: true,
                fixedHeader: true
            } );*/

            \$('#planAppreciationTables').DataTable( {
        initComplete: function () {
            this.api().columns().every( function () {
                var column = this;
                var select = \$('<select><option value=\"\"></option></select>')
                    .appendTo( \$(column.header()).empty() )
                    .on( 'change', function () {
                        var val = \$.fn.dataTable.util.escapeRegex(
                            \$(this).val()
                        );
 
                        column
                            .search( val ? '^'+val+'\$' : '', true, false )
                            .draw();
                    } );
 
                column.data().unique().sort().each( function ( d, j ) {
                    select.append( '<option value=\"'+d+'\">'+d+'</option>' )
                } );
            } );
        }
    } );

        } );

    </script>

    <script src=\"{{ asset('plugins/datatables/jquery.dataTables.js') }}\"></script>
    <script src=\"{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.js') }}\"></script>
{% endblock %}

{% block stylesheets %}
    <link rel=\"stylesheet\" href=\"{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.css') }}\">
{% endblock %}", "plan/evaluation_list.html.twig", "/var/www/vhosts/sigodd.gouv.bj/httpdocs/templates/plan/evaluation_list.html.twig");
    }
}
