From 5ac2f8727e27e510b3d2c49d5998924127192b9f Mon Sep 17 00:00:00 2001 From: Lucas Henrique Date: Mon, 28 Nov 2022 16:07:40 -0300 Subject: [PATCH] =?UTF-8?q?Resolve=20bug=20de=20consist=C3=AAncia=20das=20?= =?UTF-8?q?informa=C3=A7=C3=B5es=20do=20plano=20de=20trabalho?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Requests/UpdateTrabalho.php | 6 +++--- resources/views/avaliador/listarTrabalhos.blade.php | 4 ++-- .../views/projeto/editaFormulario/proponente.blade.php | 9 ++++++--- .../projeto/formularioVisualizar/proponente2.blade.php | 7 +++++-- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/Http/Requests/UpdateTrabalho.php b/app/Http/Requests/UpdateTrabalho.php index ce09032..83534ac 100755 --- a/app/Http/Requests/UpdateTrabalho.php +++ b/app/Http/Requests/UpdateTrabalho.php @@ -71,9 +71,9 @@ class UpdateTrabalho extends FormRequest } } } else { - $proponente = Proponente::find($projeto->proponente_id); - $rules['anexoPlanoTrabalho'] = [Rule::requiredIf($proponente->planoTrabalho == null)]; - $rules['nomePlanoTrabalho'] = [Rule::requiredIf($proponente->planoTrabalho->titulo == null), 'string']; + $arquivo = Arquivo::where("trabalhoId", $projeto->id)->first(); + $rules['anexoPlanoTrabalho'] = [Rule::requiredIf($arquivo == null)]; + $rules['nomePlanoTrabalho'] = [Rule::requiredIf($arquivo->titulo == null), 'string']; } // dd($this->all()); diff --git a/resources/views/avaliador/listarTrabalhos.blade.php b/resources/views/avaliador/listarTrabalhos.blade.php index acf0150..430c841 100755 --- a/resources/views/avaliador/listarTrabalhos.blade.php +++ b/resources/views/avaliador/listarTrabalhos.blade.php @@ -87,7 +87,7 @@ @if ($evento->numParticipantes == 0) @php - $planoTrabalho = $trabalho->proponente->planoTrabalho + $planoTrabalho = App\Arquivo::where("trabalhoId", $trabalho->id)->first(); @endphp @@ -198,7 +198,7 @@ @if ($evento->numParticipantes == 0) @php - $planoTrabalho = $trabalho->proponente->planoTrabalho + $planoTrabalho = App\Arquivo::where("trabalhoId", $trabalho->id)->first(); @endphp diff --git a/resources/views/projeto/editaFormulario/proponente.blade.php b/resources/views/projeto/editaFormulario/proponente.blade.php index 164304e..e6aacf4 100755 --- a/resources/views/projeto/editaFormulario/proponente.blade.php +++ b/resources/views/projeto/editaFormulario/proponente.blade.php @@ -97,13 +97,16 @@ @endif @if ($edital->numParticipantes == 0) + @php + $arquivo = App\Arquivo::where("trabalhoId", $projeto->id)->first(); + @endphp


- + @error('nomePlanoTrabalho') @@ -117,9 +120,9 @@
- @if ($proponente != null && $proponente->planoTrabalho) + @if ($proponente != null && $arquivo)
+ href="{{ route('baixar.plano', ['id' => $arquivo->id]) }}"> @else

diff --git a/resources/views/projeto/formularioVisualizar/proponente2.blade.php b/resources/views/projeto/formularioVisualizar/proponente2.blade.php index 2224472..0d5ca11 100644 --- a/resources/views/projeto/formularioVisualizar/proponente2.blade.php +++ b/resources/views/projeto/formularioVisualizar/proponente2.blade.php @@ -77,15 +77,18 @@ @endif @if ($edital->numParticipantes == 0) + @php + $arquivo = App\Arquivo::where("trabalhoId", $projeto->id)->first(); + @endphp
- +
@endif -- GitLab