diff --git a/app/Http/Controllers/AdministradorController.php b/app/Http/Controllers/AdministradorController.php index fd48bfcb9e7efd8ac4e9d1199b9cd65d33702276..28dba86471e1804e036803633fbec601853b871a 100755 --- a/app/Http/Controllers/AdministradorController.php +++ b/app/Http/Controllers/AdministradorController.php @@ -114,7 +114,7 @@ class AdministradorController extends Controller // $participantes = User::whereIn('id', $participantesUsersIds)->get(); return view('administrador.analisar')->with([ - 'trabalhos' => $trabalhos->paginate(20), + 'trabalhos' => $trabalhos->paginate(9999), 'evento' => $evento, 'funcaoParticipantes' => $funcaoParticipantes, 'column' => $request->column, diff --git a/app/Http/Controllers/AvaliacaoRelatorioController.php b/app/Http/Controllers/AvaliacaoRelatorioController.php index 2054a3b37e8bfaa4da6e8c1bc3be96b169a58418..63021dbd166a8845ccb69ad48c04c30b8ea28a24 100644 --- a/app/Http/Controllers/AvaliacaoRelatorioController.php +++ b/app/Http/Controllers/AvaliacaoRelatorioController.php @@ -188,4 +188,13 @@ class AvaliacaoRelatorioController extends Controller return redirect()->back(); } + public function atualizarNota($id, Request $request){ + $aval = AvaliacaoRelatorio::find($id); + $aval->nota = $request->nota; + $aval->nota_apresentacao = $request->nota_apresentacao; + $aval->save(); + + return redirect()->back()->with(['sucesso' => "Notas avaliadas por ".$aval->user->name." atualizadas!"]); + } + } diff --git a/app/Http/Requests/StoreTrabalho.php b/app/Http/Requests/StoreTrabalho.php index d373efbb50057ab7d29ec1fd21b2528d19d39e55..2dd3193730f6fa6425f98b28d67c33e1e1f76ae0 100755 --- a/app/Http/Requests/StoreTrabalho.php +++ b/app/Http/Requests/StoreTrabalho.php @@ -22,7 +22,7 @@ class StoreTrabalho extends FormRequest protected function prepareForValidation() { - $func = function($value) { + $func = function ($value) { return ['cpf' => $value]; }; $this->merge([ @@ -38,101 +38,99 @@ class StoreTrabalho extends FormRequest */ public function rules() { - // dd($this->all()); + //dd($this->all()); $evento = Evento::find($this->editalId); $rules = []; - - if($this->has('marcado')){ + if ($this->has('marcado')) { $rules['cpfs.*.cpf'] = ['distinct', 'nullable']; foreach ($this->get('marcado') as $key => $value) { - if( intval($value) == $key){ + + 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']; - - if($this->estudante[$value] === true){ + $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']; + if ($this->estudante[$value] == true) { //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['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']; //participante - $rules['rg.'.$value] = ['required', 'string']; - $rules['data_de_nascimento.'.$value] = ['required', 'string']; - $rules['curso.'.$value] = ['required', 'string']; - + $rules['rg.' . $value] = ['required', 'string']; + $rules['data_de_nascimento.' . $value] = ['required', 'string']; + $rules['curso.' . $value] = ['required', 'string']; + //participantes da pesquisa - if($evento->natureza_id != 3){ - $rules['turno.'.$value] = ['required', 'string']; - $rules['ordem_prioridade.'.$value] = ['required', 'string']; - $rules['periodo_atual.'.$value] = ['required', 'string']; - $rules['total_periodos.'.$value] = ['required', 'string']; + if ($evento->natureza_id != 3) { + $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']; } - + if($evento->tipo != "CONTINUO" && ($this->funcaoParticipante[$value] == "Voluntário" || $this->funcaoParticipante[$value] == "Bolsista")){ - $rules['anexoPlanoTrabalho.'.$value] = ['required']; - $rules['nomePlanoTrabalho.'.$value] = ['required', 'string']; - } + $rules['anexoPlanoTrabalho.' . $value] = ['required']; + $rules['nomePlanoTrabalho.' . $value] = ['required', 'string']; + } } // if($evento->tipo != "PIBEX") { // $rules['media_do_curso.' . $value] = ['required', 'string']; // } - + } } - - } else if($evento->tipo != "CONTINUO" ){ + } else if ($evento->tipo != "CONTINUO") { $rules['anexoPlanoTrabalho'] = ['required']; $rules['nomePlanoTrabalho'] = ['required', 'string']; } - if($this->has('rascunho')) { + if ($this->has('rascunho')) { $rules = []; return $rules; } else { //anexos - if($evento->nome_docExtra != null ){ - $rules['anexo_docExtra'] = [Rule::requiredIf($evento->obrigatoriedade_docExtra == true),'file', 'mimes:zip,doc,docx,pdf', 'max:2048']; + if ($evento->nome_docExtra != null) { + $rules['anexo_docExtra'] = [Rule::requiredIf($evento->obrigatoriedade_docExtra == true), 'file', 'mimes:zip,doc,docx,pdf', 'max:2048']; } - if($evento->tipo!="PIBEX" && $evento->tipo!="CONTINUO"){ + if ($evento->tipo != "PIBEX" && $evento->tipo != "CONTINUO") { //dd($this->preenchimentoFormFlag); - $rules['anexoPlanilhaPontuacao'] = ['required']; - $rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf']; - $rules['anexoGrupoPesquisa'] = ['required', 'mimes:pdf']; - $rules['anexoAutorizacaoComiteEtica'] = [Rule::requiredIf($this->autorizacaoFlag == 'sim')]; - $rules['justificativaAutorizacaoEtica']= [Rule::requiredIf($this->autorizacaoFlag == 'nao')]; - $rules['pontuacaoPlanilha'] = ['required', 'string']; - $rules['linkGrupoPesquisa'] = ['required', 'string']; - $rules['preenchimentoFormFlag'] = [Rule::in(['sim']), 'required']; - $rules['anexo_acao_afirmativa'] = [Rule::requiredIf($this->radioAcoesAfirmativas == 'sim')]; + $rules['anexoPlanilhaPontuacao'] = ['required']; + $rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf']; + $rules['anexoGrupoPesquisa'] = ['required', 'mimes:pdf']; + $rules['anexoAutorizacaoComiteEtica'] = [Rule::requiredIf($this->autorizacaoFlag == 'sim')]; + $rules['justificativaAutorizacaoEtica'] = [Rule::requiredIf($this->autorizacaoFlag == 'nao')]; + $rules['pontuacaoPlanilha'] = ['required', 'string']; + $rules['linkGrupoPesquisa'] = ['required', 'string']; + $rules['preenchimentoFormFlag'] = [Rule::in(['sim']), 'required']; + $rules['anexo_acao_afirmativa'] = [Rule::requiredIf($this->radioAcoesAfirmativas == 'sim')]; } - $rules['editalId'] = ['required', 'string']; - $rules['marcado.*'] = ['required']; - $rules['titulo'] = ['required', 'string']; - $rules['grande_area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string']; - $rules['area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string']; - - if($evento->natureza_id == 3){ + $rules['editalId'] = ['required', 'string']; + $rules['marcado.*'] = ['required']; + $rules['titulo'] = ['required', 'string']; + $rules['grande_area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string']; + $rules['area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string']; + + if ($evento->natureza_id == 3) { $rules['area_tematica_id'] = ['required', 'string']; $rules['ods'] = ['required']; - + } $rules['linkLattesEstudante'] = ['required', 'string']; - - if($evento->tipo!="CONTINUO"){ + + if ($evento->tipo != "CONTINUO") { $rules['anexoDecisaoCONSU'] = [Rule::requiredIf($evento->consu), 'mimes:pdf']; $rules['anexoProjeto'] = ['required', 'mimes:pdf']; } else { @@ -142,42 +140,42 @@ class StoreTrabalho extends FormRequest 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', - 'cpfs.*.cpf.distinct' => 'O integrante com CPF :input não pode ser adicionado mais de uma vez', - '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', + 'cpf.*.required' => 'O cpf é obrigatório', + 'cpfs.*.cpf.distinct' => 'O integrante com CPF :input não pode ser adicionado mais de uma vez', + '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', 'area_id' => "area id", 'area_tematica_id' => 'area tematica id', 'ods.*' => 'Deve ser selecionada pelo menos uma ODS', @@ -186,4 +184,4 @@ class StoreTrabalho extends FormRequest 'anexo_SIPAC.*' => 'anexo_SIPAC' ]; } -} \ No newline at end of file +} diff --git a/resources/views/avaliacaoRelatorio/avaliacao.blade.php b/resources/views/avaliacaoRelatorio/avaliacao.blade.php index 9d83498657aa45e96e31247258d9cfb755bc964c..4bc975b11149efe3122aa187a4fb1c0451740bca 100644 --- a/resources/views/avaliacaoRelatorio/avaliacao.blade.php +++ b/resources/views/avaliacaoRelatorio/avaliacao.blade.php @@ -14,53 +14,66 @@
Plano: {{$arquivo->titulo}}
-
+
+
+ @csrf +
+ +
+
+ +
-
- -
-
- +
+ +
+
+ +
+
+
+ +
-
-
-
- -
-
-
-
- +
+
+ @else + @endif +
+
+
-
-
-
- @else - @endif -
-
-
- - @if(isset($aval)) - @if($aval->arquivoAvaliacao != null) + + @if(isset($aval)) + @if($aval->arquivoAvaliacao != null) - @endif - @endif + @endif + @endif +
+ + + +
+ +
+
+ +