Unverified Commit e3e9b55f authored by GuilhermeGz's avatar GuilhermeGz Committed by GitHub
Browse files

Merge pull request #562 from S-Nathalia/master

Resolucao das rotas para proponente
parents 747135ac deee6a98
......@@ -574,9 +574,13 @@ class AdministradorController extends Controller
return redirect( route('admin.usuarios') )->with(['mensagem' => 'Usuário atualizado com sucesso']);
}
public function destroy($id) {
public function verify_correlations($id){
$user = User::find($id);
}
public function destroy($id) {
$user = User::find($id);
$adminResp = AdministradorResponsavel::where('user_id', '=', $id)->first();
$avaliador = Avaliador::where('user_id', '=', $id)->first();
$proponente = Proponente::where('user_id', '=', $id)->first();
......
......@@ -132,6 +132,11 @@ class ArquivoController extends Controller
}
$arquivos = [];
if(Auth::user()->id != $trabalho->proponente->user->id){
return redirect()->back();
}
foreach ($participantes as $participante){
array_push($arquivos, $participante->planoTrabalho);
}
......
......@@ -96,6 +96,10 @@ class ParticipanteController extends Controller
$trabalho = Trabalho::find($request->projeto_id);
$participantes = $trabalho->participantes;
if(Auth::user()->id != $trabalho->proponente->user->id){
return redirect()->back();
}
return view('documentacaoComplementar.listar')->with(['participantes' => $participantes, 'trabalho' => $trabalho]);
}
......
......@@ -111,6 +111,7 @@ class ProponenteController extends Controller
}
public function projetosEdital($id) {
$edital = Evento::find($id);
if(Auth::user()->proponentes != null){
$projetos = Trabalho::where('evento_id', '=', $id)->where('proponente_id', Auth::user()->proponentes->id)->orderBy('titulo')->paginate(10);
$hoje = Carbon::today('America/Recife');
......
......@@ -371,16 +371,6 @@ class TrabalhoController extends Controller
public function show($id)
{
// $projeto = Auth::user()->proponentes->trabalhos()->where('id', $id)->first();
// if(Auth::user()->tipo == 'administrador'){
// $projeto = Trabalho::find($id);
// }
// if(!$projeto){
// // $projeto = Auth::user()->coordenadorComissao->trabalho()->where('id', $id)->first();
// return back()->withErrors(['Proposta não encontrada!']);
// }
$projeto = Trabalho::find($id);
if(Auth::user()->id != $projeto->proponente->user->id){
return redirect()->back();
......@@ -1564,6 +1554,10 @@ class TrabalhoController extends Controller
$projeto = Trabalho::find($request->projeto_id);
$edital = Evento::find($projeto->evento_id);
if(Auth::user()->id != $projeto->proponente->user->id){
return redirect()->back();
}
$participantes = $projeto->participantes;
$substituicoesProjeto = Substituicao::where('trabalho_id', $projeto->id)->orderBy('created_at', 'DESC')->get();
$desligamentosProjeto = Desligamento::where('trabalho_id', $projeto->id)->orderBy('created_at', 'DESC')->get();
......
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