{% extends "base.html.twig" %} {% block localstyle %} #main { padding-left:0px; margin-bottom:0px; } #mycontent { display:none; } .flot-chart { display: block; height: 450px; } .flot-chart-content { width: 400px; height: 250px; } .flot-chart-subcontent { height: 200px; width: 350px; } {% endblock %} {% block body %}

{{ scrum.name }}

{% for jalon in tbestim %} {% if jalon.nbjrs>0 %}
{{jalon.nmjal}}
{% for column in jalon.columns %}
{{column.nmcol}}{{(filterbynumber=="true"?column.nbiss:column.nbjrs)}} = {{((filterbynumber=="true"?column.nbiss:column.nbjrs) * 100 / (filterbynumber=="true"?jalon.nbiss:jalon.nbjrs))|number_format}}%
{% endfor %}
TOTAL{{(filterbynumber=="true"?jalon.nbiss:jalon.nbjrs)}} = 100%
{% for sprint in jalon.sprints %} {% if jalon.nbjrs != sprint.nbjrs and sprint.nbjrs>0 %}
{{sprint.nmspr}}
{% for column in sprint.columns %}
{{column.nmcol}}{{(filterbynumber=="true"?column.nbiss:column.nbjrs)}} = {{((filterbynumber=="true"?column.nbiss:column.nbjrs) * 100 / (filterbynumber=="true"?sprint.nbiss:sprint.nbjrs))|number_format}}%
{% endfor %}
TOTAL{{(filterbynumber=="true"?sprint.nbiss:sprint.nbjrs)}} = 100%
{% endif %} {% endfor %}
{% endif %} {% endfor %}
{% endblock %} {% block localjavascript %} // View par nombre de tickets {% if filterbynumber %} $("#filterbynumber").prop( "checked", {{ filterbynumber }} ) {% endif %} $('#filterbynumber').change(function() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterbynumber', id:{{scrum.id}}, value: this.checked } }).done(function( data ) { location.reload(); }); }); function showFilters() { if($("#filters").hasClass("d-flex")) { toshow=0; $("#filters").addClass("d-none"); $("#filters").removeClass("d-flex"); } else { toshow=1; $("#filters").addClass("d-flex"); $("#filters").removeClass("d-none"); } $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'showfilters', id:{{scrum.id}}, value: toshow } }); } $(document).ready(function() { // Apply Filter function showhide() { // Afficher masquer les jalons if($("#filtermilestones").val().length !== 0) { $("[data-milestone]").hide(); $.each($("#filtermilestones").val(), function( index, value ) { $("[data-milestone="+value+"]").show(); $("[data-graphmilestone="+value+"]").show(); }); } else { $("[data-milestone]").show(); $("[data-graphmilestone]").show(); } // Afficher masquer les sprints if($("#filtersprints").val().length !== 0) { $("[data-sprint]").hide(); $("[data-graphmilestone]").hide(); $.each($("#filtersprints").val(), function( index, value ) { $("[data-sprint="+value+"]").show(); }); } else if($("#filtermilestones").val().length === 0)$("[data-sprint]").show(); textfilters=""; if($("#filtermilestones").val().length!==0) { data = $("#filtermilestones").select2('data'); textfilters=textfilters+"    JALONS ="; $.each($("#filtermilestones").val(), function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if($("#filtersprints").val().length!==0) { data = $("#filtersprints").select2('data'); textfilters=textfilters+"    SPRINT ="; $.each($("#filtersprints").val(), function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } $("#textfilters").html(textfilters); } // Filter Milestones function filtermilestones() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filtermilestones', id:{{scrum.id}}, value: $("#filtermilestones").val() } }); showhide(); } $('#filtermilestones').select2(); {% if filtermilestones %} {% for milestone in filtermilestones %} $("#filtermilestones").val($("#filtermilestones").val().concat("{{milestone}}")); {%endfor%} $('#filtermilestones').trigger('change'); {% endif %} $('#filtermilestones').on("select2:select", function(e) { filtermilestones(); }); $('#filtermilestones').on("select2:unselect", function(e) { filtermilestones(); }); // Filter Sprints function filtersprints() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filtersprints', id:{{scrum.id}}, value: $("#filtersprints").val() } }); showhide(); } $('#filtersprints').select2(); {% if filtersprints %} {% for sprint in filtersprints %} $("#filtersprints").val($("#filtersprints").val().concat("{{sprint}}")); {%endfor%} $('#filtersprints').trigger('change'); {% endif %} $('#filtersprints').on("select2:select", function(e) { filtersprints(); }); $('#filtersprints').on("select2:unselect", function(e) { filtersprints(); }); {% for jalon in tbestim %} var data = [ {% for column in jalon.columns %} { label: "{{ column.nmcol}}", data: {{ column.nbiss }}, color: "#{{ column.color }}", }, {% endfor %} ]; var plotObj = $.plot($("#floatdonut{{ jalon.idjal }}"), data, { series: { pie: { show: true, radius: 1, label: { show: true, radius: 1, threshold: 0.1, background: { opacity: 0.5, color: '#cdcdcd', }, formatter: function(label, series) { return '' + label + ''; } } } }, legend: { show: false, }, }); console.log("BY number = {{ (filterbynumber=="true" ? 'filtre par nbticket':'filtre par poids') }}"); {% for sprint in jalon.sprints %} console.log("Sprint = {{sprint.nmspr}}"); {% for column in sprint.columns %} console.log({{ (filterbynumber=="true" ? column.nbiss:column.nbjrs) }}); {% endfor %} var data = [ {% for column in sprint.columns %} { label: "{{ column.nmcol}}", data: {{ (filterbynumber=="true" ? column.nbiss:column.nbjrs) }}, color: "#{{ column.color }}", }, {% endfor %} ]; var plotObj = $.plot($("#floatdonut{{ jalon.idjal~"-"~sprint.idspr }}"), data, { series: { pie: { show: true, radius: 1, label: { show: true, radius: 1, threshold: 0.1, background: { opacity: 0.5, color: '#cdcdcd', }, formatter: function(label, series) { return '' + label + ''; } } } }, legend: { show: false, }, }); {% endfor %} {% endfor %} {% if not showfilters %} $("#filters").addClass("d-none"); $("#filters").removeClass("d-flex"); {% endif %} // Appliy filters showhide(); $("#mycontent").show(); }); {% endblock %}