/**
  * 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));
 }
 public function tache_edition($id_liste)
 {
     $title = "consultation des tâches";
     $name_liste = Liste::where('id_users', Auth::user()->id)->get();
     $data_tache = Tache::where('id_users', Auth::user()->id)->where('id_liste', $id_liste)->get();
     return view('/membres/tache_edition')->with(['title' => $title, 'data_tache' => $data_tache, 'id_liste' => $id_liste, 'name_liste' => $name_liste]);
 }
Beispiel #3
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);
     }
 }
Beispiel #4
0
 /**
  * Fonction permettant de tester la
  * suppression d'un membre d'un projet
  *
  * @return void
  */
 public function testMoveTask()
 {
     $tache = Tache::create(['description' => 'Ma tache', 'code' => "MoncodeTest", 'start_date' => '2015-11-15', 'end_date' => '2015-11-30', 'us_story_id' => '1']);
     $take = new TakeTacheController();
     $take->edit($tache->id);
     $tacheUpdated = Tache::where("code", "MoncodeTest")->get()->first();
     $this->assertEquals(1, $tacheUpdated->state);
     $tacheUpdated->delete();
 }
Beispiel #5
0
 public function finish($idProject, $idUs)
 {
     $ntaches = Tache::where('us_story_id', '=', $idUs)->get();
     $nbrtaches = Tache::where('us_story_id', '=', $idUs)->count();
     $i = 0;
     foreach ($ntaches as $tache) {
         if ($tache->state == 2) {
             $i = $i + 1;
         }
     }
     if ($i == $nbrtaches) {
         $userstories = Userstory::where('id', '=', $idUs)->update(["status" => 1]);
         return Redirect::action("UsController@isFinish", [$idProject]);
     } else {
         return Redirect::action("BacklogController@show", [$idProject]);
     }
 }
 public function AfficheEditSousTache($id)
 {
     $user = Auth::user()->id;
     $tache = Tache::where('UserId', $id)->where('id', $id);
     $id = $id;
     return view('Page/ModifierSousTache', compact('id'));
 }
 public function editTask(Request $req, $name_liste, $tache)
 {
     $param = $req::all();
     if ($param['task'] != "" && strtotime($param['date']) != 0) {
         $log = Auth::user()->email;
         $liste = Tache::where('name_user', $log)->where('name_liste', $name_liste)->where('tache', $tache)->first();
         var_dump($liste);
         $liste->tache = $param['task'];
         $liste->date = $param['date'];
         $liste->save();
         return redirect()->route('index');
     } else {
         //
         //$this->fail = 'erreur';
         //echo $this->fail ;
         return redirect()->route('index');
     }
 }
 public function listtaches(Request $req)
 {
     //recuperer les taches dans la db par utilisateur
     $taches = \App\Tache::where('idutilisateur', $req->user()->id)->get();
     return view('link/listtaches')->with('taches', $taches);
 }