{% extends 'layout.twig' %}

{% block body %}

	<div class="contenu clearfix"  id="Consultation">
	
		<h1>
			{{ 'Consultations' | trad }}
		</h1>

        {{ ariane() }}

        <h4 class="clearfix">
            {% if idQst %}
                {{ strBuild('Modification question consultation @1@' | trad, [idAO]) }}
            {% else %}
                {{ strBuild('Création question consultation @1@' | trad, [idAO]) }}
            {% endif %}

            <a class="principal button" type="button" onClick="ajaxPopupV2('{{ path('Consultation.QuestionReponse.validateQuestion', {idAO: idAO,typeFG:typeFG, idFrs:idFrs, idQst:idQst}) }}', 'form_questRep');">
                {{ 'Enregistrer' |trad }}
            </a>
            {{ arianeAnnuler() }}
        </h4>

        <form method="post" name="form_questRep" id="form_questRep" class="box-form clearfix" style="margin-top:10px;">

            <div class="single">
                <div class="row">
                    <h4>{{'Question' |trad}}</h4>
                    {{ inputAdvance('TEXTAREA', {
                        'name' : 'QUEST',
                        'value': question.QUEST,
                        'pathValidator'     : path('Ajax.validator.isStringAvecEspace'),
                        'paramsValidator'   : "{'sizeMin' : '1', 'sizeMax' : '3000'}",
                        'obligatoire'       : true,
                    }) }}
                </div>
            </div>
            <div class="clearfix listeDoc">

                <div class="colonne3" style="vertical-align:top;" id="rattacher_documents">
                    <div class="row">
                        <div class="rattacher_documents" onclick="ajaxPopup ('{{ path('Facture.popup.ajoutDocRattPJCreation') }}', '{{ 'Ajout de documents rattachés' | trad }}', '','', {'pageParent' : 'creationFacture', 'typeAjout': 'DC', 'numIndice' : document.getElementById('nbDocRatt').value})">{{ 'Rattacher des documents' | trad }}</div>
                        <input type="hidden" name="nbDocRatt" id="nbDocRatt" value="{{ (listeDoc |length) +1 }}" />
                    </div>
                    <div id="fileDelete">
                    </div>
                    {% for doc in listeDoc %}
                        <div class="row " id="DC_{{ doc.NO_ORDRE }}" style="display: inline-block;width: 100%;">
                            <span>{{ doc.NOM_ORI }}</span>
                            <button type="button" style="border: 0px;height: 15px;width: 15px;" class="ajouter bloquant" onclick="supprDocRattPJ('DC', '{{ doc.NO_ORDRE }}')"></button>
                        </div>
                    {% endfor %}
                </div>

            </div>

        </form>

    </div>

    <script>
        function supprDocRattPJ(typeAjout, id)
        {
            $('#'+typeAjout+'_'+id).remove();
            $('#fileDelete').append("<input type='hidden' name='deleteFile[]' value='"+id+"'/>");
        }
    </script>

{% endblock %}
