export sprint in csv

This commit is contained in:
afornerot 2024-02-20 11:12:38 +01:00
parent 4c77a4bcd1
commit 1c572dd516
2 changed files with 8 additions and 3 deletions

1
.gitignore vendored
View File

@ -34,3 +34,4 @@ yarn-error.log
/public/uploads/logo/* /public/uploads/logo/*
!/public/uploads/logo/logo.png !/public/uploads/logo/logo.png
/public/uploads/ckeditor /public/uploads/ckeditor
/public/uploads/issues

View File

@ -4,9 +4,10 @@ namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Form\FormError; use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
use App\Entity\Scrum as Entity; use App\Entity\Scrum as Entity;
use App\Entity\Scrumissue as Scrumissue; use App\Entity\Scrumissue as Scrumissue;
@ -513,7 +514,7 @@ class ScrumController extends AbstractController
$showfilters = $em->getRepository("App:User")->getUserpreference($this->getUser(),"showfilters",$id); $showfilters = $em->getRepository("App:User")->getUserpreference($this->getUser(),"showfilters",$id);
if($fgcsv) { if($fgcsv) {
$dir = $this->appKernel->getProjectDir() . '/uploads/issues/'; $dir = $this->getParameter('kernel.project_dir') . '/public/uploads/issues/';
$file = "issues-".$id.".csv"; $file = "issues-".$id.".csv";
$fs = new Filesystem(); $fs = new Filesystem();
$fs->mkdir($dir); $fs->mkdir($dir);
@ -527,6 +528,8 @@ class ScrumController extends AbstractController
foreach($gitearepos as $gitearepo) { foreach($gitearepos as $gitearepo) {
foreach($gitearepo["issues"] as $giteaissue) { foreach($gitearepo["issues"] as $giteaissue) {
$statut=""; $statut="";
$issue=$em->getRepository("App:Scrumissue")->findOneBy(["giteaid"=>$giteaissue->id]);
$type=""; $type="";
$labels=""; $labels="";
foreach($giteaissue->labels as $label) { foreach($giteaissue->labels as $label) {
@ -540,6 +543,7 @@ class ScrumController extends AbstractController
$tmp=[ $tmp=[
$gitearepo["name"], $gitearepo["name"],
(isset($giteaissue->milestone->title)?$giteaissue->milestone->title:""), (isset($giteaissue->milestone->title)?$giteaissue->milestone->title:""),
($issue->getScrumsprint()?$issue->getScrumsprint()->getName():"Aucun"),
$type, $type,
$giteaissue->number, $giteaissue->number,
$giteaissue->title, $giteaissue->title,