diff --git a/src/Controller/ScrumController.php b/src/Controller/ScrumController.php index 1cb7f33..5ed71c0 100755 --- a/src/Controller/ScrumController.php +++ b/src/Controller/ScrumController.php @@ -370,6 +370,13 @@ class ScrumController extends AbstractController } } + $rowjal = array_column($tbestim, 'rowjal'); + array_multisort($rowjal, SORT_DESC, $tbestim); + foreach($tbestim as $keyjal=>$jalon) { + $rowspr = array_column($tbestim[$keyjal]["sprints"], 'rowspr'); + array_multisort($rowspr, SORT_DESC, $tbestim[$keyjal]["sprints"]); + } + // Préférences utilisateur $viewcondensed = $em->getRepository("App:User")->getUserpreference($this->getUser(),"viewcondensed",$id); $filtermilestones = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filtermilestones",$id); @@ -707,15 +714,34 @@ class ScrumController extends AbstractController if($scrumissue) { if($giteaissue->milestone) $milestoneid=$giteaissue->milestone->id; else $milestoneid=-100; - - if(!array_key_exists($milestoneid,$weights)) $weights[$milestoneid]=0; - $weights[$milestoneid]=$weights[$milestoneid]+$scrumissue->getWeight(); + + if($scrumissue->getScrumsprint()) $sprintid=$milestoneid."-".$scrumissue->getScrumsprint()->getId(); + else $sprintid=$milestoneid."-".-100; + + + if(!array_key_exists($milestoneid,$weights)) { + $weights[$milestoneid]=[ + "id" => $milestoneid, + "weight"=>0, + "sprints"=>[], + ]; + } + + if(!array_key_exists($sprintid,$weights[$milestoneid]["sprints"])) { + $weights[$milestoneid]["sprints"][$sprintid]=[ + "id" => $sprintid, + "weight"=>0 + ]; + } + + $weights[$milestoneid]["weight"]+=$scrumissue->getWeight(); + $weights[$milestoneid]["sprints"][$sprintid]["weight"]+=$scrumissue->getWeight(); + //dump($weights[$milestoneid]["sprints"][$sprintid]["weight"]); } } $output=[]; $output["weights"]=$weights; - return new JsonResponse($output); } diff --git a/templates/Scrum/view.html.twig b/templates/Scrum/view.html.twig index a9196e0..cf69c12 100644 --- a/templates/Scrum/view.html.twig +++ b/templates/Scrum/view.html.twig @@ -139,14 +139,23 @@ -
- - {% for jalon in tbestim %} +
+ {% for jalon in tbestim %} +
- - {% endfor %} -
{{jalon.nmjal}}{{jalon.nbjrs}}
+ {{jalon.nbjrs}} + + {% for sprint in jalon.sprints %} + {% if not loop.first or sprint.idspr!=-100 %} + + {{sprint.nmspr}} + {{sprint.nbjrs}} + + {% endif %} + {% endfor %} + + {% endfor %}
@@ -561,8 +570,12 @@ $(".totalweight").html("0"); Object.entries(data.weights).forEach(entry => { - const [key, value] = entry; - $("#total"+key).html(value); + const [keyj, jalon] = entry; + $("#totaljal"+jalon.id).html(jalon.weight.toFixed(1).replace(/\.0$/, '')); + Object.entries(jalon.sprints).forEach(entry => { + const [keys, sprint] = entry; + $("#totalspr"+sprint.id).html(sprint.weight.toFixed(1).replace(/\.0$/, '')); + }); }); } }); @@ -957,7 +970,7 @@ } } }); - }, 60000); + }, 300000); });