diff --git a/app/Http/Controllers/AvaliacaoRelatorioController.php b/app/Http/Controllers/AvaliacaoRelatorioController.php index e5d86b08b8ac0533ba9df235263b361fdeae393c..97a31aa99051e6819e146aaa595df3c222f6a3ac 100644 --- a/app/Http/Controllers/AvaliacaoRelatorioController.php +++ b/app/Http/Controllers/AvaliacaoRelatorioController.php @@ -65,7 +65,7 @@ class AvaliacaoRelatorioController extends Controller public function criar(Request $request){ $validatedData = $request->validate([ - 'nota' => ['required', 'integer',], + 'nota' => ['required'], 'comentario' => ['required'], ]); $avaliacao = AvaliacaoRelatorio::find($request->avaliacao_id); diff --git a/app/Http/Requests/UpdateTrabalho.php b/app/Http/Requests/UpdateTrabalho.php index 1740f3beea058e82897f472fbee4cef0189b9a03..0ba0b9ff65d2d11be939bd90c57f8fc63ba6cf0d 100755 --- a/app/Http/Requests/UpdateTrabalho.php +++ b/app/Http/Requests/UpdateTrabalho.php @@ -37,7 +37,12 @@ class UpdateTrabalho extends FormRequest } if($this->has('marcado')){ foreach ($this->get('marcado') as $key => $value) { - if( intval($value) == $key){ + if( intval($value) == $key){ + $participante = null; + if($this->participante_id[$value] != null){ + $participante = Participante::find($this->participante_id[$value]); + } + //user $rules['name.'.$value] = ['required', 'string']; $rules['email.'.$value] = ['required', 'string']; @@ -63,11 +68,18 @@ class UpdateTrabalho extends FormRequest $rules['media_do_curso.' . $value] = ['required', 'string']; } $rules['nomePlanoTrabalho.'.$value] = ['required', 'string']; - $rules['anexoPlanoTrabalho.'.$value] = ['required', 'mimes:pdf']; - + + if($participante !=null){ + $arquivo = Arquivo::where('participanteId',$participante->id)->where('trabalhoId',$projeto->id)->first(); + if($arquivo == null || $this->nomePlanoTrabalho[$value] != $arquivo->titulo){ + $rules['anexoPlanoTrabalho.'.$value] = ['required', 'mimes:pdf']; + } + }else{ + $rules['anexoPlanoTrabalho.'.$value] = ['required', 'mimes:pdf']; + } + } } - } // dd($this->all()); if ($this->has('rascunho')) { diff --git a/database/migrations/2022_08_30_155137_change_avaliacao_relatorios_nota_column_type.php b/database/migrations/2022_08_30_155137_change_avaliacao_relatorios_nota_column_type.php new file mode 100644 index 0000000000000000000000000000000000000000..9ed557270b32c552e359d95d721cbe96d9d58ce5 --- /dev/null +++ b/database/migrations/2022_08_30_155137_change_avaliacao_relatorios_nota_column_type.php @@ -0,0 +1,30 @@ +float('nota')->nullable()->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/resources/views/administrador/analisarProposta.blade.php b/resources/views/administrador/analisarProposta.blade.php index f837de9300fb36fbbea95b1e403dfb87f4898f3e..c1d612dfe20c2982ee99ceb6286012bb62669dd9 100644 --- a/resources/views/administrador/analisarProposta.blade.php +++ b/resources/views/administrador/analisarProposta.blade.php @@ -503,7 +503,7 @@
Relatórios
- @if($flagSubstituicao == 1) + @if($substituicoesPendentes->count() == 0) Listar Relatórios @else @@ -558,8 +558,8 @@
diff --git a/resources/views/avaliacaoRelatorio/listar.blade.php b/resources/views/avaliacaoRelatorio/listar.blade.php index b7419ba878741cabb81bedd9cf6c1bb76d20f421..39966b0f6fb6484b7b374555c524a15d239feb04 100644 --- a/resources/views/avaliacaoRelatorio/listar.blade.php +++ b/resources/views/avaliacaoRelatorio/listar.blade.php @@ -98,8 +98,8 @@ - nota != null) value="{{$avaliacao->nota}}" @endif>
@@ -183,8 +183,8 @@ - nota != null) value="{{$avaliacao->nota}}" @endif>