This commit is contained in:
afornerot 2022-01-13 21:13:38 +01:00
parent 59f16701a6
commit dd5c13027f
3 changed files with 40 additions and 34 deletions

View File

@ -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 <a href='/ninegitea/logout'>reconnecter</a>");
@ -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();
@ -300,6 +303,7 @@ class ScrumController extends AbstractController
}
}
// Préférences utilisateur
$filtermilestones = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filtermilestones",$id);
$filterlabels = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filterlabels",$id);
@ -311,6 +315,7 @@ class ScrumController extends AbstractController
return $this->render($this->render.'view.html.twig', [
'useheader' => true,
'usesidebar' => false,
'usetitle' => $data->getName(),
'giteaassignees' => $giteaassignees,
'giteacolumns' => $giteacolumns,
'giteamilestones' => $giteamilestones,

View File

@ -114,10 +114,10 @@
</div>
<div class="card-body p-1" style="line-height:10px;">
<div class="d-inline-block">
<div>
<small>
{{issue.giteanumber}} - {{ issue.giteatitle }}<br><br>
<small>Crée le {{issue.giteajson.created_at|date("d/m/y")}}</small><small style ="float:right">Modifié le {{issue.giteajson.updated_at|date("d/m/y")}}</small><br><br>
{% for label in issue.giteajson.labels %}
{% if label.id not in giteacolumns %}
<span class="btn-link tag" style="background-color:#{{label.color}}">

View File

@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html"; charset="utf-8" />
<title>{% block title %}{{app.session.get("appname")}}{% endblock %}</title>
<title>{% block title %}{{app.session.get("appname")}}{%if usetitle is defined %} = {{usetitle}} {%endif%}{% endblock %}</title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
@ -55,6 +55,7 @@
<a class="navbar-brand" href="{{ path('app_home')}}">
<img src="/{{ appAlias }}/uploads/logo/{{app.session.get("logodark")}}" style="height:30px;margin-top:-3px;">
{{app.session.get("appname")}}
{%if usetitle is defined %} = {{usetitle}} {%endif%}
</a>
{% if usesidebar is defined and usesidebar %}