diff --git a/app/Http/Controllers/TrabalhoController.php b/app/Http/Controllers/TrabalhoController.php index faaf2afaaec2ad08cefd3370ac688c37c2d98b29..880008e5fbd5974639abf87cf6dee6f43a1d09c4 100755 --- a/app/Http/Controllers/TrabalhoController.php +++ b/app/Http/Controllers/TrabalhoController.php @@ -409,6 +409,11 @@ class TrabalhoController extends Controller $trabalho->anexo_acao_afirmativa = Storage::putFileAs($pasta, $request->anexo_acao_afirmativa, "Anexo_Acao_Afirmativa." . $request->file('anexo_acao_afirmativa')->extension()); } + //Anexo Carta de Anuência + if (isset($request->anexo_carta_anuencia)) { + $trabalho->anexo_carta_anuencia = Storage::putFileAs($pasta, $request->anexo_carta_anuencia, "anexo_carta_anuencia." . $request->file('anexo_carta_anuencia')->extension()); + } + return $trabalho; } @@ -792,6 +797,16 @@ class TrabalhoController extends Controller return abort(404); } + public function baixarCartaAnuencia($id) + { + $projeto = Trabalho::find($id); + if (Storage::disk()->exists($projeto->anexo_carta_anuencia)) { + ob_end_clean(); + return Storage::download($projeto->anexo_carta_anuencia); + } + return abort(404); + } + public function baixarAnexoGrupoPesquisa($id) { $projeto = Trabalho::find($id); @@ -1350,7 +1365,7 @@ class TrabalhoController extends Controller ->create($request->except([ 'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao', 'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'anexoAutorizacaoComiteEtica', - 'justificativaAutorizacaoEtica','modalidade','anexo_docExtra', 'anexo_SIPAC', 'anexo_acao_afirmativa' + 'justificativaAutorizacaoEtica','modalidade','anexo_docExtra', 'anexo_SIPAC', 'anexo_acao_afirmativa', 'anexo_carta_anuencia' ])); } diff --git a/database/migrations/2023_06_27_201258_add_carta_anuencia_to_trabalhos_table.php b/database/migrations/2023_06_27_201258_add_carta_anuencia_to_trabalhos_table.php new file mode 100644 index 0000000000000000000000000000000000000000..fe172293d2f240854c26081a32536662c923c15d --- /dev/null +++ b/database/migrations/2023_06_27_201258_add_carta_anuencia_to_trabalhos_table.php @@ -0,0 +1,32 @@ +string('anexo_carta_anuencia')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('trabalhos', function (Blueprint $table) { + $table->dropColumn('anexo_carta_anuencia'); + }); + } +} diff --git a/resources/views/administrador/analisarProposta.blade.php b/resources/views/administrador/analisarProposta.blade.php index 2329bc999de13ad6ddcbd2bf2c3fea586992aa6a..e2dd6421a0759ff22fb2e7c273cf37cf288e947d 100644 --- a/resources/views/administrador/analisarProposta.blade.php +++ b/resources/views/administrador/analisarProposta.blade.php @@ -538,6 +538,12 @@ @endif + @if($evento->tipo == 'PIBITI' && $evento->natureza_id == 2) +
+ + +
+ @endif @if($evento->nome_docExtra != null) {{-- Documento Extra --}}
diff --git a/resources/views/evento/formulario/anexos.blade.php b/resources/views/evento/formulario/anexos.blade.php index 4d02e6c84b2661aaad23de9a2e8a332fb8bf4649..d8d7f1261cc2f7ab36b784bed28e56e4efec8fb7 100755 --- a/resources/views/evento/formulario/anexos.blade.php +++ b/resources/views/evento/formulario/anexos.blade.php @@ -148,7 +148,8 @@ (endereço eletrônico de acesso)
- + @endif + @if($edital->tipo == "PIBIC" && $edital->natureza_id == 2)
@@ -170,6 +171,17 @@
@endif + @if($edital->tipo == "PIBITI" && $edital->natureza_id == 2) +
+ + + @error('anexo_carta_anuencia') + + {{ $message }} + + @enderror +
+ @endif @if($edital->nome_docExtra != null)
diff --git a/resources/views/projeto/formularioVisualizar/anexos2.blade.php b/resources/views/projeto/formularioVisualizar/anexos2.blade.php index 3c4776b08da7ce36df7dcb9d59ed84505095e8c1..2c11c151888081aeccf590b84e55cac6df9eaf86 100644 --- a/resources/views/projeto/formularioVisualizar/anexos2.blade.php +++ b/resources/views/projeto/formularioVisualizar/anexos2.blade.php @@ -76,6 +76,13 @@
@endif + @if($edital->tipo == 'PIBITI' && $edital->natureza_id == 2) +
+ + +
+ @endif + @if($edital->nome_docExtra != null) {{-- Documento Extra --}}
diff --git a/routes/web.php b/routes/web.php index 28c3b6834f6ebd8bcf5e94c1a1dc859792789317..796c0925f15d442e4ad2fbfb7e78fe8e33f78c3e 100755 --- a/routes/web.php +++ b/routes/web.php @@ -214,6 +214,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function () { Route::get('/baixar/anexo-projeto/{id}', 'TrabalhoController@baixarAnexoProjeto')->name('baixar.anexo.projeto'); Route::get('/baixar/anexo-consu/{id}', 'TrabalhoController@baixarAnexoConsu')->name('baixar.anexo.consu'); Route::get('/baixar/anexo-acao-afirmativa/{id}', 'TrabalhoController@baixarAcaoAfirmativa')->name('baixar.anexo.acao.afirmativa'); + Route::get('/baixar/anexo-carta-anuencia/{id}', 'TrabalhoController@baixarCartaAnuencia')->name('baixar.anexo.carta.anuencia'); Route::get('/baixar/anexo-comite/{id}', 'TrabalhoController@baixarAnexoComite')->name('baixar.anexo.comite'); Route::get('/baixar/anexo-justificativa/{id}', 'TrabalhoController@baixarAnexoJustificativa')->name('baixar.anexo.justificativa'); Route::get('/baixar/anexo-lattes/{id}', 'TrabalhoController@baixarAnexoLattes')->name('baixar.anexo.lattes');