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 @@ -
{{jalon.nmjal}} | -{{jalon.nbjrs}} | - {% endfor %} -