estim sprint

This commit is contained in:
afornerot 2024-02-21 22:18:01 +01:00
parent 2df92a3b7f
commit 4f88121362
2 changed files with 52 additions and 13 deletions

View File

@ -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 // Préférences utilisateur
$viewcondensed = $em->getRepository("App:User")->getUserpreference($this->getUser(),"viewcondensed",$id); $viewcondensed = $em->getRepository("App:User")->getUserpreference($this->getUser(),"viewcondensed",$id);
$filtermilestones = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filtermilestones",$id); $filtermilestones = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filtermilestones",$id);
@ -708,14 +715,33 @@ class ScrumController extends AbstractController
if($giteaissue->milestone) $milestoneid=$giteaissue->milestone->id; if($giteaissue->milestone) $milestoneid=$giteaissue->milestone->id;
else $milestoneid=-100; else $milestoneid=-100;
if(!array_key_exists($milestoneid,$weights)) $weights[$milestoneid]=0; if($scrumissue->getScrumsprint()) $sprintid=$milestoneid."-".$scrumissue->getScrumsprint()->getId();
$weights[$milestoneid]=$weights[$milestoneid]+$scrumissue->getWeight(); 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=[];
$output["weights"]=$weights; $output["weights"]=$weights;
return new JsonResponse($output); return new JsonResponse($output);
} }

View File

@ -139,14 +139,23 @@
</div> </div>
</div> </div>
<div style="color:var(--colorftbodydark);zoom:75%;" class="mt-5"> <div style="" class="mt-5">
<table style="width:100%">
{% for jalon in tbestim %} {% for jalon in tbestim %}
<table style="color:var(--colorftbodydark);zoom:75%; width:100%; border:1px solid var(--colorbgbodylight)">
<tr> <tr>
<td>{{jalon.nmjal}}</td> <td>{{jalon.nmjal}}</td>
<td><span id="total{{jalon.gijal}}" class="totalweight">{{jalon.nbjrs}}</span></td> <td style="width:30px;text-align:right;"><span id="totaljal{{jalon.gijal}}" class="totalweight">{{jalon.nbjrs}}</span></td>
</tr>
{% for sprint in jalon.sprints %}
{% if not loop.first or sprint.idspr!=-100 %}
<tr>
<td>{{sprint.nmspr}}</td>
<td style="width:30px;text-align:right;"><span id="totalspr{{jalon.gijal}}-{{sprint.idspr}}" class="totalweight">{{sprint.nbjrs}}</span></td>
</tr>
{% endif %}
{% endfor %} {% endfor %}
</table> </table>
{% endfor %}
</div> </div>
</div> </div>
@ -561,8 +570,12 @@
$(".totalweight").html("0"); $(".totalweight").html("0");
Object.entries(data.weights).forEach(entry => { Object.entries(data.weights).forEach(entry => {
const [key, value] = entry; const [keyj, jalon] = entry;
$("#total"+key).html(value); $("#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);
}); });