{% extends "base.html.twig" %} {% block localstyle %} html { height:100%} body { height:100%; background-color:#efefef;} #main { padding-left:0px; margin-bottom:0px; } h3 { font-size:14px; margin-top:15px;} #mycontent { width: 5000px; display:none; } .btn-link { cursor:pointer; } .control-label { margin-bottom:0px; } .tag { border-radius: 5px; padding: 8px 8px; margin-bottom: 5px; display: inline-block; min-width: 35px; text-align: center; color: #ffffff !important; zoom: 80%; } .tag i { margin-right:5px; } .assignee { width:30px; margin: 5px 5px 0px 0px; } .state-closed { background-color: #cdcdcd !important; } .text-small { font-size:80%} .text-verysmall { font-size:70%} .submenu a:hover { text-decoration: none; color: var(--colorfttitlelight); } {% endblock %} {% block body %}
{% for column in tbissues %}

{{ column.nmcol }}

{% for jalon in column.jalons %} {% for sprint in jalon.sprints %}
JALON = {{jalon.nmjal}} {% if sprint.idspr!=-100 %}
SPRINT = {{sprint.nmspr}} {% endif %}
    {% for issue in sprint.issues %} {% set tosee=false %} {% if app.session.get('viewclosed')=="true" and issue.giteastate=="closed" %} {% set tosee=true %} {% endif %} {% if issue.giteastate!="closed" %} {% set tosee=true %} {% endif %} {% if tosee %} {% set datalabels="" %} {% set datateams="" %} {% set datatypes="" %} {% set dataprioritys="datapriority"~giteaprioritys|last %} {% set issuprioritycolor=prioritycolor %} {% for label in issue.giteajson.labels %} {% if label.id not in giteacolumns and label.id in giteateams %} {% set datateams=datateams~"datateam"~label.id~" " %} {% endif %} {% if label.id not in giteacolumns and label.id in giteatypes %} {% set datatypes=datatypes~"datatype"~label.id~" " %} {% endif %} {% if label.id not in giteacolumns and label.id in giteaprioritys %} {% set dataprioritys="datapriority"~label.id~" " %} {% set issuprioritycolor="#"~label.color %} {% endif %} {% if label.id not in giteacolumns and label.id not in giteateams and label.id not in giteatypes and label.id not in giteaprioritys %} {% set datalabels=datalabels~"datalabel"~label.id~" " %} {% endif %} {% endfor %} {% set dataassignees="" %} {% for assignee in issue.giteajson.assignees %} {% set dataassignees=dataassignees~"dataassignee"~assignee.id~" " %} {% endfor %} {% set backcolor="" %} {% if not issue.color is empty %} {% set backcolor="background-color:"~issue.color~";" %} {% elseif issue.scrumissueblock and not issue.scrumissueblock.color is empty %} {% set backcolor="background-color:"~issue.scrumissueblock.color~";" %} {% endif %}
    {% for label in issue.giteajson.labels %} {% if label.id not in giteacolumns and label.id in giteaprioritys %} {{ label.name }} {% endif %} {% endfor %}
    {% for label in issue.giteajson.labels %} {% if label.id not in giteacolumns and label.id in giteatypes %} {{ label.name }} {% endif %} {% endfor %}
    {% for label in issue.giteajson.labels %} {% if label.id not in giteacolumns and label.id in giteateams %} {{ label.name }} {% endif %} {% endfor %}
    {% for label in issue.giteajson.labels %} {% if label.id not in giteacolumns and label.id not in giteateams and label.id not in giteaprioritys and label.id not in giteatypes %} {{ label.name }} {% endif %} {% endfor %}
    {% for assignee in issue.giteajson.assignees %} {% endfor %}
    Crée le {{issue.giteajson.created_at|date("d/m/y")}}
    Modifié le {{issue.giteajson.updated_at|date("d/m/y")}}
    {% if issue.giteastate=="closed" %}
    Clos le {{issue.giteajson.closed_at|date("d/m/y")}}
    {% endif %}
    {% endif %} {% endfor %}
{% endfor %} {% endfor %}
{% endfor %}
{% endblock %} {% block localjavascript %} 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() { // Vue condensée if($("#viewcondensed").is(':checked')) { $(".issu-detail").hide(); } else { $(".issu-detail").show(); } // Afficher masquer les jalons if($("#filtermilestones").val().length !== 0 && $("#filtersprints").val().length === 0) { $("[data-milestone]").hide(); $.each($("#filtermilestones").val(), function( index, value ) { console.log(value); $("[data-milestone="+value+"]").show(); }); } else $("[data-milestone]").show(); // Afficher masquer les sprints if($("#filtersprints").val().length !== 0) { $("[data-millestonesprint]").hide(); $.each($("#filtersprints").val(), function( index, value ) { $("[data-millestonesprint="+value+"]").show(); }); } else if($("#filtermilestones").val().length === 0)$("[data-millestonesprint]").show(); $(".issue").show(); $( ".issue" ).each(function( index ) { domissue=$(this); toshow=true; if(toshow&&$("#filterteams").val().length !== 0) { toshow=false; $.each($("#filterteams").val(), function( index, value ) { if (domissue.hasClass("datateam"+value)) toshow=true; }); } if(toshow&&$("#filterprioritys").val().length !== 0) { toshow=false; $.each($("#filterprioritys").val(), function( index, value ) { if (domissue.hasClass("datapriority"+value)) toshow=true; }); } if(toshow&&$("#filtertypes").val().length !== 0) { toshow=false; $.each($("#filtertypes").val(), function( index, value ) { if (domissue.hasClass("datatype"+value)) toshow=true; }); } if(toshow&&$("#filterlabels").val().length !== 0) { toshow=false; $.each($("#filterlabels").val(), function( index, value ) { if(domissue.hasClass("datalabel"+value)) toshow=true; }); } if(toshow&&$("#filterassignees").val().length !== 0) { toshow=false; $.each($("#filterassignees").val(), function( index, value ) { if (domissue.hasClass("dataassignee"+value)) toshow=true; }); } if(toshow&&$("#filterexcludes").val().length !== 0) { $.each($("#filterexcludes").val(), function( index, value ) { if(domissue.hasClass("datalabel"+value)) toshow=false; }); } if(!toshow) domissue.hide(); }); 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; }); } if($("#filterteams").val().length!==0) { data = $("#filterteams").select2('data'); textfilters=textfilters+"    EQUIPES ="; $.each($("#filterteams").val(), function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if($("#filterprioritys").val().length!==0) { data = $("#filterprioritys").select2('data'); textfilters=textfilters+"    EQUIPES ="; $.each($("#filterprioritys").val(), function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if($("#filtertypes").val().length!==0) { data = $("#filtertypes").select2('data'); textfilters=textfilters+"    EQUIPES ="; $.each($("#filtertypes").val(), function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if($("#filterlabels").val().length!==0) { data = $("#filterlabels").select2('data'); textfilters=textfilters+"    ETIQUETTES ="; $.each($("#filterlabels").val(), function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if($("#filterassignees").val().length!==0) { data = $("#filterassignees").select2('data'); textfilters=textfilters+"    AFFECTATIONS ="; $.each($("#filterassignees").val(), function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } if($("#filterexcludes").val().length!==0) { data = $("#filterexcludes").select2('data'); textfilters=textfilters+"    EXCLURE ETIQUETTES ="; $.each($("#filterexcludes").val(), function( index, value ) { if(index>0)textfilters=textfilters+" &"; textfilters=textfilters+" "+data[index].text; }); } $("#textfilters").html(textfilters); } $(document).on('click','.viewissu',function(){ $(".submenu").hide(); url="{{path('app_scrumissue_view',{id:"xxx"})}}"; url=url.replace("xxx",$(this).data("issue")); ModalLoad('mymodallarge','Aperçu Ticket',url); }); $(document).on('click','.lockissu',function(){ $(".modal-title").html("#"+$(this).data("giteaid")+" - "+$(this).data("giteatitle")); $("#modal-issueid").val($(this).data("issue")); $("#modal-issueblocked").val(""); $("#mymodalblock").modal('show'); $("#modal-issueblocked").focus(); }); $("#issu_blockupdate").click(function(){ $.ajax({ method: "POST", url: "{{path("app_scrumissue_block")}}", data: { id:$("#modal-issueid").val(), issueblocked:$("#modal-issueblocked").val(), }, success: function(data) { location.reload(); }, error: function (request, status, error) { $("#issueblocked").modal('hide'); } }); }); $(document).on('click','.unlockissu',function(){ if (window.confirm("Souhaitez-vous enlever le blocage ?")) { $.ajax({ method: "POST", url: "{{path("app_scrumissue_unblock")}}", data: { id:$(this).data("issue"), }, success: function(data) { location.reload(); }, error: function (request, status, error) { alert("pb sur le déblocage"); } }); } }); $(document).on('click','.modissu',function(){ $(".modal-title").html("#"+$(this).data("giteaid")+" - "+$(this).data("giteatitle")); $("#modal-issueid").val($(this).data("issue")); $.ajax({ method: "POST", url: "{{path("app_scrumissue_info")}}", data: { id:$("#modal-issueid").val(), }, success: function(data) { $("#modal-issueweight").val(data.weight); $("#mymodalissue").modal('show'); $("#modal-issueweight").focus(); }, }); }); $("#issu_update").click(function(){ $.ajax({ method: "POST", url: "{{path("app_scrumissue_update")}}", data: { id:$("#modal-issueid").val(), weight:$("#modal-issueweight").val(), }, success: function(data) { $(".issue"+$("#modal-issueid").val()+"-weight").html($("#modal-issueweight").val()); refreshinfo(); $("#mymodalissue").modal('hide'); }, error: function (request, status, error) { $("#mymodalissue").modal('hide'); } }); }); $(".pick-a-color").on("change", function() { $.ajax({ method: "POST", url: "{{path("app_scrumissue_color")}}", data: { id:$(this).data("issue"), color:$(this).val(), }, success: function(data) { location.reload(); }, error: function (request, status, error) { alert("pb sur le set color"); } }); }); // 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 Sprint function filtersprints() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filtersprints', id:{{scrum.id}}, value: $("#filtersprints").val() } }); showhide(); } $('#filtersprints').select2({sorter: data => data.sort((a, b) => a.text.localeCompare(b.text)),}); {% 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(); }); // Filter Teams function filterteams() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterteams', id:{{scrum.id}}, value: $("#filterteams").val() } }); showhide(); } $('#filterteams').select2(); {% if filterteams %} {% for team in filterteams %} $("#filterteams").val($("#filterteams").val().concat("{{team}}")); {%endfor%} $('#filterteams').trigger('change'); {% endif %} $('#filterteams').on("select2:select", function(e) { filterteams(); }); $('#filterteams').on("select2:unselect", function(e) { filterteams(); }); // Filter Proritys function filterprioritys() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterprioritys', id:{{scrum.id}}, value: $("#filterprioritys").val() } }); showhide(); } $('#filterprioritys').select2(); {% if filterprioritys %} {% for priority in filterprioritys %} $("#filterprioritys").val($("#filterprioritys").val().concat("{{priority}}")); {%endfor%} $('#filterprioritys').trigger('change'); {% endif %} $('#filterprioritys').on("select2:select", function(e) { filterprioritys(); }); $('#filterprioritys').on("select2:unselect", function(e) { filterprioritys(); }); // Filter Types function filtertypes() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filtertypes', id:{{scrum.id}}, value: $("#filtertypes").val() } }); showhide(); } $('#filtertypes').select2(); {% if filtertypes %} {% for type in filtertypes %} $("#filtertypes").val($("#filtertypes").val().concat("{{type}}")); {%endfor%} $('#filtertypes').trigger('change'); {% endif %} $('#filtertypes').on("select2:select", function(e) { filtertypes(); }); $('#filtertypes').on("select2:unselect", function(e) { filtertypes(); }); // Filter Labels function filterlabels() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterlabels', id:{{scrum.id}}, value: $("#filterlabels").val() } }); showhide(); } $('#filterlabels').select2(); {% if filterlabels %} {% for label in filterlabels %} $("#filterlabels").val($("#filterlabels").val().concat("{{label}}")); {%endfor%} $('#filterlabels').trigger('change'); {% endif %} $('#filterlabels').on("select2:select", function(e) { filterlabels(); }); $('#filterlabels').on("select2:unselect", function(e) { filterlabels(); }); // Filtre Assignees function filterassignees() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterassignees', id:{{scrum.id}}, value: $("#filterassignees").val() } }); showhide(); } $('#filterassignees').select2(); {% if filterassignees %} {% for assignee in filterassignees %} $("#filterassignees").val($("#filterassignees").val().concat("{{assignee}}")); {%endfor%} $('#filterassignees').trigger('change'); {% endif %} $('#filterassignees').on("select2:select", function(e) { filterassignees(); }); $('#filterassignees').on("select2:unselect", function(e) { filterassignees(); }); // Filter Labels function filterexcludes() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'filterexcludes', id:{{scrum.id}}, value: $("#filterexcludes").val() } }); showhide(); } $('#filterexcludes').select2(); {% if filterexcludes %} {% for label in filterexcludes %} $("#filterexcludes").val($("#filterexcludes").val().concat("{{label}}")); {%endfor%} $('#filterexcludes').trigger('change'); {% endif %} $('#filterexcludes').on("select2:select", function(e) { filterexcludes(); }); $('#filterexcludes').on("select2:unselect", function(e) { filterexcludes(); }); // View condensed {% if viewcondensed %} $("#viewcondensed").prop( "checked", {{ viewcondensed }} ) {% endif %} $('#viewcondensed').change(function() { $.ajax({ method: "POST", url: "{{ path('app_user_preference') }}", data: { key:'viewcondensed', id:{{scrum.id}}, value: this.checked } }).done(function( data ) { showhide(); }); }); // Resume filtre {% if not showfilters %} $("#filters").addClass("d-none"); $("#filters").removeClass("d-flex"); {% endif %} // Appliy filters showhide(); refreshinfo(); $("#mycontent").show(); lastupdate="{{scrum.updatedate|date("Ymd H:i:s")}}"; console.log(lastupdate); $( ".scrumcolumn" ).sortable({ handle: ".issu-id", connectWith: ".scrumcolumn", cursor: "move", start: function( event, ui ) { $(".submenu").hide(); }, stop: function( event, ui ) { id=$(ui.item).data("issue"); oldcolumn=$(ui.item).data("column"); oldmilestone=$(ui.item).data("milestone"); oldsprint=$(ui.item).data("sprint"); newcolumn=$(ui.item).parent().data("column"); newmilestone=$(ui.item).parent().data("milestone"); newsprint=$(ui.item).parent().data("sprint"); console.log("ID = "+id+" = Column : "+oldcolumn+">>"+newcolumn+" = Milestone : "+oldmilestone+">>"+newmilestone+" = Sprint : "+oldsprint+">>"+newsprint ); if(oldcolumn!=newcolumn||oldmilestone!=newmilestone||oldsprint!=newsprint) { $.ajax({ method: "POST", url: "{{path("app_scrumissue_change")}}", data: { id:id, oldcolumn:oldcolumn, oldmilestone:oldmilestone, oldsprint:oldsprint, newcolumn:newcolumn, newmilestone:newmilestone, newsprint:newsprint }, success: function(data) { $(ui.item).data("column",newcolumn); $(ui.item).data("milestone",newmilestone); $(ui.item).data("sprint",newsprint); if(data) lastupdate=data; console.log(lastupdate); refreshinfo(); }, error: function (request, status, error) { $( ".scrumcolumn" ).sortable('cancel'); } }); } lstordered=""; $(".scrumcolumn div" ).each(function( index ) { if($(this).data("id")) { if(index==0) lstordered=$(this).data("id"); else lstordered=lstordered+","+$(this).data("id"); } }); $.ajax({ method: "POST", url: "{{path("app_scrumissue_order")}}", data: { id:{{scrum.id}}, lstordered:lstordered, } }); }, }); var intervalId = window.setInterval(function(){ console.log(lastupdate); $.ajax({ method: "POST", url: "{{path("app_scrumissue_ctrlchange")}}", data: { id:{{scrum.id}}, lastupdate:lastupdate }, success: function(fgupdated) { if(fgupdated) { $("#haveupdate").show(); } } }); }, 300000); }); function refreshinfo() { $.ajax({ method: "POST", url: "{{path("app_scrum_info",{id:scrum.id})}}", success: function(data) { html=""; $("[data-weight]").html(""); Object.entries(data.tbestim).forEach(entry => { const [keyj, jalon] = entry; html+=''; html+=''; html+=''; html+=''; html+=''; nofirst=false; Object.entries(jalon.sprints).forEach(entry => { const [keys, sprint] = entry; if(nofirst || sprint.idspr!=-100) { html+=''; html+=''; html+=''; html+=''; } Object.entries(sprint.columns).forEach(entry => { const [keys, column] = entry; $("[data-weight="+column.gicol+"-"+jalon.gijal+"-"+sprint.idspr+"]").html(column.nbjrs); }); nofirst=true; }); html+='
'+jalon.nmjal+''+jalon.nbjrs+'
'+sprint.nmspr+''+sprint.nbjrs+'
'; }); $("#tbestim").html(html); } }); } function issuhover(btn,idissu) { $(".submenu").hide(); $("#submenu"+idissu).css("display","flex"); } function issuout(menu) { $(menu).css("display","none"); } {% endblock %}