diff --git a/src/ninegitea-1.0/config/packages/framework.yaml b/src/ninegitea-1.0/config/packages/framework.yaml index 41c8912..e9598ee 100644 --- a/src/ninegitea-1.0/config/packages/framework.yaml +++ b/src/ninegitea-1.0/config/packages/framework.yaml @@ -8,6 +8,7 @@ framework: session: name: '%env(APP_ALIAS)%' handler_id: null + gc_probability: null cookie_secure: auto cookie_samesite: lax diff --git a/src/ninegitea-1.0/src/Controller/IssueController.php b/src/ninegitea-1.0/src/Controller/IssueController.php index 45f6f07..bc9b01f 100755 --- a/src/ninegitea-1.0/src/Controller/IssueController.php +++ b/src/ninegitea-1.0/src/Controller/IssueController.php @@ -110,6 +110,7 @@ class IssueController extends AbstractController $filterprioritys = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filterprioritys",$id); $filterlabels = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filterlabels",$id); $filterassignees = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filterassignees",$id); + $filterexcludes = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filterexcludes",$id); $showfilters = $em->getRepository("App:User")->getUserpreference($this->getUser(),"showfilters",$id); return $this->render($this->render.'list.html.twig',[ @@ -131,6 +132,7 @@ class IssueController extends AbstractController "filterteams" => $filterteams, "filterprioritys" => $filterprioritys, "filterlabels" => $filterlabels, + "filterexcludes" => $filterexcludes, "filterassignees" => $filterassignees, "showfilters" => $showfilters, ]); diff --git a/src/ninegitea-1.0/src/Controller/ScrumController.php b/src/ninegitea-1.0/src/Controller/ScrumController.php index 61568a1..1e9272f 100755 --- a/src/ninegitea-1.0/src/Controller/ScrumController.php +++ b/src/ninegitea-1.0/src/Controller/ScrumController.php @@ -25,7 +25,7 @@ class ScrumController extends AbstractController public function list(Request $request) { $em = $this->getDoctrine()->getManager(); - $scrums = $em->getRepository($this->entity)->findBy([],["name"=>"ASC"]); + $scrums = $em->getRepository($this->entity)->findByUser($this->getUser()); $giteacategorys=[]; $gitearepos=[]; @@ -183,6 +183,7 @@ class ScrumController extends AbstractController $filterprioritys = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filterprioritys",$id); $filterlabels = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filterlabels",$id); $filterassignees = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filterassignees",$id); + $filterexcludes = $em->getRepository("App:User")->getUserpreference($this->getUser(),"filterexcludes",$id); $showfilters = $em->getRepository("App:User")->getUserpreference($this->getUser(),"showfilters",$id); return $this->render($this->render.'view.html.twig', [ @@ -200,6 +201,7 @@ class ScrumController extends AbstractController 'filterprioritys' => $filterprioritys, 'filterlabels' => $filterlabels, 'filterassignees' => $filterassignees, + 'filterexcludes' => $filterexcludes, 'showfilters' => $showfilters, $this->data => $data, ]); diff --git a/src/ninegitea-1.0/src/Controller/UserController.php b/src/ninegitea-1.0/src/Controller/UserController.php index e495e7d..4dfc8f9 100755 --- a/src/ninegitea-1.0/src/Controller/UserController.php +++ b/src/ninegitea-1.0/src/Controller/UserController.php @@ -152,15 +152,13 @@ class UserController extends AbstractController $qb = $em->createQueryBuilder(); $qb->select('table')->from($this->entity,'table') - ->where('table.lastname LIKE :value') - ->where('table.firstname LIKE :value') + ->where('table.username LIKE :value') ->setParameter("value", "%".$q."%") - ->orderBy('table.firstname') - ->orderBy('table.lastname'); + ->orderBy('table.username'); $datas=$qb->setFirstResult(0)->setMaxResults($page_limit)->getQuery()->getResult(); foreach($datas as $data) { - array_push($output,array("id"=>$data->getId(),"text"=>$data->getDisplayname())); + array_push($output,array("id"=>$data->getId(),"text"=>$data->getUsername())); } $ret_string["results"]=$output; diff --git a/src/ninegitea-1.0/src/Form/ScrumType.php b/src/ninegitea-1.0/src/Form/ScrumType.php index b3c019c..caa08e6 100644 --- a/src/ninegitea-1.0/src/Form/ScrumType.php +++ b/src/ninegitea-1.0/src/Form/ScrumType.php @@ -61,7 +61,7 @@ class ScrumType extends AbstractType "remote_route" => "app_user_select", "class" => "App:User", "primary_key" => "id", - "text_property" => "displayname", + "text_property" => "username", "minimum_input_length" => 0, "page_limit" => 100, "allow_clear" => true, diff --git a/src/ninegitea-1.0/src/Repository/ScrumRepository.php b/src/ninegitea-1.0/src/Repository/ScrumRepository.php index 9ff8c28..caded79 100644 --- a/src/ninegitea-1.0/src/Repository/ScrumRepository.php +++ b/src/ninegitea-1.0/src/Repository/ScrumRepository.php @@ -16,6 +16,20 @@ class ScrumRepository extends ServiceEntityRepository $this->giteaservice = $giteaservice; } + public function findByUser($user) { + if($user->hasRole("ROLE_MASTER") || $user->hasRole("ROLE_MODO") || $user->hasRole("ROLE_ADMIN")) + return $this->_em->getRepository("App:Scrum")->findBy([],["name"=>"ASC"]); + else { + $scrums=$this ->createQueryBuilder('s') + ->from('App:User','u') + ->Where('u.id = :id') + ->andWhere('u MEMBER OF s.users') + ->setParameter('id',$user->getId()) + ->orderBy('s.name') + ->getQuery()->getResult(); + return $scrums; + } + } public function getGitea($scrum,&$giteaassignees,&$giteacolumns,&$giteamilestones,&$giteateams,&$giteaprioritys,&$gitealabels) { // Récupérer le dernier order $last = $this->_em->getRepository('App:Scrumissue')->findOneBy(["scrum"=>$scrum], ['rowid' => 'DESC']); diff --git a/src/ninegitea-1.0/templates/Issue/list.html.twig b/src/ninegitea-1.0/templates/Issue/list.html.twig index c061f7c..103e2bf 100644 --- a/src/ninegitea-1.0/templates/Issue/list.html.twig +++ b/src/ninegitea-1.0/templates/Issue/list.html.twig @@ -111,7 +111,19 @@ {% endfor %} - + + + +