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 @@
-
+
{{issue.giteanumber}} - {{ issue.giteatitle }}

- + Crée le {{issue.giteajson.created_at|date("d/m/y")}}Modifié le {{issue.giteajson.updated_at|date("d/m/y")}}

{% for label in issue.giteajson.labels %} {% if label.id not in giteacolumns %} diff --git a/src/ninegitea-1.0/templates/base.html.twig b/src/ninegitea-1.0/templates/base.html.twig index decfaf2..fd7ff5a 100644 --- a/src/ninegitea-1.0/templates/base.html.twig +++ b/src/ninegitea-1.0/templates/base.html.twig @@ -2,7 +2,7 @@ - {% block title %}{{app.session.get("appname")}}{% endblock %} + {% block title %}{{app.session.get("appname")}}{%if usetitle is defined %} = {{usetitle}} {%endif%}{% endblock %} @@ -55,6 +55,7 @@ {{app.session.get("appname")}} + {%if usetitle is defined %} = {{usetitle}} {%endif%} {% if usesidebar is defined and usesidebar %}