correction ano column if label on orga

This commit is contained in:
afornerot 2023-11-07 17:03:54 +01:00
parent 795a212810
commit 090471aa9e
2 changed files with 12 additions and 5 deletions

View File

@ -176,7 +176,10 @@ class ScrumController extends AbstractController
$data=$em->getRepository($this->entity)->find($id); $data=$em->getRepository($this->entity)->find($id);
if(!$data) return $this->redirectToRoute($this->route); if(!$data) return $this->redirectToRoute($this->route);
$em->getRepository("App:Scrum")->getGitea($data,$giteaassignees,$giteacolumns,$giteamilestones,$giteateams,$giteaprioritys,$giteatypes,$gitealabels); $forcereload=false;
if($request->get("forcereload")) $forcereload=$request->get("forcereload");
$em->getRepository("App:Scrum")->getGitea($data,$giteaassignees,$giteacolumns,$giteamilestones,$giteateams,$giteaprioritys,$giteatypes,$gitealabels,$forcereload);
// Préférences utilisateur // Préférences utilisateur
$filtermilestones = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filtermilestones",$id); $filtermilestones = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filtermilestones",$id);
@ -314,12 +317,13 @@ class ScrumController extends AbstractController
public function info($id,Request $request) public function info($id,Request $request)
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$viewclosed = $request->getSession()->get("viewclosed");
// Rechercher du scrum en cours // Rechercher du scrum en cours
$scrum=$em->getRepository("App:Scrum")->find($id); $scrum=$em->getRepository("App:Scrum")->find($id);
if(!$scrum) return new JsonResponse(['message' => 'No Issue'], 403); if(!$scrum) return new JsonResponse(['message' => 'No Issue'], 403);
$giteaissues=$this->giteaservice->getIssues($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"]); $giteaissues=$this->giteaservice->getIssues($scrum->getGiteajson()["owner"]["login"],$scrum->getGiteajson()["name"],"?state=".($viewclosed=="true"?"all":"open"));
$weights=[]; $weights=[];
foreach($giteaissues as $giteaissue) { foreach($giteaissues as $giteaissue) {

View File

@ -36,7 +36,7 @@ class ScrumRepository extends ServiceEntityRepository
return $scrums; return $scrums;
} }
} }
public function getGitea($scrum,&$giteaassignees,&$giteacolumns,&$giteamilestones,&$giteateams,&$giteaprioritys,&$giteatypes,&$gitealabels) { public function getGitea($scrum,&$giteaassignees,&$giteacolumns,&$giteamilestones,&$giteateams,&$giteaprioritys,&$giteatypes,&$gitealabels, $forcereload=false) {
$viewclosed = $this->session->get("viewclosed"); $viewclosed = $this->session->get("viewclosed");
// Récupérer le dernier order // Récupérer le dernier order
@ -151,7 +151,10 @@ class ScrumRepository extends ServiceEntityRepository
if(!$giteaissue->milestone&&!is_null($scrumissue->getGiteamilestone())) if(!$giteaissue->milestone&&!is_null($scrumissue->getGiteamilestone()))
$fgissueupdated=true; $fgissueupdated=true;
//$fgissueupdated=true; if($forcereload) {
$fgissueupdated=true;
}
if($fgissueupdated) { if($fgissueupdated) {
$fgscrumupdate=true; $fgscrumupdate=true;
$this->majissue($scrumissue,$giteaissue); $this->majissue($scrumissue,$giteaissue);
@ -201,7 +204,7 @@ class ScrumRepository extends ServiceEntityRepository
$havecolumn=false; $havecolumn=false;
foreach($giteaissue->labels as $gitealabel) { foreach($giteaissue->labels as $gitealabel) {
$scrumcolumn=$this->_em->getRepository('App:Scrumcolumn')->findOneBy(["giteaid"=>$gitealabel->id]); $scrumcolumn=$this->_em->getRepository('App:Scrumcolumn')->findOneBy(["scrum"=>$scrumissue->getScrum(),"giteaid"=>$gitealabel->id]);
if($scrumcolumn) { if($scrumcolumn) {
$havecolumn=true; $havecolumn=true;
$scrumissue->setScrumcolumn($scrumcolumn); $scrumissue->setScrumcolumn($scrumcolumn);