diff --git a/app/Arquivo.php b/app/Arquivo.php index 665ffce12ae30ea75e436d1e0e2f0111c7971380..709ecae98c40e27a7a5093aa56e20403e83dcf4e 100644 --- a/app/Arquivo.php +++ b/app/Arquivo.php @@ -12,7 +12,7 @@ class Arquivo extends Model * @var array */ protected $fillable = [ - 'nome', 'versao', 'versaoFinal', 'data', 'trabalhoId', 'participanteId' + 'nome','titulo', 'versao', 'versaoFinal', 'data', 'trabalhoId', 'participanteId' ]; public function trabalho(){ diff --git a/app/Endereco.php b/app/Endereco.php index 61160c09fe37ae83f24773a5e1b8a425b8910d09..73d16cd7a14ad09f5669dee7b1c234ec456cb174 100644 --- a/app/Endereco.php +++ b/app/Endereco.php @@ -12,7 +12,7 @@ class Endereco extends Model * @var array */ protected $fillable = [ - 'rua', 'numero', 'bairro', 'cidade','uf', 'cep', + 'rua', 'numero', 'bairro', 'cidade','uf', 'cep','complemento' ]; public function user(){ diff --git a/app/Http/Controllers/AdministradorController.php b/app/Http/Controllers/AdministradorController.php index 0f6bddde43cc90529c376314799f95f4c7cc2daf..489da7e916d3e39921578b92c67180e5d39302d9 100644 --- a/app/Http/Controllers/AdministradorController.php +++ b/app/Http/Controllers/AdministradorController.php @@ -64,6 +64,16 @@ class AdministradorController extends Controller return view('administrador.analisar')->with(['trabalhos' => $trabalhos, 'evento' => $evento, 'funcaoParticipantes' => $funcaoParticipantes]); } + public function showProjetos(Request $request){ + + $evento = Evento::where('id', $request->evento_id)->first(); + $projetos = Trabalho::all(); + + + + return view('administrador.listaProjetos')->with(['projetos' => $projetos, 'evento' => $evento]); + } + public function visualizarParecer(Request $request){ $avaliador = Avaliador::find($request->avaliador_id); diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index b2f0a3ccc85b6a1f256bd42062e75e524b49596e..bcfb7000129132b7706b8ddb0add2f4295ad886b 100644 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -2,8 +2,8 @@ namespace App\Http\Controllers; -use Auth; use PDF; +use Auth; use App\Area; use App\User; use App\Evento; @@ -31,8 +31,11 @@ use Illuminate\Http\Request; use App\Mail\SubmissaoTrabalho; use App\OutrasInfoParticipante; use Illuminate\Validation\Rule; +use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; +use App\Http\Requests\StoreTrabalho; use Illuminate\Support\Facades\Mail; +use App\Http\Requests\UpdateTrabalho; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Validator; use App\Mail\EmailParaUsuarioNaoCadastrado; @@ -167,8 +170,8 @@ class TrabalhoController extends Controller $pasta = 'trabalhos/' . $request->editalId . '/' . $trabalho->id; - if(!(is_null($request->anexoCONSU)) ) { - $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoCONSU, "CONSU.pdf"); + if(!(is_null($request->anexoDecisaoCONSU)) ) { + $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, "CONSU.pdf"); } if (!(is_null($request->anexoComiteEtica))) { $trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, "Comite_de_etica.pdf"); @@ -182,8 +185,8 @@ class TrabalhoController extends Controller if (!(is_null($request->anexoLattesCoordenador))) { $trabalho->anexoLattesCoordenador = Storage::putFileAs($pasta, $request->anexoLattesCoordenador, "Lattes_Coordenador.pdf"); } - if (!(is_null($request->anexoPlanilha))) { - $trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilha, "Planilha.". $request->file('anexoPlanilha')->extension()); + if (!(is_null($request->anexoPlanilhaPontuacao))) { + $trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilhaPontuacao, "Planilha.". $request->file('anexoPlanilhaPontuacao')->extension()); } $trabalho->update(); @@ -197,7 +200,7 @@ class TrabalhoController extends Controller public function validarAnexosRascunho(Request $request, $trabalho){ $validator = Validator::make($trabalho->getAttributes(),[ - 'anexoPlanilhaPontuacao' => $request->anexoPlanilha==null?['planilha']:[], + 'anexoPlanilhaPontuacao' => $request->anexoPlanilhaPontuacao==null?['planilha']:[], ]); if ($validator->fails()) { @@ -222,20 +225,20 @@ class TrabalhoController extends Controller //Anexo Decisão CONSU if( $evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM') { - if(isset($request->anexoCONSU)){ + if(isset($request->anexoDecisaoCONSU)){ if(Storage::disk()->exists($trabalho->anexoDecisaoCONSU)) { Storage::delete($trabalho->anexoDecisaoCONSU); } - $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoCONSU, 'CONSU.pdf'); + $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, 'CONSU.pdf'); } } //Autorização ou Justificativa - if( isset($request->anexoComiteEtica)){ + if( isset($request->anexoAutorizacaoComiteEtica)){ if(Storage::disk()->exists($trabalho->anexoAutorizacaoComiteEtica)) { Storage::delete($trabalho->anexoAutorizacaoComiteEtica); } - $trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, 'Comite_de_etica.pdf'); + $trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoAutorizacaoComiteEtica, 'Comite_de_etica.pdf'); } elseif( isset($request->justificativaAutorizacaoEtica)){ if(Storage::disk()->exists($trabalho->justificativaAutorizacaoEtica)) { @@ -253,11 +256,11 @@ class TrabalhoController extends Controller } //Anexo Planilha - if( isset($request->anexoPlanilha)){ + if( isset($request->anexoPlanilhaPontuacao)){ if(Storage::disk()->exists($trabalho->anexoPlanilhaPontuacao)) { Storage::delete($trabalho->anexoPlanilhaPontuacao); } - $trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilha, "Planilha.". $request->file('anexoPlanilha')->extension()); + $trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilhaPontuacao, "Planilha.". $request->file('anexoPlanilhaPontuacao')->extension()); } // Anexo grupo pesquisa @@ -265,7 +268,7 @@ class TrabalhoController extends Controller if(Storage::disk()->exists($trabalho->anexoGrupoPesquisa)) { Storage::delete($trabalho->anexoGrupoPesquisa); } - $trabalho->anexoGrupoPesquisa = Storage::putFileAs($pasta, $request->anexoPlanilha, "Grupo_de_pesquisa.". $request->file('anexoGrupoPesquisa')->extension()); + $trabalho->anexoGrupoPesquisa = Storage::putFileAs($pasta, $request->anexoGrupoPesquisa, "Grupo_de_pesquisa.". $request->file('anexoGrupoPesquisa')->extension()); } return $trabalho; @@ -278,14 +281,14 @@ class TrabalhoController extends Controller //Anexo Decisão CONSU if( $evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM') { - if( isset($request->anexoCONSU)){ - $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoCONSU, 'CONSU.pdf'); + if( isset($request->anexoDecisaoCONSU)){ + $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, 'CONSU.pdf'); } } //Autorização ou Justificativa - if( isset($request->anexoComiteEtica)){ - $trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, 'Comite_de_etica.pdf'); + if( isset($request->anexoAutorizacaoComiteEtica)){ + $trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoAutorizacaoComiteEtica, 'Comite_de_etica.pdf'); } elseif( isset($request->justificativaAutorizacaoEtica)){ $trabalho->justificativaAutorizacaoEtica = Storage::putFileAs($pasta, $request->justificativaAutorizacaoEtica, 'Justificativa.pdf'); @@ -297,8 +300,8 @@ class TrabalhoController extends Controller } //Anexo Planilha - if( isset($request->anexoPlanilha)){ - $trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilha, "Planilha.". $request->file('anexoPlanilha')->extension()); + if( isset($request->anexoPlanilhaPontuacao)){ + $trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilhaPontuacao, "Planilha.". $request->file('anexoPlanilhaPontuacao')->extension()); } // Anexo grupo pesquisa @@ -389,234 +392,233 @@ class TrabalhoController extends Controller ]); } - public function update(Request $request, $id) - { - $mytime = Carbon::now('America/Recife'); - $mytime = $mytime->toDateString(); - $evento = Evento::find($request->editalId); - $coordenador = CoordenadorComissao::find($evento->coordenadorId); - //Relaciona o projeto criado com o proponente que criou o projeto - $proponente = Proponente::where('user_id', Auth::user()->id)->first(); - //$trabalho->proponentes()->save($proponente); - //dd($coordenador->id); - $trabalho = "trabalho"; - if($evento->inicioSubmissao > $mytime){ - if($mytime >= $evento->fimSubmissao){ - return redirect()->route('home'); - } - } - - //O anexo de Decisão do CONSU dependo do tipo de edital - if( $evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM'){ - - $validatedData = $request->validate([ - 'editalId' => ['required', 'string'], - 'nomeProjeto' => ['required', 'string'], - 'grandeArea' => ['required', 'string'], - 'area' => ['required', 'string'], - 'subArea' => ['required', 'string'], - 'pontuacaoPlanilha' => ['required', 'string'], - 'linkGrupo' => ['required', 'string'], - 'linkLattesEstudante' => ['required', 'string'], - 'nomeParticipante.*' => ['required', 'string'], - 'emailParticipante.*' => ['required', 'string'], - 'funcaoParticipante.*' => ['required', 'string'], - ]); - - }else{ - //Caso em que o anexo da Decisão do CONSU não necessário - $validatedData = $request->validate([ - 'editalId' => ['required', 'string'], - 'nomeProjeto' => ['required', 'string',], - 'grandeArea' => ['required', 'string'], - 'area' => ['required', 'string'], - 'subArea' => ['required', 'string'], - 'pontuacaoPlanilha' => ['required', 'string'], - 'linkGrupo' => ['required', 'string'], - 'linkLattesEstudante' => ['required', 'string'], - 'nomeCoordenador' => ['required', 'string'], - 'nomeParticipante.*' => ['required', 'string'], - 'emailParticipante.*' => ['required', 'string'], - 'funcaoParticipante.*' => ['required', 'string'], - ]); - } - - $trabalho = Trabalho::find($id); - $trabalho->titulo = $request->nomeProjeto; - $trabalho->coordenador_id = $coordenador->id; - $trabalho->grande_area_id = $request->grandeArea; - $trabalho->area_id = $request->area; - $trabalho->sub_area_id = $request->subArea; - $trabalho->pontuacaoPlanilha = $request->pontuacaoPlanilha; - $trabalho->linkGrupoPesquisa = $request->linkGrupo; - $trabalho->linkLattesEstudante = $request->linkLattesEstudante; - $trabalho->data = $mytime; - $trabalho->evento_id = $request->editalId; - $trabalho->proponente_id = $proponente->id; - - $pasta = 'trabalhos/' . $request->editalId . '/' . $trabalho->id; - - if (!(is_null($request->anexoCONSU))) { - Storage::delete($trabalho->anexoDecisaoCONSU); - $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoCONSU, "CONSU.pdf"); - } - - if (!(is_null($request->anexoProjeto))) { - Storage::delete($trabalho->anexoProjeto); - $trabalho->anexoProjeto = Storage::putFileAs($pasta, $request->anexoProjeto, "Projeto.pdf"); - } - - if (!(is_null($request->anexoComiteEtica))) { - Storage::delete($trabalho->anexoComiteEtica); - $trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, "Comite_de_etica.pdf"); - } - - if (!(is_null($request->anexoLattesCoordenador))) { - Storage::delete($trabalho->anexoLattesCoordenador); - $trabalho->anexoLattesCoordenador = Storage::putFileAs($pasta, $request->anexoLattesCoordenador, "Latter_Coordenador.pdf"); - } - - if (!(is_null($request->anexoPlanilha))) { - Storage::delete($trabalho->anexoLattesCoordenador); - $trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilha, "Planilha.pdf"); - } - //atualizando projeto - $trabalho->update(); - - // criando novos participantes que podem ter sido adicionados - $participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get(); - $users = User::whereIn('id', $participantesUsersIds)->get(); - $emailParticipantes = []; - foreach ($users as $user) { - array_push($emailParticipantes, $user->email); - } - foreach ($request->emailParticipante as $key => $value) { - // criando novos participantes que podem ter sido adicionados - if (!(in_array($request->emailParticipante[$key], $emailParticipantes, false))) { - $userParticipante = User::where('email', $value)->first(); - if($userParticipante == null){ - $passwordTemporario = Str::random(8); - $subject = "Participante de Projeto"; - Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario, $subject)); - $usuario = User::create([ - 'email' => $value, - 'password' => bcrypt($passwordTemporario), - 'usuarioTemp' => true, - 'name' => $request->nomeParticipante[$key], - 'tipo' => 'participante', - ]); - - $participante = new Participante(); - $participante->user_id = $usuario->id; - $participante->trabalho_id = $trabalho->id; - $participante->funcao_participante_id = $request->funcaoParticipante[$key]; - $participante->save(); - - }else{ - $participante = new Participante(); - $participante->user_id = $userParticipante->id; - $participante->trabalho_id = $trabalho->id; - $participante->funcao_participante_id = $request->funcaoParticipante[$key]; - $participante->save(); - - $participante->trabalhos()->save($trabalho); - - $subject = "Participante de Projeto"; - $email = $value; - Mail::to($email) - ->send(new SubmissaoTrabalho($userParticipante, $subject, $evento, $trabalho)); - } - - $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/'; - $nome = $request->nomePlanoTrabalho[$key] .".pdf"; - $file = $request->anexoPlanoTrabalho[$key]; - Storage::putFileAs($path, $file, $nome); - - $arquivo = new Arquivo(); - $arquivo->titulo = $request->nomePlanoTrabalho[$key]; - $arquivo->nome = $path . $nome; - $arquivo->trabalhoId = $trabalho->id; - $arquivo->data = $mytime; - $arquivo->participanteId = $participante->id; - $arquivo->versaoFinal = true; - $arquivo->save(); - } - - //atualizando os participantes que já estão no projeto e planos de trabalho se enviados - if (in_array($request->emailParticipante[$key], $emailParticipantes, false)) { - $userParticipante = User::where('email', $value)->first(); - if($userParticipante != null){ - - $user = User::where('email', $request->emailParticipante[$key])->first(); - $participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first(); - - $user->name = $request->nomeParticipante[$key]; - $user->update(); - - $participante->funcao_participante_id = $request->funcaoParticipante[$key]; - $participante->update(); - - //atualizando planos de trabalho - if ($request->anexoPlanoTrabalho != null && array_key_exists($key, $request->anexoPlanoTrabalho)) { - if (!(is_null($request->anexoPlanoTrabalho[$key]))) { - $arquivo = Arquivo::where('participanteId', $participante->id)->first(); - //se plano já existir, deletar - if($arquivo != null){ - Storage::delete($arquivo->nome); - $arquivo->delete(); - } - - //atualizar plano - if($request->semPlano[$key] == null){ - $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/'; - $nome = $request->nomePlanoTrabalho[$key] .".pdf"; - $file = $request->anexoPlanoTrabalho[$key]; - Storage::putFileAs($path, $file, $nome); - - $arquivo = new Arquivo(); - $arquivo->titulo = $request->nomePlanoTrabalho[$key]; - $arquivo->nome = $path . $nome; - $arquivo->trabalhoId = $trabalho->id; - $arquivo->data = $mytime; - $arquivo->participanteId = $participante->id; - $arquivo->versaoFinal = true; - $arquivo->save(); - } - } - } - //removendo planos de trabalho - if($request->nomePlanoTrabalho != null && array_key_exists($key, $request->nomePlanoTrabalho)){ - if($request->semPlano[$key] == 'sim'){ - $arquivo = Arquivo::where('participanteId', $participante->id)->first(); - //se plano já existir, deletar - if($arquivo != null){ - Storage::delete($arquivo->nome); - $arquivo->delete(); - } - } - } - } - } - } + - // Atualizando possiveis usuários removidos - $participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get(); - $users = User::whereIn('id', $participantesUsersIds)->get(); + // $mytime = Carbon::now('America/Recife'); + // $mytime = $mytime->toDateString(); + // $evento = Evento::find($request->editalId); + // $coordenador = CoordenadorComissao::find($evento->coordenadorId); + // //Relaciona o projeto criado com o proponente que criou o projeto + // $proponente = Proponente::where('user_id', Auth::user()->id)->first(); + // //$trabalho->proponentes()->save($proponente); + // //dd($coordenador->id); + // $trabalho = "trabalho"; + // if($evento->inicioSubmissao > $mytime){ + // if($mytime >= $evento->fimSubmissao){ + // return redirect()->route('home'); + // } + // } + + // //O anexo de Decisão do CONSU dependo do tipo de edital + // if( $evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM'){ + + // $validatedData = $request->validate([ + // 'editalId' => ['required', 'string'], + // 'nomeProjeto' => ['required', 'string'], + // 'grandeArea' => ['required', 'string'], + // 'area' => ['required', 'string'], + // 'subArea' => ['required', 'string'], + // 'pontuacaoPlanilha' => ['required', 'string'], + // 'linkGrupo' => ['required', 'string'], + // 'linkLattesEstudante' => ['required', 'string'], + // 'nomeParticipante.*' => ['required', 'string'], + // 'emailParticipante.*' => ['required', 'string'], + // 'funcaoParticipante.*' => ['required', 'string'], + // ]); + + // }else{ + // //Caso em que o anexo da Decisão do CONSU não necessário + // $validatedData = $request->validate([ + // 'editalId' => ['required', 'string'], + // 'nomeProjeto' => ['required', 'string',], + // 'grandeArea' => ['required', 'string'], + // 'area' => ['required', 'string'], + // 'subArea' => ['required', 'string'], + // 'pontuacaoPlanilha' => ['required', 'string'], + // 'linkGrupo' => ['required', 'string'], + // 'linkLattesEstudante' => ['required', 'string'], + // 'nomeCoordenador' => ['required', 'string'], + // 'nomeParticipante.*' => ['required', 'string'], + // 'emailParticipante.*' => ['required', 'string'], + // 'funcaoParticipante.*' => ['required', 'string'], + // ]); + // } + + // $trabalho = Trabalho::find($id); + // $trabalho->titulo = $request->nomeProjeto; + // $trabalho->coordenador_id = $coordenador->id; + // $trabalho->grande_area_id = $request->grandeArea; + // $trabalho->area_id = $request->area; + // $trabalho->sub_area_id = $request->subArea; + // $trabalho->pontuacaoPlanilha = $request->pontuacaoPlanilha; + // $trabalho->linkGrupoPesquisa = $request->linkGrupo; + // $trabalho->linkLattesEstudante = $request->linkLattesEstudante; + // $trabalho->data = $mytime; + // $trabalho->evento_id = $request->editalId; + // $trabalho->proponente_id = $proponente->id; + + // $pasta = 'trabalhos/' . $request->editalId . '/' . $trabalho->id; + + // if (!(is_null($request->anexoDecisaoCONSU))) { + // Storage::delete($trabalho->anexoDecisaoCONSU); + // $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, "CONSU.pdf"); + // } + + // if (!(is_null($request->anexoProjeto))) { + // Storage::delete($trabalho->anexoProjeto); + // $trabalho->anexoProjeto = Storage::putFileAs($pasta, $request->anexoProjeto, "Projeto.pdf"); + // } + + // if (!(is_null($request->anexoComiteEtica))) { + // Storage::delete($trabalho->anexoComiteEtica); + // $trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, "Comite_de_etica.pdf"); + // } + + // if (!(is_null($request->anexoLattesCoordenador))) { + // Storage::delete($trabalho->anexoLattesCoordenador); + // $trabalho->anexoLattesCoordenador = Storage::putFileAs($pasta, $request->anexoLattesCoordenador, "Latter_Coordenador.pdf"); + // } + + // if (!(is_null($request->anexoPlanilhaPontuacao))) { + // Storage::delete($trabalho->anexoLattesCoordenador); + // $trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilhaPontuacao, "Planilha.pdf"); + // } + // //atualizando projeto + // $trabalho->update(); + + // // criando novos participantes que podem ter sido adicionados + // $participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get(); + // $users = User::whereIn('id', $participantesUsersIds)->get(); + // $emailParticipantes = []; + // foreach ($users as $user) { + // array_push($emailParticipantes, $user->email); + // } + // foreach ($request->emailParticipante as $key => $value) { + // // criando novos participantes que podem ter sido adicionados + // if (!(in_array($request->emailParticipante[$key], $emailParticipantes, false))) { + // $userParticipante = User::where('email', $value)->first(); + // if($userParticipante == null){ + // $passwordTemporario = Str::random(8); + // $subject = "Participante de Projeto"; + // Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario, $subject)); + // $usuario = User::create([ + // 'email' => $value, + // 'password' => bcrypt($passwordTemporario), + // 'usuarioTemp' => true, + // 'name' => $request->nomeParticipante[$key], + // 'tipo' => 'participante', + // ]); + + // $participante = new Participante(); + // $participante->user_id = $usuario->id; + // $participante->trabalho_id = $trabalho->id; + // $participante->funcao_participante_id = $request->funcaoParticipante[$key]; + // $participante->save(); + + // }else{ + // $participante = new Participante(); + // $participante->user_id = $userParticipante->id; + // $participante->trabalho_id = $trabalho->id; + // $participante->funcao_participante_id = $request->funcaoParticipante[$key]; + // $participante->save(); + + // $participante->trabalhos()->save($trabalho); + + // $subject = "Participante de Projeto"; + // $email = $value; + // Mail::to($email) + // ->send(new SubmissaoTrabalho($userParticipante, $subject, $evento, $trabalho)); + // } + + // $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/'; + // $nome = $request->nomePlanoTrabalho[$key] .".pdf"; + // $file = $request->anexoPlanoTrabalho[$key]; + // Storage::putFileAs($path, $file, $nome); + + // $arquivo = new Arquivo(); + // $arquivo->titulo = $request->nomePlanoTrabalho[$key]; + // $arquivo->nome = $path . $nome; + // $arquivo->trabalhoId = $trabalho->id; + // $arquivo->data = $mytime; + // $arquivo->participanteId = $participante->id; + // $arquivo->versaoFinal = true; + // $arquivo->save(); + // } + + // //atualizando os participantes que já estão no projeto e planos de trabalho se enviados + // if (in_array($request->emailParticipante[$key], $emailParticipantes, false)) { + // $userParticipante = User::where('email', $value)->first(); + // if($userParticipante != null){ + + // $user = User::where('email', $request->emailParticipante[$key])->first(); + // $participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first(); + + // $user->name = $request->nomeParticipante[$key]; + // $user->update(); + + // $participante->funcao_participante_id = $request->funcaoParticipante[$key]; + // $participante->update(); + + // //atualizando planos de trabalho + // if ($request->anexoPlanoTrabalho != null && array_key_exists($key, $request->anexoPlanoTrabalho)) { + // if (!(is_null($request->anexoPlanoTrabalho[$key]))) { + // $arquivo = Arquivo::where('participanteId', $participante->id)->first(); + // //se plano já existir, deletar + // if($arquivo != null){ + // Storage::delete($arquivo->nome); + // $arquivo->delete(); + // } + + // //atualizar plano + // if($request->semPlano[$key] == null){ + // $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/'; + // $nome = $request->nomePlanoTrabalho[$key] .".pdf"; + // $file = $request->anexoPlanoTrabalho[$key]; + // Storage::putFileAs($path, $file, $nome); + + // $arquivo = new Arquivo(); + // $arquivo->titulo = $request->nomePlanoTrabalho[$key]; + // $arquivo->nome = $path . $nome; + // $arquivo->trabalhoId = $trabalho->id; + // $arquivo->data = $mytime; + // $arquivo->participanteId = $participante->id; + // $arquivo->versaoFinal = true; + // $arquivo->save(); + // } + // } + // } + // //removendo planos de trabalho + // if($request->nomePlanoTrabalho != null && array_key_exists($key, $request->nomePlanoTrabalho)){ + // if($request->semPlano[$key] == 'sim'){ + // $arquivo = Arquivo::where('participanteId', $participante->id)->first(); + // //se plano já existir, deletar + // if($arquivo != null){ + // Storage::delete($arquivo->nome); + // $arquivo->delete(); + // } + // } + // } + // } + // } + // } + + // // Atualizando possiveis usuários removidos + // $participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get(); + // $users = User::whereIn('id', $participantesUsersIds)->get(); + + // foreach ($users as $user) { + // if (!(in_array($user->email, $request->emailParticipante, false))) { + // $participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first(); + // $arquivo = Arquivo::where('participanteId', $participante->id)->first(); + // if($arquivo != null){ + // Storage::delete($arquivo->nome); + // $arquivo->delete(); + // } + // $participante->delete(); + // } + // } - foreach ($users as $user) { - if (!(in_array($user->email, $request->emailParticipante, false))) { - $participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first(); - $arquivo = Arquivo::where('participanteId', $participante->id)->first(); - if($arquivo != null){ - Storage::delete($arquivo->nome); - $arquivo->delete(); - } - $participante->delete(); - } - } - return redirect()->route('evento.visualizar',['id'=>$request->editalId]); - } public function destroy(Request $request) { @@ -627,7 +629,8 @@ class TrabalhoController extends Controller $participantes = $projeto->participantes; foreach ($participantes as $participante) { $plano = $participante->planoTrabalho; - $plano->delete(); + if($plano) + $plano->delete(); $participante->delete(); } @@ -870,33 +873,316 @@ class TrabalhoController extends Controller return abort(404); } - public function salvar(Request $request) { - try { + // try { - $edital = Evento::find($request->editalId); - $hoje = now(); - if (!($edital->inicioSubmissao < $hoje && $edital->fimSubmissao >= $hoje)) { - return redirect()->route('inicial')->with(['error'=> 0, 'mensagem' => 'As submissões para o edital '. $edital->titulo .' foram encerradas.']); - } + // $edital = Evento::find($request->editalId); + // $hoje = now(); + // if (!($edital->inicioSubmissao < $hoje && $edital->fimSubmissao >= $hoje)) { + // return redirect()->route('inicial')->with(['error'=> 0, 'mensagem' => 'As submissões para o edital '. $edital->titulo .' foram encerradas.']); + // } - $projeto = $this->atribuirDados($request, $edital); - $projeto->save(); - // Email de submissão - // $subject = "Submissão de Trabalho"; - // $proponente = Auth()->user(); - // Mail::to($proponente->email)->send(new SubmissaoTrabalho($proponente, $subject, $edital, $projeto)); - $id = $projeto->id; - Notification::send(Auth::user(), new SubmissaoNotification($id)); + // $projeto = $this->atribuirDados($request, $edital); + // $projeto->save(); + // // Email de submissão + // // $subject = "Submissão de Trabalho"; + // // $proponente = Auth()->user(); + // // Mail::to($proponente->email)->send(new SubmissaoTrabalho($proponente, $subject, $edital, $projeto)); + // $id = $projeto->id; + // Notification::send(Auth::user(), new SubmissaoNotification($id)); - // Salvando participantes - $this->salvarParticipantes($request, $edital, $projeto); + // // Salvando participantes + // $this->salvarParticipantes($request, $edital, $projeto); + + + // return redirect(route('proponente.projetos'))->with(['mensagem' => 'Projeto submetido com sucesso!']); + // } catch (\Throwable $th) { + // return back()->with(['mensagem' => $th->getMessage()]); + // } + // foreach ($request->marcado as $key => $value) { + // $user = User::firstOrCreate([ + // ['email' => $request->email[$value]], + // [ + // 'name' => $request->name[$value], 'instituicao' => $request->instituicao[$value], + // 'cpf' => $request->cpf[$value], 'celular' => $request->celular[$value], + // ] + // ]); + // $participante = Participante::create([ + // 'rg' => $request->rg[$value], 'data_de_nascimento'=> $request->data_de_nascimento[$value], + // 'curso' => $request->curso[$value], 'turno' => $request->turno[$value], + // 'ordem_prioridade'=> $request->ordem_prioridade[$value],'periodo_atual' => $request->periodo_atual[$value], + // 'total_periodos' => $request->total_periodos[$value],'media_do_curso'=> $request->media_do_curso[$value] + // ]); + // $user->endereco()->create([ + // 'rua' => $request->rua[$value], + // 'numero' => $request->numero[$value], + // 'bairro' => $request->bairro[$value], + // 'cidade' => $request->cidade[$value], + // 'uf' => $request->uf[$value], + // 'cep' => $request->cep[$value], + // 'complemento' => $request->complemento[$value], + // ]); + // $user->participantes()->save($participante); + // $trabalho->participantes()->save($participante); + // } + + public function update(UpdateTrabalho $request, $id) + { + // dd($request->participante_id); + // dd( $request->all() ); + try { + if (!$request->has('rascunho') ) { + $request->merge([ + 'status' => 'submetido' + ]); + }else{ + $request->merge([ + 'status' => 'rascunho' + ]); + } + $evento = Evento::find($request->editalId); + $request->merge([ + 'coordenador_id' => $evento->coordenadorComissao->id + ]); + + DB::beginTransaction(); + + $trabalho = Auth::user()->proponentes->trabalhos()->where('id', $id)->first(); + $trabalho->update($request->except([ + 'anexoProjeto', 'anexoDecisaoCONSU','anexoPlanilhaPontuacao', + 'anexoLattesCoordenador','anexoGrupoPesquisa','anexoAutorizacaoComiteEtica', + 'justificativaAutorizacaoEtica' + ])); + if ($request->marcado == null) { + $idExcluido = $trabalho->participantes->pluck('id'); + + }else{ + $idExcluido = []; + } + // dd($idExcluido); + // dd(array_search( 2, $request->marcado)); + foreach ($request->participante_id as $key => $value) { + // $value = intval($value); + if($request->marcado != null && array_search( $key, $request->marcado) === false){ + if($value !== null) + array_push($idExcluido, $value); + } + } + // dd($idExcluido); + foreach ($idExcluido as $key => $value) { + $trabalho->participantes()->find($value)->delete(); + } + $trabalho->refresh(); + if($request->has('marcado')){ + foreach ($request->marcado as $key => $part) { + $part = intval($part); + + $passwordTemporario = Str::random(8); + $data['name'] = $request->name[$part]; + $data['email'] = $request->email[$part]; + $data['password'] = bcrypt($passwordTemporario); + $data['data_de_nascimento'] = $request->data_de_nascimento[$part]; + $data['cpf'] = $request->cpf[$part]; + $data['tipo'] = 'participante'; + $data['funcao_participante_id'] = 4; + $data['rg'] = $request->rg[$part]; + $data['celular'] = $request->celular[$part]; + $data['cep'] = $request->cep[$part]; + $data['uf'] = $request->uf[$part]; + $data['cidade'] = $request->cidade[$part]; + $data['rua'] = $request->rua[$part]; + $data['numero'] = $request->numero[$part]; + $data['bairro'] = $request->bairro[$part]; + $data['complemento'] = $request->complemento[$part]; + $data['instituicao'] = $request->instituicao[$part]; + $data['total_periodos'] = $request->total_periodos[$part]; + $data['curso'] = $request->curso[$part]; + $data['turno'] = $request->turno[$part]; + $data['periodo_atual'] = $request->periodo_atual[$part]; + $data['ordem_prioridade'] = $request->ordem_prioridade[$part]; + $data['media_do_curso'] = $request->media_do_curso[$part]; + $data['nomePlanoTrabalho'] = $request->nomePlanoTrabalho[$part]; + + $participante = Participante::find($request->participante_id[$part]); + + if (!$participante){ + $data['usuarioTemp'] = true; + $user = User::updateOrCreate( + ['email' => $data['email']], + $data + ); + $endereco = Endereco::create($data); + $endereco->user()->save($user); + $participante = Participante::create($data); + $user->participantes()->save($participante); + $trabalho->participantes()->save($participante); + + }else{ + $user = $participante->user; + $user->update($data); + $endereco = $user->endereco; + $endereco->update($data); + $participante = $user->participantes->where('trabalho_id', $trabalho->id)->first(); + if (!$participante){ + $participante = Participante::create($data); + $user->participantes()->save($participante); + $trabalho->participantes()->save($participante); + }else{ + $participante->update($data); + } + + } + + + + if ( $request->has('anexoPlanoTrabalho') && array_key_exists($part,$request->anexoPlanoTrabalho) ) { + if(Arquivo::where('participanteId', $participante->id)->count()){ + $arquivo = Arquivo::where('participanteId', $participante->id)->first(); + $path = 'trabalhos/' . $evento->id . '/' . $trabalho->id .'/'; + $nome = $data['nomePlanoTrabalho'] .".pdf"; + $file = $request->anexoPlanoTrabalho[$part] ; + Storage::putFileAs($path, $file, $nome); + $arquivo->update([ + 'titulo' => $nome, + 'nome' => $path . $nome, + 'data' => now() , + ]); + }else{ + $path = 'trabalhos/' . $evento->id . '/' . $trabalho->id .'/'; + $nome = $data['nomePlanoTrabalho'] .".pdf"; + $file = $request->anexoPlanoTrabalho[$part] ; + Storage::putFileAs($path, $file, $nome); + $arquivo = new Arquivo(); + $arquivo->titulo = $data['nomePlanoTrabalho']; + $arquivo->nome = $path . $nome; + $arquivo->trabalhoId = $trabalho->id; + $arquivo->data = now(); + $arquivo->participanteId = $participante->id; + $arquivo->versaoFinal = true; + $arquivo->save(); + + } + + } + + } + + } + + + $pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id; + $trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento); + $trabalho->save(); + + DB::commit(); + return redirect(route('proponente.projetos'))->with(['mensagem' => 'Proposta atualizada!']); + } catch (\Throwable $th) { + DB::rollback(); + return redirect(route('proponente.projetos'))->with(['mensagem' => $th->getMessage()]); + } + + } + + + public function salvar(StoreTrabalho $request) { + + try { + if (!$request->has('rascunho') ) { + $request->merge([ + 'status' => 'submetido' + ]); + } + $evento = Evento::find($request->editalId); + $request->merge([ + 'coordenador_id' => $evento->coordenadorComissao->id + ]); + + DB::beginTransaction(); + + $trabalho = Auth::user()->proponentes->trabalhos() + ->create($request->except([ + 'anexoProjeto', 'anexoDecisaoCONSU','anexoPlanilhaPontuacao', + 'anexoLattesCoordenador','anexoGrupoPesquisa','anexoAutorizacaoComiteEtica', + 'justificativaAutorizacaoEtica' + ])); + if($request->has('marcado')){ + foreach ($request->marcado as $key => $part) { + $part = intval($part); + + $passwordTemporario = Str::random(8); + $data['name'] = $request->name[$part]; + $data['email'] = $request->email[$part]; + $data['password'] = bcrypt($passwordTemporario); + $data['data_de_nascimento'] = $request->data_de_nascimento[$part]; + $data['cpf'] = $request->cpf[$part]; + $data['tipo'] = 'participante'; + $data['funcao_participante_id'] = 4; + $data['rg'] = $request->rg[$part]; + $data['celular'] = $request->celular[$part]; + $data['cep'] = $request->cep[$part]; + $data['uf'] = $request->uf[$part]; + $data['cidade'] = $request->cidade[$part]; + $data['rua'] = $request->rua[$part]; + $data['numero'] = $request->numero[$part]; + $data['bairro'] = $request->bairro[$part]; + $data['complemento'] = $request->complemento[$part]; + $data['instituicao'] = $request->instituicao[$part]; + $data['total_periodos'] = $request->total_periodos[$part]; + $data['curso'] = $request->curso[$part]; + $data['turno'] = $request->turno[$part]; + $data['periodo_atual'] = $request->periodo_atual[$part]; + $data['ordem_prioridade'] = $request->ordem_prioridade[$part]; + $data['media_do_curso'] = $request->media_do_curso[$part]; + $data['nomePlanoTrabalho'] = $request->nomePlanoTrabalho[$part]; + + $user = User::where('email' , $data['email'])->first(); + if (!$user){ + $data['usuarioTemp'] = true; + $user = User::create($data); + $endereco = Endereco::create($data); + $endereco->user()->save($user); + } + $participante = $user->participantes->where('trabalho_id', $trabalho->id)->first(); + if (!$participante){ + $participante = Participante::create($data); + } + + $user->participantes()->save($participante); + $trabalho->participantes()->save($participante); + + if ( $request->has('anexoPlanoTrabalho') ) { + $path = 'trabalhos/' . $evento->id . '/' . $trabalho->id .'/'; + $nome = $data['nomePlanoTrabalho'] .".pdf"; + $file = $request->anexoPlanoTrabalho[$part] ; + Storage::putFileAs($path, $file, $nome); + $arquivo = new Arquivo(); + $arquivo->titulo = $data['nomePlanoTrabalho']; + $arquivo->nome = $path . $nome; + $arquivo->trabalhoId = $trabalho->id; + $arquivo->data = now(); + $arquivo->participanteId = $participante->id; + $arquivo->versaoFinal = true; + $arquivo->save(); + + } + + } + } + $evento->trabalhos()->save($trabalho); + + $pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id; + $trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento); + $trabalho->save(); - return redirect(route('proponente.projetos'))->with(['mensagem' => 'Projeto submetido com sucesso!']); + DB::commit(); + + return redirect(route('proponente.projetos'))->with(['mensagem' => 'Proposta submetida!']); } catch (\Throwable $th) { - return back()->with(['mensagem' => $th->getMessage()]); + DB::rollback(); + return redirect(route('proponente.projetos'))->with(['mensagem' => $th->getMessage()]); } + } @@ -987,7 +1273,7 @@ class TrabalhoController extends Controller $subject = "Participante de Projeto"; - // Mail::to($request->emailParticipante[$key])->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, $projeto->titulo, 'Participante', $edital->nome, $passwordTemporario, $subject)); + Mail::to($request->emailParticipante[$key])->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, $projeto->titulo, 'Participante', $edital->nome, $passwordTemporario, $subject)); } else { $participante->user_id = $userParticipante->id; @@ -1005,11 +1291,11 @@ class TrabalhoController extends Controller $participante->save(); $subject = "Participante de Projeto"; - // Mail::to($request->emailParticipante[$key]) - // ->send(new SubmissaoTrabalho($userParticipante, $subject, $edital, $projeto)); + Mail::to($request->emailParticipante[$key]) + ->send(new SubmissaoTrabalho($userParticipante, $subject, $edital, $projeto)); } - + if($request->nomePlanoTrabalho[$key] != null){ $usuario = User::where('email', $request->emailParticipante[$key])->first(); $participante = Participante::where([['user_id', '=', $usuario->id], ['trabalho_id', '=', $projeto->id]])->first(); @@ -1028,7 +1314,7 @@ class TrabalhoController extends Controller $arquivo->participanteId = $participante->id; $arquivo->versaoFinal = true; $arquivo->save(); - + // dd($arquivo); } // Editado } elseif ($id > 0) { @@ -1095,7 +1381,8 @@ class TrabalhoController extends Controller $participantesExcluidos = $participantes->diff($participantesPermanecem); foreach ($participantesExcluidos as $participante) { $plano = $participante->planoTrabalho; - $plano->delete(); + if($plano) + $plano->delete(); $participante->delete(); } @@ -1148,9 +1435,25 @@ class TrabalhoController extends Controller $participante->media_do_curso = $request->media_geral_curso[$key]; $participante->save(); - + $usuario = User::where('email', $email)->first(); + $participante = Participante::where([['user_id', '=', $usuario->id], ['trabalho_id', '=', $projeto->id]])->first(); + + $path = 'trabalhos/' . $edital->id . '/' . $projeto->id .'/'; + $nome = $request->nomePlanoTrabalho[$key] .".pdf"; + $file = $request->anexoPlanoTrabalho[$key]; + Storage::putFileAs($path, $file, $nome); + + $agora = now(); + $arquivo = new Arquivo(); + $arquivo->titulo = $request->nomePlanoTrabalho[$key]; + $arquivo->nome = $path . $nome; + $arquivo->trabalhoId = $projeto->id; + $arquivo->data = $agora; + $arquivo->participanteId = $participante->id; + $arquivo->versaoFinal = true; + $arquivo->save(); $subject = "Participante de Projeto"; - // Mail::to($email)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, $projeto->titulo, 'Participante', $edital->nome, $passwordTemporario, $subject)); + Mail::to($email)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, $projeto->titulo, 'Participante', $edital->nome, $passwordTemporario, $subject)); } else { $participante->user_id = $userParticipante->id; @@ -1167,31 +1470,51 @@ class TrabalhoController extends Controller $participante->media_do_curso = $request->media_geral_curso[$key]; $participante->save(); + + + if ($request->anexoPlanoTrabalho[$key]) { + $path = 'trabalhos/' . $edital->id . '/' . $projeto->id .'/'; + $nome = $request->nomePlanoTrabalho[$key] .".pdf"; + $file = $request->anexoPlanoTrabalho[$key]; + Storage::putFileAs($path, $file, $nome); + + $agora = now(); + $arquivo = new Arquivo(); + $arquivo->titulo = $request->nomePlanoTrabalho[$key]; + $arquivo->nome = $path . $nome; + $arquivo->trabalhoId = $projeto->id; + $arquivo->data = $agora; + $arquivo->participanteId = $participante->id; + $arquivo->versaoFinal = true; + $arquivo->save(); + + } + $subject = "Participante de Projeto"; - // Mail::to($email) - // ->send(new SubmissaoTrabalho($userParticipante, $subject, $edital, $projeto)); + Mail::to($email) + ->send(new SubmissaoTrabalho($userParticipante, $subject, $edital, $projeto)); } - if($request->nomePlanoTrabalho[$key] != null){ - $usuario = User::where('email', $email)->first(); - $participante = Participante::where([['user_id', '=', $usuario->id], ['trabalho_id', '=', $projeto->id]])->first(); - - $path = 'trabalhos/' . $edital->id . '/' . $projeto->id .'/'; - $nome = $request->nomePlanoTrabalho[$key] .".pdf"; - $file = $request->anexoPlanoTrabalho[$key]; - Storage::putFileAs($path, $file, $nome); - - $agora = now(); - $arquivo = new Arquivo(); - $arquivo->titulo = $request->nomePlanoTrabalho[$key]; - $arquivo->nome = $path . $nome; - $arquivo->trabalhoId = $projeto->id; - $arquivo->data = $agora; - $arquivo->participanteId = $participante->id; - $arquivo->versaoFinal = true; - $arquivo->save(); - } + // if($request->nomePlanoTrabalho[$key] != null){ + // $usuario = User::where('email', $email)->first(); + // $participante = Participante::where([['user_id', '=', $usuario->id], ['trabalho_id', '=', $projeto->id]])->first(); + + // $path = 'trabalhos/' . $edital->id . '/' . $projeto->id .'/'; + // $nome = $request->nomePlanoTrabalho[$key] .".pdf"; + // $file = $request->anexoPlanoTrabalho[$key]; + // Storage::putFileAs($path, $file, $nome); + + // $agora = now(); + // $arquivo = new Arquivo(); + // $arquivo->titulo = $request->nomePlanoTrabalho[$key]; + // $arquivo->nome = $path . $nome; + // $arquivo->trabalhoId = $projeto->id; + // $arquivo->data = $agora; + // $arquivo->participanteId = $participante->id; + // $arquivo->versaoFinal = true; + // $arquivo->save(); + // } } } @@ -1211,8 +1534,8 @@ class TrabalhoController extends Controller $projeto = $this->atribuirDados($request, $edital, $projeto); $projeto->update(); - // Salvando participantes // dd($request->all()); + // Salvando participantes $this->salvarParticipantes($request, $edital, $projeto, true); return redirect(route('proponente.projetos'))->with(['mensagem' => 'Projeto atualizado com sucesso!']); diff --git a/app/Http/Requests/StoreTrabalho.php b/app/Http/Requests/StoreTrabalho.php new file mode 100644 index 0000000000000000000000000000000000000000..1d0dcd350b4644e74bafd6f118667643947f2e75 --- /dev/null +++ b/app/Http/Requests/StoreTrabalho.php @@ -0,0 +1,127 @@ + ['required', 'string'], + 'marcado.*' => ['required'], + 'titulo' => ['required', 'string'], + 'grande_area_id' => ['required', 'string'], + 'area_id' => ['required', 'string'], + 'linkLattesEstudante' => ['required', 'string'], + 'pontuacaoPlanilha' => ['required', 'string'], + 'linkGrupoPesquisa' => ['required', 'string'], + 'anexoProjeto' => ['required', 'mimes:pdf'], + 'anexoDecisaoCONSU' => ['required', 'mimes:pdf'], + 'anexoPlanilhaPontuacao' => ['required'], + 'anexoLattesCoordenador' => ['required', 'mimes:pdf'], + 'anexoGrupoPesquisa' => ['required', 'mimes:pdf'], + 'anexoAutorizacaoComiteEtica' => [Rule::requiredIf($this->justificativaAutorizacaoEtica == null)], + 'justificativaAutorizacaoEtica' => [Rule::requiredIf($this->anexoAutorizacaoComiteEtica == null)], + + + ]; + if($this->has('marcado')){ + foreach ($this->get('marcado') as $key => $value) { + if( intval($value) == $key){ + //user + $rules['name.'.$value] = ['required', 'string']; + $rules['email.'.$value] = ['required', 'string']; + $rules['instituicao.'.$value] = ['required', 'string']; + $rules['cpf.'.$value] = ['required', 'string']; + $rules['celular.'.$value] = ['required', 'string']; + //endereco + $rules['rua.'.$value] = ['required', 'string']; + $rules['numero.'.$value] = ['required', 'string']; + $rules['bairro.'.$value] = ['required', 'string']; + $rules['cidade.'.$value] = ['required', 'string']; + $rules['uf.'.$value] = ['required', 'string']; + $rules['cep.'.$value] = ['required', 'string']; + $rules['complemento.'.$value] = ['required', 'string']; + //participante + $rules['rg.'.$value] = ['required', 'string']; + $rules['data_de_nascimento.'.$value] = ['required', 'string']; + $rules['curso.'.$value] = ['required', 'string']; + $rules['turno.'.$value] = ['required', 'string']; + $rules['ordem_prioridade.'.$value] = ['required', 'string']; + $rules['periodo_atual.'.$value] = ['required', 'string']; + $rules['total_periodos.'.$value] = ['required', 'string']; + $rules['media_do_curso.'.$value] = ['required', 'string']; + $rules['anexoPlanoTrabalho.'.$value] = ['required']; + $rules['nomePlanoTrabalho.'.$value] = ['required', 'string']; + + } + } + + } + + if ($this->has('rascunho')) { + return [ + + ]; + }else{ + return $rules; + } + + } + + public function messages() + { + + return [ + 'titulo.required' => 'O :attribute é obrigatório', + 'marcado.*.required' => 'Por favor selcione algum participante, é obrigatório', + 'grande_area_id.required' => 'O campo grande área é obrigatório', + 'anexoPlanoTrabalho.*.required' => 'O :attribute é obrigatório', + 'anexoProjeto.required' => 'O :attribute é obrigatório', + 'cpf.*.required' => 'O cpf é obrigatório', + 'name.*.required' => 'O :attribute é obrigatório', + 'email.*.required' => 'O :attribute é obrigatório', + 'instituicao.*.required' => 'O :attribute é obrigatório', + 'emailParticipante.*.required' => 'O :attribute é obrigatório', + 'celular.*.required' => 'O :attribute é obrigatório', + 'rua.*.required' => 'O :attribute é obrigatório', + 'numero.*.required' => 'O :attribute é obrigatório', + 'bairro.*.required' => 'O :attribute é obrigatório', + 'cidade.*.required' => 'O :attribute é obrigatório', + 'uf.*.required' => 'O :attribute é obrigatório', + 'cep.*.required' => 'O :attribute é obrigatório', + 'complemento.*.required' => 'O :attribute é obrigatório', + 'rg.*.required' => 'O :attribute é obrigatório', + 'data_de_nascimento.*.required' => 'O :attribute é obrigatório', + 'curso.*.required' => 'O :attribute é obrigatório', + 'turno.*.required' => 'O :attribute é obrigatório', + 'ordem_prioridade.*.required' => 'O :attribute é obrigatório', + 'periodo_atual.*.required' => 'O :attribute é obrigatório', + 'total_periodos.*.required' => 'O :attribute é obrigatório', + 'media_do_curso.*.required' => 'O :attribute é obrigatório', + 'anexoPlanoTrabalho.*.required' => 'O :attribute é obrigatório', + 'nomePlanoTrabalho.*.required' => 'O :attribute é obrigatório', + ]; + } +} diff --git a/app/Http/Requests/UpdateTrabalho.php b/app/Http/Requests/UpdateTrabalho.php new file mode 100644 index 0000000000000000000000000000000000000000..b9f5ed54014d74a2e706f71db8881b04b2e78f11 --- /dev/null +++ b/app/Http/Requests/UpdateTrabalho.php @@ -0,0 +1,94 @@ +id); + + $rules = [ + 'editalId' => ['required', 'string'], + 'marcado.*' => ['required'], + 'titulo' => ['required', 'string'], + 'grande_area_id' => ['required', 'string'], + 'area_id' => ['required', 'string'], + 'linkLattesEstudante' => ['required', 'string'], + 'pontuacaoPlanilha' => ['required', 'string'], + 'linkGrupoPesquisa' => ['required', 'string'], + 'anexoProjeto' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoProjeto == null)], 'mimes:pdf'], + 'anexoDecisaoCONSU' => ['mimes:pdf'], + 'anexoPlanilhaPontuacao' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoPlanilhaPontuacao == null)]], + 'anexoLattesCoordenador' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoLattesCoordenador == null)], 'mimes:pdf'], + 'anexoGrupoPesquisa' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoGrupoPesquisa == null)], 'mimes:pdf'], + 'anexoAutorizacaoComiteEtica' => [ + Rule::requiredIf((!$this->has('rascunho') && $projeto->anexoAutorizacaoComiteEtica == null) ) + ], + 'justificativaAutorizacaoEtica' => [ + Rule::requiredIf((!$this->has('rascunho') && $projeto->anexoAutorizacaoComiteEtica == null)) + ], + + ]; + if($this->has('marcado')){ + foreach ($this->get('marcado') as $key => $value) { + if( intval($value) == $key){ + //user + $rules['name.'.$value] = ['required', 'string']; + $rules['email.'.$value] = ['required', 'string']; + $rules['instituicao.'.$value] = ['required', 'string']; + $rules['cpf.'.$value] = ['required', 'string']; + $rules['celular.'.$value] = ['required', 'string']; + //endereco + $rules['rua.'.$value] = ['required', 'string']; + $rules['numero.'.$value] = ['required', 'string']; + $rules['bairro.'.$value] = ['required', 'string']; + $rules['cidade.'.$value] = ['required', 'string']; + $rules['uf.'.$value] = ['required', 'string']; + $rules['cep.'.$value] = ['required', 'string']; + $rules['complemento.'.$value] = ['required', 'string']; + //participante + $rules['rg.'.$value] = ['required', 'string']; + $rules['data_de_nascimento.'.$value] = ['required', 'string']; + $rules['curso.'.$value] = ['required', 'string']; + $rules['turno.'.$value] = ['required', 'string']; + $rules['ordem_prioridade.'.$value] = ['required', 'string']; + $rules['periodo_atual.'.$value] = ['required', 'string']; + $rules['total_periodos.'.$value] = ['required', 'string']; + $rules['media_do_curso.'.$value] = ['required', 'string']; + $rules['nomePlanoTrabalho.'.$value] = ['required', 'string']; + + } + } + + } + // dd($this->all()); + if ($this->has('rascunho')) { + return [ + + ]; + }else{ + return $rules; + } + } +} diff --git a/app/Participante.php b/app/Participante.php index 8e165fbaebcbc9ebd6a7d7dc733776a85948da12..81cf650c79eb73f80ae54d66bdffdb2f09d9bd72 100644 --- a/app/Participante.php +++ b/app/Participante.php @@ -10,7 +10,7 @@ class Participante extends Model use SoftDeletes; public const ENUM_TURNO = ['Matutino', 'Vespertino', 'Noturno', 'Integral']; - protected $fillable = ['name', 'user_id', 'trabalho_id', 'participante_id']; + protected $fillable = ['rg', 'data_de_nascimento', 'curso', 'participante_id', 'turno', 'ordem_prioridade', 'periodo_atual', 'total_periodos', 'media_do_curso']; public function user(){ return $this->belongsTo('App\User'); diff --git a/composer.json b/composer.json index 9adfb23ecee5ec813539b4bb58d52fcab727fa0d..1611d23f3f4bdcbb096d3a4cbd68b7af8ad0ba80 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,7 @@ "require": { "php": "^7.2", "barryvdh/laravel-dompdf": "^0.9.0", + "doctrine/dbal": "^2.12.1", "fideloper/proxy": "^4.0", "geekcom/validator-docs": "^3.4", "guzzlehttp/guzzle": "^6.5", diff --git a/composer.lock b/composer.lock index ba8c97607c674228ae4a76541465034ccfe83412..38d64678681e60de867ff12c6cc9654eb2028431 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3207e2b84c84b9381475a4fa738eca3e", + "content-hash": "a7ad1113629bd318dc8dbe9e51d021a1", "packages": [ { "name": "barryvdh/laravel-dompdf", @@ -72,6 +72,350 @@ ], "time": "2020-12-27T12:05:53+00:00" }, + { + "name": "doctrine/cache", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "c9622c6820d3ede1e2315a6a377ea1076e421d88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/c9622c6820d3ede1e2315a6a377ea1076e421d88", + "reference": "c9622c6820d3ede1e2315a6a377ea1076e421d88", + "shasum": "" + }, + "require": { + "php": "~7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4", + "psr/cache": ">=3" + }, + "require-dev": { + "alcaeus/mongo-php-adapter": "^1.1", + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^8.0", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "predis/predis": "~1.0", + "psr/cache": "^1.0 || ^2.0", + "symfony/cache": "^4.4 || ^5.2" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/2.0.3" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "time": "2021-05-25T09:43:04+00:00" + }, + { + "name": "doctrine/dbal", + "version": "2.13.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "8dd39d2ead4409ce652fd4f02621060f009ea5e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/8dd39d2ead4409ce652fd4f02621060f009ea5e4", + "reference": "8dd39d2ead4409ce652fd4f02621060f009ea5e4", + "shasum": "" + }, + "require": { + "doctrine/cache": "^1.0|^2.0", + "doctrine/deprecations": "^0.5.3", + "doctrine/event-manager": "^1.0", + "ext-pdo": "*", + "php": "^7.1 || ^8" + }, + "require-dev": { + "doctrine/coding-standard": "9.0.0", + "jetbrains/phpstorm-stubs": "2020.2", + "phpstan/phpstan": "0.12.81", + "phpunit/phpunit": "^7.5.20|^8.5|9.5.5", + "squizlabs/php_codesniffer": "3.6.0", + "symfony/cache": "^4.4", + "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", + "vimeo/psalm": "4.6.4" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlanywhere", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/2.13.2" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], + "time": "2021-06-18T21:48:39+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "v0.5.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "9504165960a1f83cc1480e2be1dd0a0478561314" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/9504165960a1f83cc1480e2be1dd0a0478561314", + "reference": "9504165960a1f83cc1480e2be1dd0a0478561314", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0|^7.0|^8.0", + "phpunit/phpunit": "^7.0|^8.0|^9.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v0.5.3" + }, + "time": "2021-03-21T12:59:47+00:00" + }, + { + "name": "doctrine/event-manager", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/41370af6a30faa9dc0368c4a6814d596e81aba7f", + "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": "<2.9@dev" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/1.1.x" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2020-05-29T18:28:51+00:00" + }, { "name": "doctrine/inflector", "version": "2.0.3", @@ -511,16 +855,16 @@ }, { "name": "geekcom/validator-docs", - "version": "3.5.2", + "version": "3.5.3", "source": { "type": "git", "url": "https://github.com/geekcom/validator-docs.git", - "reference": "92eb11c55081e6cfe0594d58ab0232e0c6980cab" + "reference": "94064a98379dca1e781bd358e4c10d7a1cff0020" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/geekcom/validator-docs/zipball/92eb11c55081e6cfe0594d58ab0232e0c6980cab", - "reference": "92eb11c55081e6cfe0594d58ab0232e0c6980cab", + "url": "https://api.github.com/repos/geekcom/validator-docs/zipball/94064a98379dca1e781bd358e4c10d7a1cff0020", + "reference": "94064a98379dca1e781bd358e4c10d7a1cff0020", "shasum": "" }, "require": { @@ -532,8 +876,7 @@ "php-coveralls/php-coveralls": "^2.2", "phpstan/phpstan": "^0.12.5", "phpunit/phpunit": "^8.4|^9.4", - "squizlabs/php_codesniffer": "*", - "symplify/changelog-linker": "^8.3" + "squizlabs/php_codesniffer": "*" }, "type": "library", "extra": { @@ -561,15 +904,15 @@ "description": "Biblioteca para validação de Título de Eleitor, CPF, CNPJ, NIS e CNH", "support": { "issues": "https://github.com/geekcom/validator-docs/issues", - "source": "https://github.com/geekcom/validator-docs/tree/3.5.2" + "source": "https://github.com/geekcom/validator-docs/tree/3.5.3" }, "funding": [ { - "url": "https://gumroad.com/geekcom", + "url": "https://nubank.com.br/pagar/518o5/zVBzxd00Sb", "type": "custom" } ], - "time": "2021-04-23T00:05:14+00:00" + "time": "2021-06-29T20:08:48+00:00" }, { "name": "guzzlehttp/guzzle", @@ -774,16 +1117,16 @@ }, { "name": "laravel/framework", - "version": "v6.20.27", + "version": "v6.20.29", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "92c0417e60efc39bc556ba5dfc9b20a56f7848fb" + "reference": "00fa9c04aed10d68481f5757b89da0e6798f53b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/92c0417e60efc39bc556ba5dfc9b20a56f7848fb", - "reference": "92c0417e60efc39bc556ba5dfc9b20a56f7848fb", + "url": "https://api.github.com/repos/laravel/framework/zipball/00fa9c04aed10d68481f5757b89da0e6798f53b3", + "reference": "00fa9c04aed10d68481f5757b89da0e6798f53b3", "shasum": "" }, "require": { @@ -923,7 +1266,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-05-11T14:00:28+00:00" + "time": "2021-06-22T13:41:06+00:00" }, { "name": "laravel/tinker", @@ -1049,16 +1392,16 @@ }, { "name": "league/commonmark", - "version": "1.6.2", + "version": "1.6.5", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "7d70d2f19c84bcc16275ea47edabee24747352eb" + "reference": "44ffd8d3c4a9133e4bd0548622b09c55af39db5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/7d70d2f19c84bcc16275ea47edabee24747352eb", - "reference": "7d70d2f19c84bcc16275ea47edabee24747352eb", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/44ffd8d3c4a9133e4bd0548622b09c55af39db5f", + "reference": "44ffd8d3c4a9133e4bd0548622b09c55af39db5f", "shasum": "" }, "require": { @@ -1076,7 +1419,7 @@ "github/gfm": "0.29.0", "michelf/php-markdown": "~1.4", "mikehaertl/php-shellcommand": "^1.4", - "phpstan/phpstan": "^0.12", + "phpstan/phpstan": "^0.12.90", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.2", "scrutinizer/ocular": "^1.5", "symfony/finder": "^4.2" @@ -1146,20 +1489,20 @@ "type": "tidelift" } ], - "time": "2021-05-12T11:39:41+00:00" + "time": "2021-06-26T11:57:13+00:00" }, { "name": "league/flysystem", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" + "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32", + "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32", "shasum": "" }, "require": { @@ -1175,7 +1518,6 @@ "phpunit/phpunit": "^8.5.8" }, "suggest": { - "ext-fileinfo": "Required for MimeType", "ext-ftp": "Allows you to use FTP server storage", "ext-openssl": "Allows you to use FTPS server storage", "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", @@ -1233,7 +1575,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.x" + "source": "https://github.com/thephpleague/flysystem/tree/1.1.4" }, "funding": [ { @@ -1241,7 +1583,7 @@ "type": "other" } ], - "time": "2020-08-23T07:39:11+00:00" + "time": "2021-06-23T21:56:05+00:00" }, { "name": "league/mime-type-detection", @@ -1397,16 +1739,16 @@ }, { "name": "nesbot/carbon", - "version": "2.48.1", + "version": "2.50.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "8d1f50f1436fb4b05e7127360483dd9c6e73da16" + "reference": "f47f17d17602b2243414a44ad53d9f8b9ada5fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8d1f50f1436fb4b05e7127360483dd9c6e73da16", - "reference": "8d1f50f1436fb4b05e7127360483dd9c6e73da16", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/f47f17d17602b2243414a44ad53d9f8b9ada5fdb", + "reference": "f47f17d17602b2243414a44ad53d9f8b9ada5fdb", "shasum": "" }, "require": { @@ -1458,15 +1800,15 @@ { "name": "Brian Nesbitt", "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" + "homepage": "https://markido.com" }, { "name": "kylekatarnls", - "homepage": "http://github.com/kylekatarnls" + "homepage": "https://github.com/kylekatarnls" } ], "description": "An API extension for DateTime that supports 281 different languages.", - "homepage": "http://carbon.nesbot.com", + "homepage": "https://carbon.nesbot.com", "keywords": [ "date", "datetime", @@ -1486,7 +1828,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T22:08:38+00:00" + "time": "2021-06-28T22:38:45+00:00" }, { "name": "nikic/php-parser", @@ -2353,16 +2695,16 @@ }, { "name": "symfony/console", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a62acecdf5b50e314a4f305cd01b5282126f3095" + "reference": "9aa1eb46c1b12fada74dc0c529e93d1ccef22576" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a62acecdf5b50e314a4f305cd01b5282126f3095", - "reference": "a62acecdf5b50e314a4f305cd01b5282126f3095", + "url": "https://api.github.com/repos/symfony/console/zipball/9aa1eb46c1b12fada74dc0c529e93d1ccef22576", + "reference": "9aa1eb46c1b12fada74dc0c529e93d1ccef22576", "shasum": "" }, "require": { @@ -2422,7 +2764,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.25" + "source": "https://github.com/symfony/console/tree/v4.4.26" }, "funding": [ { @@ -2438,7 +2780,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T11:20:16+00:00" + "time": "2021-06-06T09:12:27+00:00" }, { "name": "symfony/css-selector", @@ -2643,16 +2985,16 @@ }, { "name": "symfony/error-handler", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "310a756cec00d29d89a08518405aded046a54a8b" + "reference": "4001f01153d0eb5496fe11d8c76d1e56b47fdb88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/310a756cec00d29d89a08518405aded046a54a8b", - "reference": "310a756cec00d29d89a08518405aded046a54a8b", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/4001f01153d0eb5496fe11d8c76d1e56b47fdb88", + "reference": "4001f01153d0eb5496fe11d8c76d1e56b47fdb88", "shasum": "" }, "require": { @@ -2692,7 +3034,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v4.4.25" + "source": "https://github.com/symfony/error-handler/tree/v4.4.26" }, "funding": [ { @@ -2708,7 +3050,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:39:37+00:00" + "time": "2021-06-24T07:57:22+00:00" }, { "name": "symfony/event-dispatcher", @@ -3013,16 +3355,16 @@ }, { "name": "symfony/http-foundation", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "0c79d5a65ace4fe66e49702658c024a419d2438b" + "reference": "8759ed5c27c2a8a47cb60f367f4be6727f08d58b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/0c79d5a65ace4fe66e49702658c024a419d2438b", - "reference": "0c79d5a65ace4fe66e49702658c024a419d2438b", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/8759ed5c27c2a8a47cb60f367f4be6727f08d58b", + "reference": "8759ed5c27c2a8a47cb60f367f4be6727f08d58b", "shasum": "" }, "require": { @@ -3061,7 +3403,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v4.4.25" + "source": "https://github.com/symfony/http-foundation/tree/v4.4.26" }, "funding": [ { @@ -3077,20 +3419,20 @@ "type": "tidelift" } ], - "time": "2021-05-26T11:20:16+00:00" + "time": "2021-06-26T21:56:04+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "3795165596fe81a52296b78c9aae938d434069cc" + "reference": "e08b2fb8a6eedd81c70522e514bad9b2c1fff881" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/3795165596fe81a52296b78c9aae938d434069cc", - "reference": "3795165596fe81a52296b78c9aae938d434069cc", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/e08b2fb8a6eedd81c70522e514bad9b2c1fff881", + "reference": "e08b2fb8a6eedd81c70522e514bad9b2c1fff881", "shasum": "" }, "require": { @@ -3165,7 +3507,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v4.4.25" + "source": "https://github.com/symfony/http-kernel/tree/v4.4.26" }, "funding": [ { @@ -3181,20 +3523,20 @@ "type": "tidelift" } ], - "time": "2021-06-01T07:12:08+00:00" + "time": "2021-06-30T08:18:06+00:00" }, { "name": "symfony/mime", - "version": "v5.3.0", + "version": "v5.3.2", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "ed710d297b181f6a7194d8172c9c2423d58e4852" + "reference": "47dd7912152b82d0d4c8d9040dbc93d6232d472a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ed710d297b181f6a7194d8172c9c2423d58e4852", - "reference": "ed710d297b181f6a7194d8172c9c2423d58e4852", + "url": "https://api.github.com/repos/symfony/mime/zipball/47dd7912152b82d0d4c8d9040dbc93d6232d472a", + "reference": "47dd7912152b82d0d4c8d9040dbc93d6232d472a", "shasum": "" }, "require": { @@ -3248,7 +3590,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.3.0" + "source": "https://github.com/symfony/mime/tree/v5.3.2" }, "funding": [ { @@ -3264,7 +3606,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:43:10+00:00" + "time": "2021-06-09T10:58:01+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3916,16 +4258,16 @@ }, { "name": "symfony/process", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "cd61e6dd273975c6625316de9d141ebd197f93c9" + "reference": "7e812c84c3f2dba173d311de6e510edf701685a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/cd61e6dd273975c6625316de9d141ebd197f93c9", - "reference": "cd61e6dd273975c6625316de9d141ebd197f93c9", + "url": "https://api.github.com/repos/symfony/process/zipball/7e812c84c3f2dba173d311de6e510edf701685a8", + "reference": "7e812c84c3f2dba173d311de6e510edf701685a8", "shasum": "" }, "require": { @@ -3957,7 +4299,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.25" + "source": "https://github.com/symfony/process/tree/v4.4.26" }, "funding": [ { @@ -3973,7 +4315,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T11:20:16+00:00" + "time": "2021-06-09T14:57:04+00:00" }, { "name": "symfony/routing", @@ -4144,16 +4486,16 @@ }, { "name": "symfony/translation", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "dfe132c5c6d89f90ce7f961742cc532e9ca16dd4" + "reference": "2f7fa60b8d10ca71c30dc46b0870143183a8f131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/dfe132c5c6d89f90ce7f961742cc532e9ca16dd4", - "reference": "dfe132c5c6d89f90ce7f961742cc532e9ca16dd4", + "url": "https://api.github.com/repos/symfony/translation/zipball/2f7fa60b8d10ca71c30dc46b0870143183a8f131", + "reference": "2f7fa60b8d10ca71c30dc46b0870143183a8f131", "shasum": "" }, "require": { @@ -4212,7 +4554,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v4.4.25" + "source": "https://github.com/symfony/translation/tree/v4.4.26" }, "funding": [ { @@ -4228,7 +4570,7 @@ "type": "tidelift" } ], - "time": "2021-05-26T17:39:37+00:00" + "time": "2021-06-06T08:51:46+00:00" }, { "name": "symfony/translation-contracts", @@ -4310,16 +4652,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.25", + "version": "v4.4.26", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0" + "reference": "a586efdf2aa832d05b9249e9115d24f6a2691160" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", - "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/a586efdf2aa832d05b9249e9115d24f6a2691160", + "reference": "a586efdf2aa832d05b9249e9115d24f6a2691160", "shasum": "" }, "require": { @@ -4379,7 +4721,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.25" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.26" }, "funding": [ { @@ -4395,7 +4737,7 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:48:32+00:00" + "time": "2021-06-17T06:35:48+00:00" }, { "name": "thiagocfn/inscricaoestadual", @@ -5961,16 +6303,16 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.16", + "version": "8.5.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "cc66f2fc61296be66c99931a862200e7456b9a01" + "reference": "79067856d85421c56d413bd238d4e2cd6b0e54da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cc66f2fc61296be66c99931a862200e7456b9a01", - "reference": "cc66f2fc61296be66c99931a862200e7456b9a01", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/79067856d85421c56d413bd238d4e2cd6b0e54da", + "reference": "79067856d85421c56d413bd238d4e2cd6b0e54da", "shasum": "" }, "require": { @@ -6042,7 +6384,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.16" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.17" }, "funding": [ { @@ -6054,7 +6396,7 @@ "type": "github" } ], - "time": "2021-06-05T04:46:20+00:00" + "time": "2021-06-23T05:12:43+00:00" }, { "name": "scrivo/highlight.php", @@ -6979,5 +7321,5 @@ "php": "^7.2" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/database/migrations/2021_06_30_144621_alter_table_users.php b/database/migrations/2021_06_30_144621_alter_table_users.php new file mode 100644 index 0000000000000000000000000000000000000000..7de97a4cf65ccc0c6a74b4ff26f86d3176ebe2e5 --- /dev/null +++ b/database/migrations/2021_06_30_144621_alter_table_users.php @@ -0,0 +1,32 @@ +string('email')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + // + }); + } +} diff --git a/database/migrations/2021_07_01_020325_alter_table_arquivos.php b/database/migrations/2021_07_01_020325_alter_table_arquivos.php new file mode 100644 index 0000000000000000000000000000000000000000..278115dc011b5a6a62400fbcad71e95f76c5edd0 --- /dev/null +++ b/database/migrations/2021_07_01_020325_alter_table_arquivos.php @@ -0,0 +1,33 @@ +string('nome')->nullable()->change(); + $table->string('titulo')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('arquivos', function (Blueprint $table) { + // + }); + } +} diff --git a/public/img/img_manutencao.png b/public/img/img_manutencao.png new file mode 100644 index 0000000000000000000000000000000000000000..d35f3035edfe003fa65145dc10443b842f24ac8f Binary files /dev/null and b/public/img/img_manutencao.png differ diff --git a/resources/views/administrador/index.blade.php b/resources/views/administrador/index.blade.php index 68eb3291785e11143a14bfb27961c2888696d6c7..a73d50a6306a22fed85e5463f79ac0d183ccb218 100644 --- a/resources/views/administrador/index.blade.php +++ b/resources/views/administrador/index.blade.php @@ -112,41 +112,60 @@ -
- -
-
- diff --git a/resources/views/administrador/listaProjetos.blade.php b/resources/views/administrador/listaProjetos.blade.php new file mode 100644 index 0000000000000000000000000000000000000000..1c7724da2c23baed494fc49d35b0b50862e26032 --- /dev/null +++ b/resources/views/administrador/listaProjetos.blade.php @@ -0,0 +1,57 @@ +@extends('layouts.app') + +@section('content') +
+
+
+

Editais

+
+ +
+
+ @if(session('mensagem')) +
+
+
+

{{session('mensagem')}}

+
+
+
+ @endif +
+
+ + + + + + + + + + + + + @foreach ($projetos as $projeto) + + + + + + + + + + + @endforeach + +
Nome da PropostaAutorEmailData de CriaçãoStatusOpção
+ + {{ $projeto->titulo }} + + {{ $projeto->proponente->user->name }}{{ $projeto->proponente->user->email }}{{ date('d/m/Y', strtotime($projeto->created_at)) }}{{ $projeto->status }} + +
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/componentes/input.blade.php b/resources/views/componentes/input.blade.php index f17e3f2512fe5a977138bdc8f38f4e80eb77a90a..57788b3a5609fd44fce5689ab818410ec92dc6a1 100644 --- a/resources/views/componentes/input.blade.php +++ b/resources/views/componentes/input.blade.php @@ -1,10 +1,11 @@ @php $class = $class ?? " "; - $obrigatorio = $obrigatorio ?? " "; + // $obrigatorio = $obrigatorio ?? " "; @endphp
- + + {{ $slot }}
- {{ $slot }} +
diff --git a/resources/views/componentes/participante.blade.php b/resources/views/componentes/participante.blade.php index a4fa6f09220f017e3d9d5b2fd5e0bca10c3b27f6..eea27489a14c30983ff75dc0914c4964dc1d1ea3 100644 --- a/resources/views/componentes/participante.blade.php +++ b/resources/views/componentes/participante.blade.php @@ -9,8 +9,9 @@
+
-
+
@@ -18,95 +19,175 @@
Dados do discente
@component('componentes.input', ['label' => 'Nome completo']) - + + @error('name.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'E-mail']) - + + @error('email.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'Data de nascimento']) - + + @error('data_de_nascimento.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'CPF']) - + @endcomponent + @error('cpf.*') + + {{ $message }} + + @enderror
@component('componentes.input', ['label' => 'RG']) - + + @error('rg.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'Celular']) - + + @error('celular.*') + + {{ $message }} + + @enderror @endcomponent
Endereço
@component('componentes.input', ['label' => 'CEP']) - + + @error('cep.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.select', ['label' => 'Estado']) - + @foreach ($estados as $sigla => $nome) @endforeach + @error('uf.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'Cidade']) - + + @error('cidade.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'Bairro']) - + + @error('bairro.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'Rua']) - + + @error('rua.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'Número']) - + + @error('numero.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'Complemento', 'obrigatorio' => '']) + @error('complemento.*') + + {{ $message }} + + @enderror @endcomponent
Dados do curso
@component('componentes.input', ['label' => 'Universidade']) - + + @error('universidade.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'Curso']) - + + @error('curso.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.select', ['label' => 'Turno']) - + @foreach ($enum_turno as $key => $value) @endforeach + @error('turno.*') + + {{ $message }} + + @enderror @endcomponent
@php @@ -114,46 +195,81 @@ @endphp
@component('componentes.select', ['label' => 'Total de períodos do curso']) - + @foreach ($options as $key => $value) @endforeach + @error('total_periodos.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.select', ['label' => 'Período atual']) - + + @error('periodo_atual.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.select', ['label' => 'Ordem de prioridade']) - + + @error('ordem_prioridade.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'Coeficiente de rendimento']) - + + @error('media_do_curso.*') + + {{ $message }} + + @enderror @endcomponent
Plano de trabalho
@component('componentes.input', ['label' => 'Título']) - + + @error('nomePlanoTrabalho.*') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'Anexo(.pdf)']) - + + @error('anexoPlanoTrabalho.*') + + {{ $message }} + + @enderror + @error('anexoPlanoTrabalho') + + {{ $message }} + + @enderror @endcomponent
diff --git a/resources/views/evento/formulario/anexos.blade.php b/resources/views/evento/formulario/anexos.blade.php index d4619080232caa4079d5e2ac3750f2dafdcc172e..ec31528eed7b6de05fdaee73eb07401602775187 100644 --- a/resources/views/evento/formulario/anexos.blade.php +++ b/resources/views/evento/formulario/anexos.blade.php @@ -11,30 +11,54 @@
@component('componentes.input', ['label' => 'Projeto (.pdf)']) - + + @error('anexoProjeto') + + {{ $message }} + + @enderror @endcomponent
@component('componentes.input', ['label' => 'Currículo Lattes do Proponente (.pdf)']) - + @endcomponent + @error('anexoLattesCoordenador') + + {{ $message }} + + @enderror
@component('componentes.input', ['label' => 'Planilha de Pontuação (.xlsx,.xls,.ods)']) - + + @error('anexoPlanilhaPontuacao') + + {{ $message }} + + @enderror @endcomponent
- @component('componentes.input', ['label' => 'Decisão do CONSU (.pdf)']) - - @endcomponent + + + @error('anexoDecisaoCONSU') + + {{ $message }} + + @enderror
@component('componentes.input', ['label' => 'Grupo de Pesquisa (.pdf)']) - + + @error('anexoGrupoPesquisa') + + {{ $message }} + + @enderror @endcomponent
@@ -50,13 +74,23 @@
@component('componentes.input', ['label' => 'Sim, declaro que necessito de autorizações especiais (.pdf)']) - + + @error('anexoAutorizacaoComiteEtica') + + {{ $message }} + + @enderror @endcomponent
diff --git a/resources/views/evento/formulario/finalizar.blade.php b/resources/views/evento/formulario/finalizar.blade.php index 4393262d4d5842ca01e31cbcc22ccf766ae7dc61..d16c4ec74d0840cd5fc3d1989072fb30f7bce478 100644 --- a/resources/views/evento/formulario/finalizar.blade.php +++ b/resources/views/evento/formulario/finalizar.blade.php @@ -12,7 +12,8 @@
* Campos obrigatórios
- + +
diff --git a/resources/views/evento/formulario/participantes.blade.php b/resources/views/evento/formulario/participantes.blade.php index b54ca36bc4cde0fe4be26aa9071eadd26c1d9bb3..1f3d222a5b65e7dd3ded9834a085462cadfdb47d 100644 --- a/resources/views/evento/formulario/participantes.blade.php +++ b/resources/views/evento/formulario/participantes.blade.php @@ -18,174 +18,290 @@
  • -
    - -
    - -
    -
    -
    -
    -
    - -
    Dados do discente
    -
    - @component('componentes.input', ['label' => 'Nome completo']) - - @endcomponent -
    -
    - @component('componentes.input', ['label' => 'E-mail']) - - @endcomponent -
    -
    - @component('componentes.input', ['label' => 'Data de nascimento']) - - @endcomponent -
    -
    - @component('componentes.input', ['label' => 'CPF']) - -
    -
    + @endfor +
    diff --git a/resources/views/evento/formulario/projeto.blade.php b/resources/views/evento/formulario/projeto.blade.php index b11d0c9b98b098c902eb7e4614880b511caa0c86..465ab8e9bb914771a4cf78082dc56c4b3780ce57 100644 --- a/resources/views/evento/formulario/projeto.blade.php +++ b/resources/views/evento/formulario/projeto.blade.php @@ -11,9 +11,9 @@

    - - - @error('nomeProjeto') + + + @error('titulo') {{ $message }} @@ -22,14 +22,14 @@
    - @foreach($grandeAreas as $grandeArea) @endforeach - @error('grandeArea') + @error('grande_area_id') {{ $message }} @@ -38,10 +38,10 @@
    - - @error('area') + @error('area_id') {{ $message }} @@ -50,7 +50,7 @@
    - {{-- @foreach($subAreas as $subArea)
    - + - +
    diff --git a/resources/views/projeto/editaFormulario/finalizar.blade.php b/resources/views/projeto/editaFormulario/finalizar.blade.php index fcec615a5628cdbd99db47972cd4384e7f8b470d..09bb8e72a5b449b76eac56000cb3faa191cabef5 100644 --- a/resources/views/projeto/editaFormulario/finalizar.blade.php +++ b/resources/views/projeto/editaFormulario/finalizar.blade.php @@ -12,7 +12,8 @@
    * Campos obrigatórios
    - + +
    diff --git a/resources/views/projeto/editaFormulario/participantes.blade.php b/resources/views/projeto/editaFormulario/participantes.blade.php index 81ad21175fe32aa18417ebd12df9c1017aa902d0..4c46587a265014524b8d77bea219149003de566f 100644 --- a/resources/views/projeto/editaFormulario/participantes.blade.php +++ b/resources/views/projeto/editaFormulario/participantes.blade.php @@ -18,188 +18,598 @@
  • - @foreach ($participantes as $key => $p) -
    -
    -
    +
    + {{-- --}} +
    - -
    -
    - -
    -
    -
    -
    -
    - - -
    Dados do discente
    -
    +
    +
    +
    +
    + + +
    Dados do discente
    +
    @component('componentes.input', ['label' => 'Nome completo']) - - @endcomponent -
    -
    - @component('componentes.input', ['label' => 'E-mail']) - - @endcomponent -
    -
    - @component('componentes.input', ['label' => 'Data de nascimento']) - - @endcomponent -
    -
    - @component('componentes.input', ['label' => 'CPF']) - - - - @endcomponent -
    -
    - @component('componentes.input', ['label' => 'RG']) - - @endcomponent -
    -
    - @component('componentes.input', ['label' => 'Celular']) - - @endcomponent -
    -
    Endereço
    -
    - @component('componentes.input', ['label' => 'CEP']) - + + + @error("name.".$i) + + {{ $message }} + + @enderror @endcomponent -
    - -
    - @component('componentes.select', ['label' => 'Estado']) - - @endcomponent -
    -
    - @component('componentes.input', ['label' => 'Cidade']) - +
    +
    + @component('componentes.input', ['label' => 'E-mail']) + + @error('email.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Data de nascimento']) + + @error('data_de_nascimento.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'CPF']) + + + @error('cpf.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'RG']) + + @error('rg.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Celular']) + + @error('celular.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    Endereço
    +
    + @component('componentes.input', ['label' => 'CEP']) + + @error('cep.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    + +
    + @component('componentes.select', ['label' => 'Estado']) + + @error('uf.'.$i) + + {{ $message }} + + @enderror @endcomponent -
    -
    - @component('componentes.input', ['label' => 'Bairro']) - +
    +
    + @component('componentes.input', ['label' => 'Cidade']) + + @error('cidade.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Bairro']) + + @error('bairro.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Rua']) + + @error('rua.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Número']) + + @error('numero.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Complemento',]) + + @error('complemento.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    Dados do curso
    +
    + @component('componentes.input', ['label' => 'Universidade']) + + @error('instituicao.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Curso']) + + @error('curso.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.select', ['label' => 'Turno']) + + @error('turno.'.$i) + + {{ $message }} + + @enderror @endcomponent -
    -
    - @component('componentes.input', ['label' => 'Rua']) - +
    + @php + $options = array('6' => 6, '7' => 7,'8' => 8,'9' => 9,'10' => 10,'11' => 11,'12' => 12); + @endphp +
    + @component('componentes.select', ['label' => 'Total de períodos do curso']) + + @error('total_periodos.'.$i) + + {{ $message }} + + @enderror @endcomponent -
    -
    - @component('componentes.input', ['label' => 'Número']) - +
    +
    + @component('componentes.select', ['label' => 'Período atual']) + + @error('periodo_atual.'.$i) + + {{ $message }} + + @enderror @endcomponent -
    -
    - @component('componentes.input', ['label' => 'Complemento', 'obrigatorio' => '']) - +
    +
    + @component('componentes.select', ['label' => 'Ordem de prioridade']) + + @error('ordem_prioridade.'.$i) + + {{ $message }} + + @enderror @endcomponent -
    -
    Dados do curso
    -
    - @component('componentes.input', ['label' => 'Universidade']) - +
    +
    + @component('componentes.input', ['label' => 'Coeficiente de rendimento']) + + @error('media_do_curso.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    Plano de trabalho
    +
    + @component('componentes.input', ['label' => 'Título']) + + @error('nomePlanoTrabalho.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Anexo(.pdf)']) + + @error('anexoPlanoTrabalho.'.$i) + + {{ $message }} + + @enderror + @error('anexoPlanoTrabalho') + + {{ $message }} + + @enderror + @endcomponent + @if($p->planoTrabalho) +
    +
    + + +
    +
    + + @endif +
    +
    +
    +
    +
    +
    + @else +
    + +
    + {{-- --}} + +
    +
    +
    +
    +
    + + +
    Dados do discente
    +
    + @component('componentes.input', ['label' => 'Nome completo']) + + + @error("name.".$i) + + {{ $message }} + + @enderror @endcomponent -
    -
    - @component('componentes.input', ['label' => 'Curso']) - +
    +
    + @component('componentes.input', ['label' => 'E-mail']) + + @error('email.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Data de nascimento']) + + @error('data_de_nascimento.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'CPF']) + + + @error('cpf.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'RG']) + + @error('rg.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Celular']) + + @error('celular.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    Endereço
    +
    + @component('componentes.input', ['label' => 'CEP']) + + @error('cep.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    + +
    + @component('componentes.select', ['label' => 'Estado']) + + @error('uf.'.$i) + + {{ $message }} + + @enderror @endcomponent -
    -
    - @component('componentes.select', ['label' => 'Turno']) - - @endcomponent -
    - @php - $options = array('6' => 6, '7' => 7,'8' => 8,'9' => 9,'10' => 10,'11' => 11,'12' => 12); - @endphp -
    - @component('componentes.select', ['label' => 'Total de períodos do curso']) - - @endcomponent -
    -
    - @component('componentes.select', ['label' => 'Período atual']) - - @endcomponent -
    -
    - @php - $ordens = array('1' => 1, '2' => 2,'3' => 3,); - @endphp - @component('componentes.select', ['label' => 'Ordem de prioridade']) - + @error('cidade.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Bairro']) + + @error('bairro.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Rua']) + + @error('rua.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Número']) + + @error('numero.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Complemento',]) + + @error('complemento.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    Dados do curso
    +
    + @component('componentes.input', ['label' => 'Universidade']) + + @error('instituicao.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Curso']) + + @error('curso.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.select', ['label' => 'Turno']) + + @error('turno.'.$i) + + {{ $message }} + + @enderror @endcomponent -
    -
    - @component('componentes.input', ['label' => 'Coeficiente de rendimento']) - +
    + @php + $options = array('6' => 6, '7' => 7,'8' => 8,'9' => 9,'10' => 10,'11' => 11,'12' => 12); + @endphp +
    + @component('componentes.select', ['label' => 'Total de períodos do curso']) + + @error('total_periodos.'.$i) + + {{ $message }} + + @enderror @endcomponent -
    -
    Plano de trabalho
    -
    - {{-- @dd($arquivos) --}} - @component('componentes.input', ['label' => 'Título']) - +
    +
    + @component('componentes.select', ['label' => 'Período atual']) + + @error('periodo_atual.'.$i) + + {{ $message }} + + @enderror @endcomponent -
    -
    - @component('componentes.input', ['label' => 'Anexo(.pdf)']) - +
    +
    + @component('componentes.select', ['label' => 'Ordem de prioridade']) + + @error('ordem_prioridade.'.$i) + + {{ $message }} + + @enderror @endcomponent -
    -
    - - -
    -
    -
    +
    +
    + @component('componentes.input', ['label' => 'Coeficiente de rendimento']) + + @error('media_do_curso.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    Plano de trabalho
    +
    + @component('componentes.input', ['label' => 'Título']) + + @error('nomePlanoTrabalho.'.$i) + + {{ $message }} + + @enderror + @endcomponent +
    +
    + @component('componentes.input', ['label' => 'Anexo(.pdf)']) + + @error('anexoPlanoTrabalho.'.$i) + + {{ $message }} + + @enderror + @error('anexoPlanoTrabalho') + + {{ $message }} + + @enderror + @endcomponent + {{--
    +
    + + +
    +
    --}} +
    +
    +
    -
    - -
    - @endforeach + @endif + + @endfor +
    diff --git a/resources/views/projeto/editaFormulario/projeto.blade.php b/resources/views/projeto/editaFormulario/projeto.blade.php index 3f97720de8bbc21f66722fc7bbc9498e7140c99d..adf75dad76fe0bfa3bfa57fc0570090cee1aa54f 100644 --- a/resources/views/projeto/editaFormulario/projeto.blade.php +++ b/resources/views/projeto/editaFormulario/projeto.blade.php @@ -11,24 +11,24 @@

    - - - @error('nomeProjeto') + + + @error('titulo') {{ $message }} @enderror
    - {{-- @dd($projeto->grandeArea->nome) --}} +
    - @foreach($grandeAreas as $grandeArea) - + @endforeach - @error('grandeArea') + @error('grande_area_id') {{ $message }} @@ -37,13 +37,12 @@
    - @foreach($areas as $area) - + @endforeach - - @error('area') + @error('area_id') {{ $message }} @@ -52,16 +51,15 @@
    - + <@if ($projeto->subarea != null) + @foreach($subAreas as $subarea) + @endforeach @endif - @error('subArea') + @error('sub_area_id') {{ $message }} diff --git a/resources/views/projeto/editaFormulario/proponente.blade.php b/resources/views/projeto/editaFormulario/proponente.blade.php index 65faa5b8beac75d1ff411d0dbf3855483f54ff45..3e09263cd57dbf4a8de12192e29a375e93f49b02 100644 --- a/resources/views/projeto/editaFormulario/proponente.blade.php +++ b/resources/views/projeto/editaFormulario/proponente.blade.php @@ -22,7 +22,7 @@ value="{{ Auth()->user()->proponentes->linkLattes }}" @else value="" - @endif required > + @endif > Ex.: http://lattes.cnpq.br/8363536830656923 @error('linkLattesEstudante') @@ -32,12 +32,12 @@
    - - + + Ex.: http://dgp.cnpq.br/dgp/espelhogrupo/228363 - @error('linkGrupo') + @error('linkGrupoPesquisa') {{ $message }} @@ -46,7 +46,7 @@
    + value="{{ $projeto->pontuacaoPlanilha }}" > @error('pontuacaoPlanilha') diff --git a/resources/views/projeto/editar.blade.php b/resources/views/projeto/editar.blade.php index 42c934905995ca157c15810c7e47f4c46e461171..129f81d08ca6a6d80e81c11f1ee3dfb19c9b10b3 100644 --- a/resources/views/projeto/editar.blade.php +++ b/resources/views/projeto/editar.blade.php @@ -4,34 +4,46 @@
    {{-- action="{{route('trabalho.store')}}" --}} -
    + @csrf
    + {{-- @dd($errors->get('name.*')) --}} + {{-- @dd($errors->has('cpf.*')) --}} + {{-- @dd($errors->getBags()['default']->keys()) --}} @if (session('mensagem')) @endif + @if ($errors->any()) +
    +
      + @foreach ($errors->all() as $error) +
    • {{ $error }}
    • + @endforeach +
    +
    + @endif +
    - @component('projeto.editaFormulario.projeto', - ['grandeAreas' => $grandeAreas, 'projeto' => $projeto, - 'areas' => $areas, 'subareas' => $subAreas]) - @endcomponent + @include('projeto.editaFormulario.projeto') + + + @include('projeto.editaFormulario.proponente') - @component('projeto.editaFormulario.proponente', ['projeto' => $projeto]) - @endcomponent - @component('projeto.editaFormulario.anexos', ['projeto' => $projeto]) - @endcomponent + @include('projeto.editaFormulario.anexos') - @component('projeto.editaFormulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno, 'projeto' => $projeto, 'participantes' => $participantes, 'arquivos' =>$arquivos]) - @endcomponent - @component('projeto.editaFormulario.finalizar', ['projeto' => $projeto]) - @endcomponent + @include('projeto.editaFormulario.participantes') + {{-- @include('projeto.editaFormulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno, 'edital'=>$edital, 'projeto' => $projeto]) + --}} + + @include('projeto.editaFormulario.finalizar') +
    @@ -93,8 +105,10 @@ @@ -650,11 +667,11 @@ } function submeterProposta() { + if (checarCpfs()) { document.getElementById("submeterFormProposta").click(); - // if (checarCpfs()) { - // } else { - // $("#modalCpfInvalido").modal('show'); - // } + } else { + $("#modalCpfInvalido").modal('show'); + } } function mascaraCPF(input) { @@ -680,4 +697,4 @@ input.value = resultado; } -@endsection +@endsection \ No newline at end of file diff --git a/resources/views/projeto/formularioVisualizar/anexos.blade.php b/resources/views/projeto/formularioVisualizar/anexos.blade.php index a0c6947fd396a5452c4814444019ce453620e4ca..dbe75574b9931bbdf231324a4ce3e27b53caea05 100644 --- a/resources/views/projeto/formularioVisualizar/anexos.blade.php +++ b/resources/views/projeto/formularioVisualizar/anexos.blade.php @@ -15,9 +15,15 @@ @component('componentes.input', ['label' => 'Projeto (.pdf)']) @endcomponent
    -
    - -
    + @if($projeto->anexoProjeto) +
    + +
    + @else +
    +

    +
    + @endif
    {{-- Anexo do currículo --}} @@ -28,9 +34,15 @@ @endcomponent
    -
    - -
    + @if($projeto->anexoLattesCoordenador) +
    + +
    + @else +
    +

    +
    + @endif
    {{-- Anexo da Planilha de Pontuação --}} @@ -41,9 +53,15 @@ @endcomponent
    -
    - -
    + @if($projeto->anexoPlanilhaPontuacao) +
    + +
    + @else +
    +

    +
    + @endif
    @@ -51,13 +69,24 @@
    - @component('componentes.input', ['label' => 'Decisão do CONSU (.pdf)']) + +
    + - @endcomponent -
    -
    - +
    + +
    +
    + @if($projeto->anexoDecisaoCONSU) +
    + +
    + @else +
    +

    +
    + @endif
    @@ -69,9 +98,15 @@ @endcomponent
  • -
    - -
    + @if($projeto->anexoGrupoPesquisa) +
    + +
    + @else +
    +

    +
    + @endif
    {{-- Anexo da autorizações especiais --}} @@ -84,9 +119,9 @@
    - + - +
    @@ -97,18 +132,52 @@
    @component('componentes.input', ['label' => 'Sim, declaro que necessito de autorizações especiais (.pdf)']) +
    + @if($projeto->anexoAutorizacaoComiteEtica ) +
    + +
    + @else +
    +

    +
    + @endif + +
    + @error('anexoAutorizacaoComiteEtica') + + {{ $message }} + + @enderror @endcomponent
    - + -
    - -
    + diff --git a/resources/views/projeto/formularioVisualizar/participantes.blade.php b/resources/views/projeto/formularioVisualizar/participantes.blade.php index 85441ba3e95c0a1ede7091884a73c3b6bf010b99..177c3a47c5dd5c65185789fd3dc41c7b4b8ecec1 100644 --- a/resources/views/projeto/formularioVisualizar/participantes.blade.php +++ b/resources/views/projeto/formularioVisualizar/participantes.blade.php @@ -75,7 +75,7 @@
    Endereço
    @component('componentes.input', ['label' => 'CEP']) - + @endcomponent
    @@ -178,7 +178,7 @@
    {{-- @dd($arquivos) --}} @component('componentes.input', ['label' => 'Título']) - + @endcomponent
    @@ -189,11 +189,18 @@
    -
    - - + + @if($p->planoTrabalho) +
    + + +
    -
    + @else +
    +

    +
    + @endif diff --git a/resources/views/projeto/formularioVisualizar/projeto.blade.php b/resources/views/projeto/formularioVisualizar/projeto.blade.php index 9482f04dd83e532a72cf3e555f4089bd31e9f5c0..1ea086578c353a7c8f6154b099340c6e0408e00d 100644 --- a/resources/views/projeto/formularioVisualizar/projeto.blade.php +++ b/resources/views/projeto/formularioVisualizar/projeto.blade.php @@ -25,7 +25,7 @@ @error('grandeArea') @@ -39,7 +39,7 @@ @@ -56,7 +56,7 @@ @if ($projeto->subarea != null) @foreach($subareas as $subarea) - + @endforeach @endif diff --git a/resources/views/proponente/projetos.blade.php b/resources/views/proponente/projetos.blade.php index d9cb884f5d5b464a52da1392cd7f897070d77465..464f8b8b5fd4d0b6a66a87e5d09323b86b462142 100644 --- a/resources/views/proponente/projetos.blade.php +++ b/resources/views/proponente/projetos.blade.php @@ -76,11 +76,11 @@ {{ $projeto->titulo }} {{ date('d-m-Y', strtotime($projeto->updated_at)) }} - @if($projeto->status == 'Avaliado') + @if($projeto->status == 'avaliado') Avaliado - @elseif($projeto->status == 'Submetido' || $projeto->status == 'submetido') + @elseif($projeto->status == 'submetido' || $projeto->status == 'submetido') Submetido - @elseif($projeto->status == 'Rascunho') + @elseif($projeto->status == 'rascunho') Rascunho @endif diff --git a/resources/views/proponente/projetosEdital.blade.php b/resources/views/proponente/projetosEdital.blade.php index b4859a62b5ec976f69db90a46dcabd9787537bec..e301320596292b1c9df1b8223bed0750cc6d90bc 100644 --- a/resources/views/proponente/projetosEdital.blade.php +++ b/resources/views/proponente/projetosEdital.blade.php @@ -32,7 +32,40 @@
    Submissão irá até o dia {{ date('d/m/Y', strtotime($edital->fimSubmissao)) }}
    - inicioSubmissao <= $hoje && $hoje <= $edital->fimSubmissao) href="{{ route('trabalho.index', ['id' => $edital->id] )}}" class="btn btn-info" @else href="#" data-toggle="tooltip" data-placement="top" title="O periodo de submissão foi encerrado." @endif style="position:relative; float: right;">Criar proposta + +
    + @if(false) {{-- Agendamento para o dia 01/07/2021 as 12:30:00--}} + Criar proposta + + + @else + inicioSubmissao <= $hoje && $hoje <= $edital->fimSubmissao) href="{{ route('trabalho.index', ['id' => $edital->id] )}}" class="btn btn-info" @else href="#" data-toggle="tooltip" data-placement="top" title="O periodo de submissão foi encerrado." @endif style="position:relative; float: right;">Criar proposta + @endif +
    +
    diff --git a/routes/web.php b/routes/web.php index e8e20481f60dd9139d8a56619ca8a89b9f6bcb25..cf105ce02b59fd951809ea8254138c35fcd2d298 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,4 +1,4 @@ - true]); -//######### Proponente ######################################## -Route::get( '/proponente/index', 'ProponenteController@index' )->name('proponente.index'); -Route::get( '/proponente/cadastro', 'ProponenteController@create' )->name('proponente.create'); -Route::post('/proponente/cadastro', 'ProponenteController@store' )->name('proponente.store'); -Route::get( '/proponente/editais', 'ProponenteController@editais' )->name('proponente.editais'); -Route::get( '/projetos-submetidos', 'ProponenteController@projetosDoProponente' )->name('proponente.projetos'); -Route::get( '/projetos-edital/{id}', 'ProponenteController@projetosEdital' )->name('proponente.projetosEdital')->middleware('auth'); - - -//######### Rotas Administrador ################################# -Route::get('/perfil-usuario', 'UserController@minhaConta' )->name('user.perfil')->middleware(['auth', 'verified']); -Route::post('/perfil-usuario', 'UserController@editarPerfil' )->name('perfil.edit')->middleware(['auth', 'verified']); Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){ + //######### Proponente ######################################## + Route::get( '/proponente/index', 'ProponenteController@index' )->name('proponente.index'); + Route::get( '/proponente/cadastro', 'ProponenteController@create' )->name('proponente.create'); + Route::post('/proponente/cadastro', 'ProponenteController@store' )->name('proponente.store'); + Route::get( '/proponente/editais', 'ProponenteController@editais' )->name('proponente.editais'); + Route::get( '/projetos-submetidos', 'ProponenteController@projetosDoProponente' )->name('proponente.projetos'); + Route::get( '/projetos-edital/{id}', 'ProponenteController@projetosEdital' )->name('proponente.projetosEdital')->middleware('auth'); + + + //######### Rotas Administrador ################################# + Route::get('/perfil-usuario', 'UserController@minhaConta' )->name('user.perfil')->middleware(['auth', 'verified']); + Route::post('/perfil-usuario', 'UserController@editarPerfil' )->name('perfil.edit')->middleware(['auth', 'verified']); //######## Rotas Avaliador #################################### Route::prefix('avaliador')->name('avaliador.')->group(function(){ @@ -116,14 +116,14 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){ //######### Trabalho ######################################## Route::get( '/trabalho/submeter/{id}', 'TrabalhoController@index' )->name('trabalho.index'); - Route::get( '/trabalho/visualizar/{id}','TrabalhoController@show' )->name('trabalho.show'); + // Route::get( '/trabalho/visualizar/{id}','TrabalhoController@show' )->name('trabalho.show'); Route::post( '/trabalho/novaVersao', 'TrabalhoController@novaVersao' )->name('trabalho.novaVersao'); Route::post( '/trabalho/criar', 'TrabalhoController@salvar' )->name('trabalho.store'); Route::post( '/trabalho/criarRascunho', 'TrabalhoController@storeParcial' )->name('trabalho.storeParcial'); Route::get( '/edital/{id}/projetos', 'TrabalhoController@projetosDoEdital' )->name('projetos.edital'); Route::get( '/projeto/visualizar/{id}', 'TrabalhoController@show' )->name('trabalho.show'); Route::get( '/projeto/{id}/editar', 'TrabalhoController@edit' )->name('trabalho.editar'); - Route::post( '/projeto/{id}/atualizar', 'TrabalhoController@atualizar' )->name('trabalho.update'); + Route::post( '/projeto/{id}/atualizar', 'TrabalhoController@update' )->name('trabalho.update'); Route::get( '/projeto/{id}/excluir', 'TrabalhoController@destroy' )->name('trabalho.destroy'); Route::get( '/projeto/{id}/excluirParticipante','TrabalhoController@excluirParticipante')->name('trabalho.excluirParticipante'); Route::get( '/projeto/exportar/{id}','TrabalhoController@exportProjeto' )->name('exportar.projeto'); @@ -177,6 +177,7 @@ Route::prefix('usuarios')->name('admin.')->group(function(){ Route::post('/visualizarParecer', 'AdministradorController@visualizarParecer')->name('visualizarParecer'); Route::get('/pareceresProjetos', 'AdministradorController@pareceres' )->name('pareceres'); Route::get('/analisarProjetos', 'AdministradorController@analisar' )->name('analisar'); + Route::get('/showrProjetos', 'AdministradorController@showProjetos' )->name('showProjetos'); }); Route::prefix('naturezas')->group(function(){