/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $data['colors'] = array('red', 'yellow', 'aqua', 'blue', 'light-blue', 'green', 'navy', 'teal', 'olive', 'lime', 'orange', 'fuchsia', 'purple', 'maroon', 'black', 'red-active', 'yellow-active', 'aqua-active', 'blue-active', 'light-blue-active', 'green-active', 'navy-active', 'teal-active', 'olive-active', 'lime-active', 'orange-active', 'fuchsia-active', 'purple-active', 'maroon-active', 'black-active'); $data['card'] = $card = Card::get_card_result($id); if ($card) { $data['project'] = Project::find($card->project_id); $data['goals'] = Project::get_goals($card->project_id); $data['campgoals'] = Card::get_campgoals($id); $data['plannedcampgoals'] = Card::get_panned_campgoals($id); $data['partner'] = Card::get_partner($id, $card->sector_id); $data['partners'] = Card::get_partners($id, $card->sector_id); $data['camps'] = Camp::where('card_id', $id)->get()->toArray(); $data['selectedpartner'] = PartnerCards::where('card_id', $id)->first(); $data['cardtimelines'] = Timeline::getFinalCardTimeline($id, 2); $data['campcreatebtn'] = Permission::hasPermission('camps.create'); $data['campeditbtn'] = Permission::hasPermission('camps.edit'); $data['campdeletebtn'] = Permission::hasPermission('camps.delete'); $data['campimportbtn'] = Permission::hasPermission('camps.import'); $data['taskimportbtn'] = Permission::hasPermission('tasks.import'); $data['taskeditbtn'] = Permission::hasPermission('tasks.edit'); $data['taskcreatebtn'] = Permission::hasPermission('tasks.create'); $data['taskdeletebtn'] = Permission::hasPermission('tasks.delete'); $data['tasklistbtn'] = Permission::hasPermission('tasks.index'); $data['campviewbtn'] = Permission::hasPermission('camps.show'); $data['tasks'] = Task::all(); return view('cards.view', $data); } else { Session::flash('danger', Lang::get('ruban.card.notfound')); return Redirect::route('ruban.cards.index'); } }