block / unblock && sprint closed
This commit is contained in:
@ -199,7 +199,7 @@ class ScrumController extends AbstractController
|
||||
$viewclosed = $this->get('session')->get("viewclosed");
|
||||
foreach($issues as $issue) {
|
||||
// bypass closed
|
||||
if($viewclosed=="false"&&$issue->getGiteastate()=="closed") continue;
|
||||
if($viewclosed=="false"&&($issue->getGiteastate()=="closed"||($issue->getScrumsprint()&&$issue->getScrumsprint()->getClosed()))) continue;
|
||||
|
||||
// Ids
|
||||
$idcol=($issue->getScrumcolumn()?$issue->getScrumcolumn()->getId():$firstcolumn->getId());
|
||||
@ -334,8 +334,11 @@ class ScrumController extends AbstractController
|
||||
|
||||
// On ajoutes les sprints sans issues
|
||||
foreach($tbissues[$column->getId()]["jalons"] as $jalon) {
|
||||
|
||||
$sprints=$em->getRepository("App:Scrumsprint")->findBy(["scrum"=>$data,"giteamilestone"=>$jalon["idjal"]]);
|
||||
foreach($sprints as $sprint) {
|
||||
if($viewclosed=="false"&&$sprint->getClosed()) continue;
|
||||
|
||||
if(!in_array($column->getId()."|".$jalon["idjal"]."|".$sprint->getId(),$tbsprs)) {
|
||||
$tbissues[$column->getId()]["jalons"][$jalon["idjal"]]["sprints"][$sprint->getId()] = [
|
||||
"rowspr" => $sprint->getRowid(),
|
||||
@ -398,7 +401,7 @@ class ScrumController extends AbstractController
|
||||
'giteaassignees' => $giteaassignees,
|
||||
'giteacolumns' => $giteacolumns,
|
||||
'giteamilestones' => $giteamilestones,
|
||||
'sprints' => $data->getScrumsprints(),
|
||||
'sprints' => $data->getScrumsprintstosee($viewclosed),
|
||||
'giteateams' => $giteateams,
|
||||
'giteaprioritys' => $giteaprioritys,
|
||||
'giteatypes' => $giteatypes,
|
||||
@ -662,7 +665,7 @@ class ScrumController extends AbstractController
|
||||
$viewclosed = $this->get('session')->get("viewclosed");
|
||||
foreach($issues as $issue) {
|
||||
// bypass closed
|
||||
if($viewclosed=="false"&&$issue->getGiteastate()=="closed") continue;
|
||||
if($viewclosed=="false"&&($issue->getGiteastate()=="closed"||($issue->getScrumsprint()&&$issue->getScrumsprint()->getClosed()))) continue;
|
||||
|
||||
// Ids
|
||||
$idcol=($issue->getScrumcolumn()?$issue->getScrumcolumn()->getId():$firstcolumn->getId());
|
||||
|
@ -237,6 +237,44 @@ class ScrumissueController extends AbstractController
|
||||
return new JsonResponse($weights);
|
||||
}
|
||||
|
||||
public function block(Request $request)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$id=$request->get('id');
|
||||
$issueblocked=$request->get('issueblocked');
|
||||
|
||||
// Rechercher l'issue en cours
|
||||
$scrumissue=$em->getRepository("App:Scrumissue")->find($id);
|
||||
if(!$scrumissue) return new JsonResponse(['message' => 'No Issue'], 403);
|
||||
|
||||
// Bloquer l'issue
|
||||
$response=$this->giteaservice->postIssueblocks($scrumissue->getScrum()->getGiteajson()["owner"]["login"],$scrumissue->getScrum()->getGiteajson()["name"],$scrumissue->getGiteanumber(),$issueblocked);
|
||||
dump($response);
|
||||
if(!$response) return new JsonResponse(['message' => 'Error api'], 403);
|
||||
|
||||
return new JsonResponse([]);
|
||||
}
|
||||
|
||||
public function unblock(Request $request)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$id=$request->get('id');
|
||||
|
||||
// Rechercher l'issue en cours
|
||||
$scrumissue=$em->getRepository("App:Scrumissue")->find($id);
|
||||
if(!$scrumissue) return new JsonResponse(['message' => 'No Issue'], 403);
|
||||
if(!$scrumissue->getScrumissueblock()) return new JsonResponse(['message' => 'No Issue'], 403);
|
||||
$issueblocked=$scrumissue->getScrumissueblock()->getGiteanumber();
|
||||
|
||||
// Débloquer l'issue
|
||||
$response=$this->giteaservice->deleteIssueblocks($scrumissue->getScrum()->getGiteajson()["owner"]["login"],$scrumissue->getScrum()->getGiteajson()["name"],$scrumissue->getGiteanumber(),$issueblocked);
|
||||
if(!$response) return new JsonResponse(['message' => 'Error api'], 403);
|
||||
|
||||
return new JsonResponse([]);
|
||||
}
|
||||
|
||||
public function ctrlchange(Request $request)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
@ -145,7 +145,9 @@ class ScrumsprintController extends AbstractController
|
||||
$scrumsprints = $scrum->getScrumsprints();
|
||||
$output=array();
|
||||
foreach($scrumsprints as $scrumsprint) {
|
||||
array_push($output,array("id"=>$scrumsprint->getId(),"name"=>"<b>".$scrumsprint->getName()."</b><br><small>liè au jalon gitea ".$scrumsprint->getGiteamilestonename()."</small>"));
|
||||
$title = "Jalon = ".$scrumsprint->getGiteamilestonename()."<br>";
|
||||
$title.= "Sprint = ".$scrumsprint->getName();
|
||||
array_push($output,array("id"=>$scrumsprint->getId(),"name"=>$title,"closed"=>$scrumsprint->getClosed()));
|
||||
}
|
||||
|
||||
$response = new Response(json_encode($output));
|
||||
|
Reference in New Issue
Block a user