Exemplo n.º 1
0
 public function getGantt($id)
 {
     if (!Auth::check()) {
         return redirect("/");
     }
     $memberOfBoard = Membermanagement::where('User_id', '=', Auth::user()->id)->where('Board_id', '=', $id)->get();
     if (count($memberOfBoard) == 0) {
         return redirect("/");
     }
     $Board = Board::all()->find($id);
     session::put("idForGantt", $id);
     $boardCards = Board::with(['members'])->find(session()->get('idForGantt'));
     $cards = $boardCards->cards()->with(['memberCard.member', 'comments'])->get();
     return view('pages.gantt.ganttChart')->with('Board', $Board)->with('Card', $cards);
 }
Exemplo n.º 2
0
 public function editFormCard($id, $card)
 {
     if (!Auth::check()) {
         return redirect("/");
     }
     if (Auth::user()->Level_id == 1) {
         return redirect('/managementAccount');
     }
     $Board = Board::all()->find($id);
     if (Auth::user()->id != $Board->manager_id) {
         return redirect("/");
     }
     $prior = Priority::all('id', 'name')->sortBy('id')->toArray();
     $member = Membermanagement::with(['member'])->where('Board_id', '=', $id)->get();
     $getcard = Card::with(['checklist', 'memberCard.member'])->where('id', '=', $card)->get();
     return view('pages.card.editCard')->with('Board', $Board)->with('piority', $prior)->with('member', $member)->with('Card', $getcard);
 }
 public function insert()
 {
     $allUser = User::all();
     $params = ['body' => []];
     for ($i = 0; $i < count($allUser); $i++) {
         SearchController::insertUser($allUser[$i]);
     }
     $allUser = Post::all();
     $params = ['body' => []];
     for ($i = 0; $i < count($allUser); $i++) {
         SearchController::insertPost($allUser[$i]);
     }
     $allUser = Board::all();
     $params = ['body' => []];
     for ($i = 0; $i < count($allUser); $i++) {
         SearchController::insertBoard($allUser[$i]);
     }
 }
Exemplo n.º 4
0
 public function formEditBoard($id)
 {
     if (!Auth::check()) {
         return redirect("/");
     }
     if (Auth::user()->Level_id == 1) {
         return redirect('/managementAccount');
     }
     $data = Board::all()->find($id);
     if (Auth::user()->id != $data->manager_id) {
         return redirect("/");
     }
     $dateFormatStart = preg_split('[-]', $data->estimate_start);
     $dateFormatStart = $dateFormatStart[0] . "/" . $dateFormatStart[1] . "/" . $dateFormatStart[2];
     $dateFormatEnd = preg_split('[-]', $data->estimate_end);
     $dateFormatEnd = $dateFormatEnd[0] . "/" . $dateFormatEnd[1] . "/" . $dateFormatEnd[2];
     if ($data->start_date != null) {
         $dateFormatStartAC = preg_split('[-]', $data->start_date);
         $dateFormatStartAC = $dateFormatStartAC[0] . "/" . $dateFormatStartAC[1] . "/" . $dateFormatStartAC[2];
     } else {
         $dateFormatStartAC = "  ";
     }
     if ($data->end_date != null) {
         $dateFormatEndAC = preg_split('[-]', $data->end_date);
         $dateFormatEndAC = $dateFormatEndAC[0] . "/" . $dateFormatEndAC[1] . "/" . $dateFormatEndAC[2];
     } else {
         $dateFormatEndAC = "  ";
     }
     $manager = Membermanagement::with(['member'])->where('Board_id', '=', $id)->get();
     return view('pages.board.edit')->with('Board', $data)->with('dateStart', $dateFormatStart)->with('dateEnd', $dateFormatEnd)->with('dateStartAC', $dateFormatStartAC)->with('dateEndAC', $dateFormatEndAC)->with('members', $manager);
 }