Commit 933c7556 authored by Carlos André's avatar Carlos André
Browse files

view de editar e visualizar projeto

parent e96cf1b9
...@@ -505,27 +505,27 @@ class TrabalhoController extends Controller ...@@ -505,27 +505,27 @@ class TrabalhoController extends Controller
public function show($id) public function show($id)
{ {
// //
$projeto = Trabalho::find($id); $projeto = Trabalho::find($id);
$edital = Evento::find($projeto->evento_id); $edital = Evento::find($projeto->evento_id);
$grandeArea = GrandeArea::where('id', $projeto->grande_area_id)->select('nome')->first(); $grandeAreas = GrandeArea::all();
$area = Area::where('id', $projeto->area_id)->select('nome')->first(); $areas = Area::all();
$subarea = Subarea::where('id', $projeto->sub_area_id)->select('nome')->first(); $subareas = Subarea::all();
$proponente = Proponente::find($projeto->proponente_id); $funcaoParticipantes = FuncaoParticipantes::all();
$funcaoParticipantes = FuncaoParticipantes::all(); $participantes = Participante::where('trabalho_id', $id)->get();
$participantes = Participante::where('trabalho_id', $id)->get(); $participantesUsersIds = Participante::where('trabalho_id', $id)->select('user_id')->get();
$participantesUsersIds = Participante::where('trabalho_id', $id)->select('user_id')->get(); $users = User::whereIn('id', $participantesUsersIds)->get();
$users = User::whereIn('id', $participantesUsersIds)->get(); $arquivos = Arquivo::where('trabalhoId', $id)->get();
$arquivos = Arquivo::where('trabalhoId', $id)->get();
return view('projeto.visualizar')->with(['projeto' => $projeto, return view('projeto.visualizar')->with(['projeto' => $projeto,
'grandeArea' => $grandeArea, 'grandeAreas' => $grandeAreas,
'area' => $area, 'areas' => $areas,
'subArea' => $subarea, 'subAreas' => $subareas,
'proponente' => $proponente, 'edital' => $edital,
'edital' => $edital, 'users' => $users,
'users' => $users, 'funcaoParticipantes' => $funcaoParticipantes,
'funcaoParticipantes' => $funcaoParticipantes, 'participantes' => $participantes,
'participantes' => $participantes, 'arquivos' => $arquivos,
'arquivos' => $arquivos,]); 'enum_turno' => Participante::ENUM_TURNO,
]);
} }
/** /**
...@@ -1371,7 +1371,7 @@ class TrabalhoController extends Controller ...@@ -1371,7 +1371,7 @@ class TrabalhoController extends Controller
public function atualizar(Request $request, $id) { public function atualizar(Request $request, $id) {
$edital = Evento::find($request->editalId); $edital = Evento::find($request->editalId);
$hoje = now(); $hoje = now();
$projeto = Trabalho::find($id); $projeto = Trabalho::find($id);
if (!($edital->inicioSubmissao < $hoje && $edital->fimSubmissao >= $hoje)) { if (!($edital->inicioSubmissao < $hoje && $edital->fimSubmissao >= $hoje)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment