Commit d2735cdf authored by unknown's avatar unknown
Browse files

Adicionar caixa de ações afirmativas e caixa de questionãrio de pesquisa de...

Adicionar caixa de ações afirmativas e caixa de questionãrio de pesquisa de prospecção interna no edital do PIBIC
parent 335a0ba7
...@@ -402,6 +402,11 @@ class TrabalhoController extends Controller ...@@ -402,6 +402,11 @@ class TrabalhoController extends Controller
$trabalho->anexo_SIPAC = Storage::putFileAs($pasta, $request->anexo_SIPAC, "Anexo_SIPAC." . $request->file('anexo_SIPAC')->extension()); $trabalho->anexo_SIPAC = Storage::putFileAs($pasta, $request->anexo_SIPAC, "Anexo_SIPAC." . $request->file('anexo_SIPAC')->extension());
} }
//Anexo Acao Afirmativa
if (isset($request->anexo_acao_afirmativa)) {
$trabalho->anexo_acao_afirmativa = Storage::putFileAs($pasta, $request->anexo_acao_afirmativa, "Anexo_Acao_Afirmativa." . $request->file('anexo_acao_afirmativa')->extension());
}
return $trabalho; return $trabalho;
} }
...@@ -770,6 +775,17 @@ class TrabalhoController extends Controller ...@@ -770,6 +775,17 @@ class TrabalhoController extends Controller
return abort(404); return abort(404);
} }
public function baixarAcaoAfirmativa($id)
{
$projeto = Trabalho::find($id);
//dd($projeto);
if (Storage::disk()->exists($projeto->anexo_acao_afirmativa)) {
ob_end_clean();
return Storage::download($projeto->anexo_acao_afirmativa);
}
return abort(404);
}
public function baixarAnexoGrupoPesquisa($id) public function baixarAnexoGrupoPesquisa($id)
{ {
$projeto = Trabalho::find($id); $projeto = Trabalho::find($id);
...@@ -1207,7 +1223,7 @@ class TrabalhoController extends Controller ...@@ -1207,7 +1223,7 @@ class TrabalhoController extends Controller
public function salvar(StoreTrabalho $request) public function salvar(StoreTrabalho $request)
{ {
// dd($request->all()); //dd($request->all());
try { try {
if (!$request->has('rascunho')) { if (!$request->has('rascunho')) {
$request->merge([ $request->merge([
...@@ -1235,11 +1251,12 @@ class TrabalhoController extends Controller ...@@ -1235,11 +1251,12 @@ class TrabalhoController extends Controller
'justificativaAutorizacaoEtica','modalidade','anexo_docExtra', 'justificativaAutorizacaoEtica','modalidade','anexo_docExtra',
])); ]));
} else { } else {
//dd();
$trabalho = Auth::user()->proponentes->trabalhos() $trabalho = Auth::user()->proponentes->trabalhos()
->create($request->except([ ->create($request->except([
'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao', 'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao',
'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'anexoAutorizacaoComiteEtica', 'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'anexoAutorizacaoComiteEtica',
'justificativaAutorizacaoEtica','modalidade','anexo_docExtra', 'anexo_SIPAC' 'justificativaAutorizacaoEtica','modalidade','anexo_docExtra', 'anexo_SIPAC', 'anexo_acao_afirmativa'
])); ]));
} }
......
...@@ -105,6 +105,7 @@ class StoreTrabalho extends FormRequest ...@@ -105,6 +105,7 @@ class StoreTrabalho extends FormRequest
if($evento->tipo!="PIBEX" && $evento->tipo!="CONTINUO"){ if($evento->tipo!="PIBEX" && $evento->tipo!="CONTINUO"){
//dd($this->preenchimentoFormFlag);
$rules['anexoPlanilhaPontuacao'] = ['required']; $rules['anexoPlanilhaPontuacao'] = ['required'];
$rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf']; $rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf'];
$rules['anexoGrupoPesquisa'] = ['required', 'mimes:pdf']; $rules['anexoGrupoPesquisa'] = ['required', 'mimes:pdf'];
...@@ -112,6 +113,8 @@ class StoreTrabalho extends FormRequest ...@@ -112,6 +113,8 @@ class StoreTrabalho extends FormRequest
$rules['justificativaAutorizacaoEtica']= [Rule::requiredIf($this->autorizacaoFlag == 'nao')]; $rules['justificativaAutorizacaoEtica']= [Rule::requiredIf($this->autorizacaoFlag == 'nao')];
$rules['pontuacaoPlanilha'] = ['required', 'string']; $rules['pontuacaoPlanilha'] = ['required', 'string'];
$rules['linkGrupoPesquisa'] = ['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['editalId'] = ['required', 'string'];
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAnexoAcaoAfirmativaToTrabalhosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('trabalhos', function (Blueprint $table) {
$table->string('anexo_acao_afirmativa')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('trabalhos', function (Blueprint $table) {
$table->dropColumn('anexo_acao_afirmativa');
});
}
}
...@@ -510,6 +510,12 @@ ...@@ -510,6 +510,12 @@
<a href="{{ route('baixar.anexo.consu', ['id' => $trabalho->id]) }}"><img class="" src="{{asset('img/icons/pdf.ico')}}" style="width:40px" alt=""></a> <a href="{{ route('baixar.anexo.consu', ['id' => $trabalho->id]) }}"><img class="" src="{{asset('img/icons/pdf.ico')}}" style="width:40px" alt=""></a>
</div> </div>
@endif @endif
@if($evento->tipo == 'PIBIC' && $evento->natureza_id == 2)
<div class="col-sm-4">
<label title="Decisão da Câmara ou Conselho Pertinente" for="anexo_acao_afirmativa" class="col-form-label font-tam" style="font-weight: bold">{{ __('Ação Afirmativa: ') }}</label>
<a href="{{ route('baixar.anexo.acao.afirmativa', ['id' => $trabalho->id]) }}"><img class="" src="{{asset('img/icons/pdf.ico')}}" style="width:40px" alt=""></a>
</div>
@endif
@if($evento->nome_docExtra != null) @if($evento->nome_docExtra != null)
{{-- Documento Extra --}} {{-- Documento Extra --}}
<div class="col-sm-4"> <div class="col-sm-4">
......
...@@ -132,6 +132,44 @@ ...@@ -132,6 +132,44 @@
</div> </div>
</div> </div>
@endif @endif
@if($edital->tipo == "PIBIC" && $edital->natureza_id == 2)
<div class="form-group col-md-6">
<label for="botao" class="col-form-label font-tam @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf." style="font-weight: bold;">
O questionário de pesquisa de prospecção interna foi respondido?<span style="color: red; font-weight:bold"> *</span>
</label>
<input type="radio" id="formSim" name="preenchimentoFormFlag" value="sim">
<label for="formSim" style="margin-right: 5px">Sim</label>
<input type="radio" id="formNao" name="preenchimentoFormFlag" value="nao" checked>
<label for="formNao" style="margin-right: 5px;">Não</label><br>
<a href="https://forms.gle/cAND8Z3z1yVr9u6a6" target="_blank" style="margin: 0px;">(endereço eletrônico de acesso)</a>
</div>
<div class="form-group col-md-6">
<label for="botao" class="col-form-label font-tam @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf." style="font-weight: bold">{{ __('Possui estudante(s) de ações afirmativas?') }} </label>
<input type="radio" id="radioAcoesAfirmativasSim" name="radioAcoesAfirmativas" onchange="displayAcoesAfirmativas('sim')" value="sim">
<label for="radioSim" style="margin-right: 5px">Sim</label>
<input type="radio" id="radioAcoesAfirmativasNao" name="radioAcoesAfirmativas" onchange="displayAcoesAfirmativas('nao')" checked
value="nao">
<label for="radioNao" style="margin-right: 5px" >Não</label><br>
<div class="form-group" id="displayAcoesAfirmativas" style="display: none; margin-top:-1rem">
<label for="nomeTrabalho" class="col-form-label font-tam" style="font-weight: bold;font-size: 13px">{{ __('Declaração de ação afirmativa') }}<span style="color: red; font-weight:bold"> *</span></label>
<input type="file" class="input-group-text" name="anexo_acao_afirmativa" accept=".pdf" />
@error('anexoAcaoAfirmativa')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
@endif
@if($edital->nome_docExtra != null) @if($edital->nome_docExtra != null)
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label title="{{$edital->nome_docExtra}}" for="anexo_docExtra" class="col-form-label font-tam" style="font-weight: bold">{{$edital->nome_docExtra}}: @if($edital->obrigatoriedade_docExtra == true) <span style="color: red; font-weight:bold">*</span> @endif</label> <label title="{{$edital->nome_docExtra}}" for="anexo_docExtra" class="col-form-label font-tam" style="font-weight: bold">{{$edital->nome_docExtra}}: @if($edital->obrigatoriedade_docExtra == true) <span style="color: red; font-weight:bold">*</span> @endif</label>
...@@ -176,4 +214,12 @@ ...@@ -176,4 +214,12 @@
} }
} }
function displayAcoesAfirmativas(valor) {
if(valor == "sim"){
document.getElementById("displayAcoesAfirmativas").style.display = "block";
}else {
document.getElementById("displayAcoesAfirmativas").style.display = "none";
}
}
</script> </script>
\ No newline at end of file
...@@ -69,6 +69,13 @@ ...@@ -69,6 +69,13 @@
</div> </div>
@endif @endif
@if($edital->tipo == 'PIBIC' && $edital->natureza_id == 2)
<div class="col-sm-4">
<label title="Decisão da Câmara ou Conselho Pertinente" for="anexo_acao_afirmativa" class="col-form-label font-tam" style="font-weight: bold">{{ __('Ação Afirmativa: ') }}</label>
<a href="{{ route('baixar.anexo.acao.afirmativa', ['id' => $projeto->id]) }}"><img class="" src="{{asset('img/icons/pdf.ico')}}" style="width:40px" alt=""></a>
</div>
@endif
@if($edital->nome_docExtra != null) @if($edital->nome_docExtra != null)
{{-- Documento Extra --}} {{-- Documento Extra --}}
<div class="col-sm-4"> <div class="col-sm-4">
......
...@@ -212,6 +212,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function () { ...@@ -212,6 +212,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function () {
//########## Rotas de download de documentos ########################### //########## Rotas de download de documentos ###########################
Route::get('/baixar/anexo-projeto/{id}', 'TrabalhoController@baixarAnexoProjeto')->name('baixar.anexo.projeto'); 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-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-comite/{id}', 'TrabalhoController@baixarAnexoComite')->name('baixar.anexo.comite'); 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-justificativa/{id}', 'TrabalhoController@baixarAnexoJustificativa')->name('baixar.anexo.justificativa');
Route::get('/baixar/anexo-lattes/{id}', 'TrabalhoController@baixarAnexoLattes')->name('baixar.anexo.lattes'); Route::get('/baixar/anexo-lattes/{id}', 'TrabalhoController@baixarAnexoLattes')->name('baixar.anexo.lattes');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment