/**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $taches = Tache::all();
     $test = true;
     foreach ($taches as $tache) {
         if ($tache->sprint_id == $id) {
             if ($tache->developer_id == Auth::id() && $tache->state == 1) {
                 $tache->update(['state' => 2]);
                 $tachesn = Tache::where('us_story_id', $tache->us_story_id)->get();
                 foreach ($tachesn as $tachen) {
                     if ($tachen->state != 2) {
                         $test = false;
                         break;
                     }
                 }
                 $userstory = Userstory::findOrFail($tache->us_story_id);
                 /*  if($test == true){
                         $userstory->update(['status'=> 1]);
                     }
                     else{
                         $userstory->update(['status'=> 0]);
                     }*/
             }
         }
     }
     return redirect(route('kanban.taches.show', $id));
     // return view('kanban.taches.show',compact('id'));
     //     return redirect(route('kanban.taches.index',$id));
 }
Example #2
0
 public function show($idProject, $key = null)
 {
     if ($key != null) {
         if (Visitor::where("Key", $key)->where("project_id", $idProject)->get() != null) {
             $userstories = DB::table('userstory')->where('project_id', $idProject)->get();
             return view("Backlog")->with('userstories', $userstories)->with('idProject', $idProject)->with('key', $key);
         }
     } else {
         //pour verifier les us  terminé
         $userstories = Userstory::where('project_id', '=', $idProject)->get();
         foreach ($userstories as $us) {
             $ntaches = Tache::where('us_story_id', '=', $us->id)->get();
             $nbrtaches = Tache::where('us_story_id', '=', $us->id)->count();
             if ($nbrtaches != 0) {
                 $i = 0;
                 foreach ($ntaches as $tache) {
                     if ($tache->state == 2) {
                         $i = $i + 1;
                     }
                 }
                 if ($i == $nbrtaches && $us->status == 0) {
                     $userstories = Userstory::where('id', '=', $us->id)->update(["status" => 1]);
                 }
             }
         }
         //pour récuperer les USs
         $userstories = Userstory::where('project_id', '=', $idProject)->get();
         return view("Backlog")->with('userstories', $userstories)->with('idProject', $idProject)->with('key', $key);
     }
 }
Example #3
0
 public function isFinish($idProject)
 {
     $userstories = Userstory::where('status', '=', 1)->get();
     return view("UsFinish")->with('userstories', $userstories)->with('idProject', $idProject);
 }
Example #4
0
 public function testAdd()
 {
     $us1 = Userstory::create(['description' => 'this is a user story of our project', 'priority' => '20', 'difficulty' => '1', 'status' => 'validated', 'project_id' => '1']);
     $us2 = Userstory::create(['description' => 'yes client this is a user story for your satisfaction', 'priority' => '5', 'difficulty' => '1', 'status' => 'validated', 'project_id' => '1']);
     $this->assertEquals(2, Tache::all()->count());
 }
Example #5
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $userstories = Userstory::all();
     $selectedUserStories = array();
     $i = 0;
     foreach ($userstories as $userstory) {
         if ($userstory->project_id == $id) {
             $selectedUserStories[$i] = $userstory;
             $i++;
         }
     }
     $sprints = Sprint::all();
     $realisedUS = array();
     $somme = 0;
     for ($i = 0; $i < count($selectedUserStories); $i++) {
         $somme = $somme + $selectedUserStories[$i]->difficulty;
     }
     $cptt = 0;
     $cpt = $somme;
     foreach ($sprints as $sprint) {
         for ($i = 0; $i < count($selectedUserStories); $i++) {
             if ($selectedUserStories[$i]->sprint_id == $sprint->id && $selectedUserStories[$i]->status == 1) {
                 $cptt = $cptt + $selectedUserStories[$i]->difficulty;
             }
         }
         $realisedUS[$sprint->id] = $cpt - $cptt;
     }
     //dd($realisedUS);
     $j = 1;
     $userstori = array();
     $time = array();
     $userstori[0] = $somme;
     $time[0] = 0;
     //dd($realisedUS);
     foreach ($realisedUS as $key => $value) {
         $userstori[$j] = $value;
         $time[$j] = $key;
         $j++;
     }
     //dd($time);
     //$userstori[0] = count($selectedUserStories);
     JpGraph::load();
     JpGraph::module('line');
     //$time = array_keys($realisedUS);
     //dd($realisedUS);
     //dd($time);
     //dd($userstori);
     $graph = new \Graph(900, 300);
     $ydata = $userstori;
     $xdata = $time;
     //dd($time);
     //dd($userstori);
     $graph->SetScale('intint');
     $lineplot = new \LinePlot($ydata, $xdata);
     $lineplot->SetColor('forestgreen');
     $graph->Add($lineplot);
     $graph->title->Set('BurnDownChart');
     $graph->xaxis->title->Set('Sprint\'s Time');
     $graph->yaxis->title->Set('Difficulties');
     $lineplot->SetWeight(3);
     $gdImgHandler = $graph->Stroke(_IMG_HANDLER);
     //Start buffering
     ob_start();
     //Print the data stream to the buffer
     $graph->img->Stream();
     //Get the contents of the buffer
     $image_data = ob_get_contents();
     //Stop the buffer/clear it.
     ob_end_clean();
     //Set the variable equal to the base 64 encoded value of the stream.
     //This gets passed to the browser and displayed.
     $image = base64_encode($image_data);
     return view('bdchart.index', compact('realisedUS', 'id', 'data', 'texte', 'image'));
 }
Example #6
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     $sprints = Sprint::lists('id', 'id');
     $us_stories = Userstory::lists('description', 'id');
     $tache = Tache::findOrNew($id);
     $predecessors = Tache::lists('code', 'code');
     return view('taches.edit', compact('tache', 'sprints', 'us_stories', 'predecessors'));
 }