{% extends 'layout.twig' %}
{% block body %}
    <div class="contenu clearfix"  id="fournisseurs">
        <h1>
            {{ 'Administration' | trad }}
            {{ ButtonExport(path('Administration.GestionUtilisateur.export', {type : 'event', idUser : userId}), 'filtre_user' , path('Ajax.Erreur.popupInformation') , path('Ajax.Outil.appelAsync'), 'Export' | trad) }}
        </h1>
        {% include '@Administration/gestionUserOxalink/_entete.twig' %}
        <div id="oxalink" class="tab-content clearfix">
            <h2 style="padding: 0px 15px;">
                {{ title }}
            </h2>
            <div class="resultat_filtre">
                {{ bullFiltre(post, 'filtre_user') }}
            </div>
            <div class="padding15 clearfix" id="tabPAGE">
                <form method="post" name="filtre_user" id="filtre_user">
                    <table class="table table-hover">
                        <thead class="thead-dark">
                            <tr>
                                {% if userId is null %}
                                    <th scope="col" width="15%">{{ triTable('NOM_UTILISATEUR',  post.tri_NOM_UTILISATEUR, 'Utilisateur' | trad, '', '', 'filtre_user') }}</th>
                                {% endif %}
                                <th scope="col" width="15%">{{ triTable('DTE_EVE',  post.tri_DTE_EVE, 'Date' | trad, '', '', 'filtre_user') }}</th>
                                <th scope="col" width="15%">{{ triTable('HEU_EVE',  post.tri_HEU_EVE, 'Heure' | trad, '', '', 'filtre_user') }}</th>
                                <th scope="col" width="15%">{{ triTable('USER_ID_INTERNE',  post.tri_USER_ID_INTERNE, 'Auteur' | trad, '', '', 'filtre_user') }}</th>
                                <th scope="col">{{ triTable('LIBELLE',  post.tri_LIBELLE, 'Évènement' | trad, '', '', 'filtre_user') }}</th>
                            </tr>
                            <tr class="recherche">
                                {% if id is null %}
                                    <td>{{ filterTable('cf#point#NOM', post['filter_cf#point#NOM'], '', 'event_monitoring', '','filtre_user', '','Utilisateur' | trad,'',true) }}</td>
                                {% endif %}
                                <td>{{ filterTable('date_DTE_EVE', post.filter_date_DTE_EVE, '', '', '','filtre_user', 'datepicker', 'Date' | trad) }}</td>
                                <td>{{ filterTable('HEU_EVE', post.filter_HEU_EVE, '', 'event_monitoring', '','filtre_user', '','Heure' | trad,'',true) }}</td>
                                <td>{{ zoomFilter('USER_ID_INTERNE', post['filter_USER_ID_INTERNE'], '', 'filtre_user', path('Ajax.liste.utilisateur'),'Utilisateur' | trad, '','','Utilisateur','','','Hastutil') }}</td>
                                <td>{{ filterTable('LIBELLE', post.filter_LIBELLE, '', 'event_monitoring', '','filtre_user', '','Évènement' | trad,'',true) }}</td>
                            </tr>
                        </thead>
                        <tbody>
                            {% for event in reporting %}
                                <tr id="event_{{ loop.index }}">
                                    {% if id is null %}
                                        <td>{{ event.NOM_UTILISATEUR }}</td>
                                    {% endif %}
                                    <td {% if event.COMMENTAIRE %}class="loupe"{% endif %}>
                                        {{ event.DTE_EVE | dateTrad }} 
                                    </td>
                                    <td>{{ event.HEU_EVE | heureTrad }}</td>
                                    <td>{{ event.NOM == '' ? event.USER_ID_INTERNE : (event.NOM ~ ' (' ~ event.USER_ID_INTERNE ~ ')') }}</td>
                                    <td>{{ event.LIBELLE }}</td>
                                </tr>
                                {% if event.COMMENTAIRE %}
                                <tr id='event_{{ loop.index }}detail' class='detail_ligne hide_detail'>
                                    <td colspan='5'>
                                            <div class="single-row">
                                                <div class="informations">
                                                    <span class="champs_label">{{ 'Commentaire' | trad ~ colon() }}</span>
                                                    <span class="resultat">{{ event.COMMENTAIRE }}</span>
                                                </div>
                                            </div>
                                     </td>
                                </tr>
                                {% endif %}
                            {% endfor %}
                        </tbody>
                    </table>
                    {{ paginations(path('Administration.GestionUtilisateur.suivi'),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, '') }}
                </form>
            </div>
        </div>
    </div>
    
{% endblock %}