diff --git a/src/ninegitea-1.0/src/Controller/ScrumController.php b/src/ninegitea-1.0/src/Controller/ScrumController.php index 3e63ed1..6cbed3e 100755 --- a/src/ninegitea-1.0/src/Controller/ScrumController.php +++ b/src/ninegitea-1.0/src/Controller/ScrumController.php @@ -238,6 +238,7 @@ class ScrumController extends AbstractController } // Récupérer les issues de gitea + $giteaissues=$this->giteaservice->getIssues($data->getGiteajson()["owner"]["login"],$data->getGiteajson()["name"]); if(!is_array($giteaissues)) die("Probleme de connexion avec gitea veuillez vous reconnecter"); @@ -259,37 +260,39 @@ class ScrumController extends AbstractController $scrumissue->setGiteaid($giteaissue->id); } - $scrumissue->setGiteanumber($giteaissue->number); - $scrumissue->setGiteastate($giteaissue->state); - $scrumissue->setGiteatitle($giteaissue->title); - if($giteaissue->milestone) { - $scrumissue->setGiteamilestone($giteaissue->milestone->id); - $scrumissue->setGiteamilestonename($giteaissue->milestone->title); - } - else { - $scrumissue->setGiteamilestone(null); - $scrumissue->setGiteamilestonename(null); - } - $scrumissue->setGiteajson(json_decode(json_encode($giteaissue), true)); - - $em->persist($scrumissue); - $em->flush(); - array_push($tbgiteaissues,$giteaissue->number); - - $havecolumn=false; - foreach($giteaissue->labels as $gitealabel) { - $scrumcolumn=$em->getRepository('App:Scrumcolumn')->findOneBy(["giteaid"=>$gitealabel->id]); - if($scrumcolumn) { - $havecolumn=true; - $scrumissue->setScrumcolumn($scrumcolumn); - break; + if($scrumissue->getGiteajson()["updated_at"]!=json_decode(json_encode($giteaissue), true)["updated_at"]) { + $scrumissue->setGiteanumber($giteaissue->number); + $scrumissue->setGiteastate($giteaissue->state); + $scrumissue->setGiteatitle($giteaissue->title); + if($giteaissue->milestone) { + $scrumissue->setGiteamilestone($giteaissue->milestone->id); + $scrumissue->setGiteamilestonename($giteaissue->milestone->title); } - } - if(!$havecolumn) $scrumissue->setScrumcolumn($firstcolumn); + else { + $scrumissue->setGiteamilestone(null); + $scrumissue->setGiteamilestonename(null); + } + $scrumissue->setGiteajson(json_decode(json_encode($giteaissue), true)); - // Sauvegarde de l'issue - $em->persist($scrumissue); - $em->flush(); + $em->persist($scrumissue); + $em->flush(); + + $havecolumn=false; + foreach($giteaissue->labels as $gitealabel) { + $scrumcolumn=$em->getRepository('App:Scrumcolumn')->findOneBy(["giteaid"=>$gitealabel->id]); + if($scrumcolumn) { + $havecolumn=true; + $scrumissue->setScrumcolumn($scrumcolumn); + break; + } + } + if(!$havecolumn) $scrumissue->setScrumcolumn($firstcolumn); + + // Sauvegarde de l'issue + $em->persist($scrumissue); + $em->flush(); + } + array_push($tbgiteaissues,$giteaissue->number); } $scrumissues=$data->getScrumissues(); @@ -299,7 +302,8 @@ class ScrumController extends AbstractController $em->flush(); } } - + + // Préférences utilisateur $filtermilestones = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filtermilestones",$id); $filterlabels = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filterlabels",$id); @@ -310,7 +314,8 @@ class ScrumController extends AbstractController return $this->render($this->render.'view.html.twig', [ 'useheader' => true, - 'usesidebar' => false, + 'usesidebar' => false, + 'usetitle' => $data->getName(), 'giteaassignees' => $giteaassignees, 'giteacolumns' => $giteacolumns, 'giteamilestones' => $giteamilestones, diff --git a/src/ninegitea-1.0/templates/Scrum/view.html.twig b/src/ninegitea-1.0/templates/Scrum/view.html.twig index 594bde6..200b4ca 100644 --- a/src/ninegitea-1.0/templates/Scrum/view.html.twig +++ b/src/ninegitea-1.0/templates/Scrum/view.html.twig @@ -114,10 +114,10 @@