
<button class="button principal btn_right" 
        type="button" onClick="addPJ('{{ path('Panier.TabBlocFrs.ajaxAddPj', {idBlocFrs:idBlocfrs}) }}', '{{idBlocfrs}}', '{{ 'Ajouter PJ' | trad }}');"
        style="margin-bottom:10px"
>
    {{ 'Ajouter une pièce jointe' | trad }}
</button>

<table class="table table-hover tableV2">
    <thead class="thead-dark" style="display: none;">
        <th scope="col" colspan="6"></th>
    </thead>
    <tbody>
    {% for key, PJ in listePJ %}
        <tr id="PJ_{{ PJ.num_pj }}">
            <td width="25%"><b>{{ PJ.TITRE }}</b></td>
            <td>
                <a href="{{ path('GlobalApplication.AjaxPiecesJointes.downloadFichier', {MODULE: 'panier', id: 'panier', ordre: PJ.num_pj}) }}" target="_blank">
                    {{ PJ.nom_piece_user }}
                </a>
            </td>
            <td>
                {% if PJ.VERROU |boolSql == false and PJ.ISSU_DOCATT|boolSql == false %}
                    {{ hover_action('PJ_'~PJ.num_pj, 'Supprimer_v2' , "removePj('"~path('Panier.TabBlocFrs.ajaxRemovePJ', {idPJ:PJ.num_pj})~"', '"~PJ.num_pj~"');", 'float: right;margin-right:5px;') }}
                    {{ hover_action('PJ_'~PJ.num_pj, 'modifier_v2' , "addPJ('"~path('Panier.TabBlocFrs.ajaxEditPJ', {idBlocFrs:idBlocfrs, idPJ:PJ.num_pj})~"', '"~idBlocfrs~"', '"~('Modifier PJ' | trad)~"');", 'float: right;margin-right:5px;') }}
                {% endif %}
            </td>
        </tr>
    {% endfor %}

    </tbody>
</table>

<script>
    {% if messageErreur %}
        activePopup(
            '{{ 'Information' | trad }}',
            '{{ messageErreur |e('js')|raw }}',
            'modal_small'
        );
    {% endif %}
</script>
