This commit is contained in:
afornerot 2024-06-15 12:25:58 +02:00
parent 0d9caea067
commit 88ffe47f6e
2 changed files with 39 additions and 12 deletions

View File

@ -679,6 +679,8 @@ class ScrumController extends AbstractController
}
private function getEstim($scrum) {
// Initialisation de l'enregistrement
$em = $this->getDoctrine()->getManager();
$firstcolumn=$em->getRepository('App:Scrumcolumn')->findOneBy(["scrum"=>$scrum], ['rowid' => 'ASC']);
@ -694,10 +696,25 @@ class ScrumController extends AbstractController
$tbestim=[];
$viewclosed = $this->get('session')->get("viewclosed");
foreach($issues as $issue) {
if($viewclosed=="false") {
$giteamilestones=$this->giteaservice->getMilestones($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"],"?state=open");
$giteamilestones=array_column($giteamilestones,"id");
}
// bypass closed
if($viewclosed=="false"&&($issue->getGiteastate()=="closed"||($issue->getScrumsprint()&&$issue->getScrumsprint()->getClosed()))) continue;
foreach($issues as $issue) {
// bypass jalon closed
if($viewclosed=="false") {
/*
if(array_key_exists("milestone",$issue->getGiteajson()) && !empty($issue->getGiteajson()["milestone"]) && $issue->getGiteajson()["milestone"])
dump($issue->getGiteajson()["milestone"]["title"]);
*/
if(array_key_exists("milestone",$issue->getGiteajson()) && !empty($issue->getGiteajson()["milestone"]) && !in_array($issue->getGiteajson()["milestone"]["id"],$giteamilestones))
continue;
}
//if($viewclosed=="false"&&($issue->getGiteastate()=="closed"||($issue->getScrumsprint()&&$issue->getScrumsprint()->getClosed()))) continue;
// Ids
$idcol=($issue->getScrumcolumn()?$issue->getScrumcolumn()->getId():$firstcolumn->getId());
@ -777,14 +794,22 @@ class ScrumController extends AbstractController
$tbestim[$idjal]["sprints"][$idspr]["nbiss"]++;
$tbestim[$idjal]["sprints"][$idspr]["columns"][$idcol]["nbiss"]++;
$this->formatDec($tbestim[$idjal]["nbjrs"]);
$this->formatDec($tbestim[$idjal]["columns"][$idcol]["nbjrs"]);
$this->formatDec($tbestim[$idjal]["sprints"][$idspr]["nbjrs"]);
$this->formatDec($tbestim[$idjal]["sprints"][$idspr]["columns"][$idcol]["nbjrs"]);
}
// dd("stop");
$keysort = array_column($tbestim, 'nmjal');
array_multisort($keysort, SORT_DESC, $tbestim);
foreach($tbestim as $keyj => $jalon) {
$keysort = array_column($jalon["sprints"],"nmspr");
array_multisort($keysort, SORT_DESC, $tbestim[$keyj]["sprints"]);
}
return $tbestim;
}

View File

@ -80,9 +80,9 @@
<div id="floatdonut{{ jalon.idjal }}" class="flot-chart-content"></div>
<div style="min-width:250px; color: #ffffff; padding: 3px;">
{% for column in jalon.columns %}
<div style="padding: 3px; background-color:#{{column.color}}">{{column.nmcol}}<span class="float-right">{{(filterbynumber?column.nbiss:column.nbjrs)}} = {{((filterbynumber?column.nbiss:column.nbjrs) * 100 / (filterbynumber?jalon.nbiss:jalon.nbjrs))|number_format}}%</<span></div>
<div style="padding: 3px; background-color:#{{column.color}}">{{column.nmcol}}<span class="float-right">{{(filterbynumber=="true"?column.nbiss:column.nbjrs)}} = {{((filterbynumber=="true"?column.nbiss:column.nbjrs) * 100 / (filterbynumber=="true"?jalon.nbiss:jalon.nbjrs))|number_format}}%</<span></div>
{% endfor %}
<div style="padding: 3px;color: #000">TOTAL<span class="float-right">{{(filterbynumber?jalon.nbiss:jalon.nbjrs)}} = 100%</<span></div>
<div style="padding: 3px;color: #000">TOTAL<span class="float-right">{{(filterbynumber=="true"?jalon.nbiss:jalon.nbjrs)}} = 100%</<span></div>
</div>
</div>
<div class="d-flex flex-wrap justify-content-center">
@ -94,9 +94,9 @@
<div id="floatdonut{{ jalon.idjal~"-"~sprint.idspr }}" class="flot-chart-subcontent" style="float:left"></div>
<div class="mt-3" style="color: #ffffff;">
{% for column in sprint.columns %}
<div style="padding: 3px; background-color:#{{column.color}}">{{column.nmcol}}<span class="float-right">{{(filterbynumber?column.nbiss:column.nbjrs)}} = {{((filterbynumber?column.nbiss:column.nbjrs) * 100 / (filterbynumber?sprint.nbiss:sprint.nbjrs))|number_format}}%</<span></div>
<div style="padding: 3px; background-color:#{{column.color}}">{{column.nmcol}}<span class="float-right">{{(filterbynumber=="true"?column.nbiss:column.nbjrs)}} = {{((filterbynumber=="true"?column.nbiss:column.nbjrs) * 100 / (filterbynumber=="true"?sprint.nbiss:sprint.nbjrs))|number_format}}%</<span></div>
{% endfor %}
<div style="padding: 3px;color: #000">TOTAL<span class="float-right">{{(filterbynumber?sprint.nbiss:sprint.nbjrs)}} = 100%</<span></div>
<div style="padding: 3px;color: #000">TOTAL<span class="float-right">{{(filterbynumber=="true"?sprint.nbiss:sprint.nbjrs)}} = 100%</<span></div>
</div>
</div>
</div>
@ -300,16 +300,18 @@
},
});
console.log({{filterbynumber}});
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 ? column.nbiss:column.nbjrs) }});
console.log({{ (filterbynumber=="true" ? column.nbiss:column.nbjrs) }});
{% endfor %}
var data = [
{% for column in sprint.columns %}
{
label: "{{ column.nmcol}}",
data: {{ (filterbynumber ? column.nbiss:column.nbjrs) }},
data: {{ (filterbynumber=="true" ? column.nbiss:column.nbjrs) }},
color: "#{{ column.color }}",
},
{% endfor %}