{% extends "base.html.twig" %} {% block localstyle %} .homecard { margin: 20px 20px 0px 0px; float:left; } table { } th,td { border: 1px solid #37474F; color: #ffffff; background-color:#37474F; text-align:center; width: 70px; } td { background-color:#e8ecf1; cursor: help; height: 44px; vertical-align: top; color: #ffffff; } .date { font-size: 9px; color: #37474F; } .allday { font-size: 12px; float:left; width:100%; height: 18px; flex: 0 0 auto; } .am, .ap { font-size: 12px; float:left; width:50%; height: 18px; flex: 0 0 auto; } .astreinte { font-size: 11px; float:left; width:100%; height:12px; } {% endblock %} {% block body %} {% if fgprint is defined and fgprint %}

Validation

{%endif%} {% for user in users %} {% set nbday=1 %}
{{ user.user.displayname }}
{% set btnvalidate=false %} {% for event in user.events %} {% if nbday==1 %} {% endif %} {% set nbday=nbday+1 %} {% if nbday==8 %} {% set nbday=1 %} {% endif %} {% endfor %}
S L M M J V S D
{% set first=event.events|first %} {% if first and first.validate %} {%else%} {% set btnvalidate=true %} {%endif%} {{event.date|date("W")}}
{{ event.date | date("d/m") }}
{% set haveam=false %} {% for detail in event.events %} {% if detail.allday %}
1
{% else %} {%if detail.am %} {% set haveam=true %}
0.5
{% endif %} {%if detail.ap %} {% if not haveam %}
{%endif%}
0.5
{% endif %} {% endif %} {% endfor %}
{% if event.astreinte %}
*
{% else %}
{% endif %}
{% if (loop.index % 2) == 0 %}
 
{% endif %} {% endfor %} {% endblock %} {% block localjavascript %} $(document).ready(function() { resizePanel(); }); $( window ).resize(function() { resizePanel(); }); function printPage(pdf,pdfName,options,lstPage,cpt) { pdf.addHTML($("#content h1"), 10, 10, options, function(){ pdf.addHTML(lstPage[cpt], 0, 40, options, function(){ cpt=cpt+1; if(cpt>=lstPage.length) { $("#page-wrapper").first("row").css("width","initial"); } else { pdf.addPage(); printPage(pdf,pdfName,options,lstPage,cpt); } }); }); } function myprint() { document.location.href="{{path(app.request.attributes.get('_route'),{fgprint:true})}}"; } function resizePanel() { maxheight=0; $( ".homecard" ).each(function( index ) { if($(this).height()>maxheight) maxheight=$(this).height(); }); $( ".homecard" ).height(maxheight); } function validate(iduser,idday,day) { $.ajax({ type: "POST", data: { iduser: iduser, day: day, }, url: "{{ path('app_validation_validate') }}", success: function (response) { response=JSON.parse(response); if(response.return=="KO") { alert(response.error); } else { $(".devalidate-"+iduser).remove(); html=""; $(".validate-"+iduser).first().replaceWith(html); $(".validate-"+iduser).first().show(); } } }); } function devalidate(iduser,idday,day) { $.ajax({ type: "POST", data: { iduser: iduser, day: day, }, url: "{{ path('app_validation_devalidate') }}", success: function (response) { response=JSON.parse(response); if(response.return=="KO") { alert(response.error); } else { location.reload(); } } }); } {% endblock %}