"git@sites.upe.br:walter.felipe/submeta.git" did not exist on "561112636a91cfbea9a6f1699e5147a748cc17ce"
Commit ff06a2da authored by Yuri Resende's avatar Yuri Resende
Browse files

Permitindo a submissão de projetos para editais de fluxo continuo

parent 37084fbc
......@@ -327,6 +327,14 @@ class TrabalhoController extends Controller
$trabalho->anexo_docExtra = Storage::putFileAs($pasta, $request->anexo_docExtra, "Documento_Extra." . $request->file('anexo_docExtra')->extension());
}
//Anexo SIPAC
if (isset($request->anexo_SIPAC)) {
if (Storage::disk()->exists($trabalho->anexo_SIPAC)) {
Storage::delete($trabalho->anexo_SIPAC);
}
$trabalho->anexo_SIPAC = Storage::putFileAs($pasta, $request->anexo_SIPAC, "Anexo_SIPAC." . $request->file('anexo_SIPAC')->extension());
}
$trabalho->save();
return $trabalho;
}
......@@ -1145,7 +1153,6 @@ class TrabalhoController extends Controller
public function salvar(StoreTrabalho $request)
{
try {
if (!$request->has('rascunho')) {
$request->merge([
......@@ -1163,14 +1170,21 @@ class TrabalhoController extends Controller
if($evento->tipo=="PIBEX"){
$trabalho = Auth::user()->proponentes->trabalhos()
->create($request->except([
'anexoProjeto', 'anexoDecisaoCONSU','modalidade','anexo_docExtra'
'anexoProjeto', 'anexoDecisaoCONSU','modalidade','anexo_docExtra', 'anexo_SIPAC'
]));
}else{
}else if($evento->tipo=="CONTINUO"){
$trabalho = Auth::user()->proponentes->trabalhos()
->create($request->except([
'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao',
'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'anexoAutorizacaoComiteEtica',
'justificativaAutorizacaoEtica','modalidade','anexo_docExtra'
'justificativaAutorizacaoEtica','modalidade','anexo_docExtra',
]));
} else {
$trabalho = Auth::user()->proponentes->trabalhos()
->create($request->except([
'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao',
'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'anexoAutorizacaoComiteEtica',
'justificativaAutorizacaoEtica','modalidade','anexo_docExtra', 'anexo_SIPAC'
]));
}
......
......@@ -76,7 +76,7 @@ class StoreTrabalho extends FormRequest
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"){
if($evento->tipo!="PIBEX" && $evento->tipo!="CONTINUO"){
$rules['anexoPlanilhaPontuacao'] = ['required'];
$rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf'];
$rules['anexoGrupoPesquisa'] = ['required', 'mimes:pdf'];
......@@ -98,9 +98,12 @@ class StoreTrabalho extends FormRequest
}
$rules['linkLattesEstudante'] = ['required', 'string'];
$rules['anexoProjeto'] = ['required', 'mimes:pdf'];
$rules['anexoDecisaoCONSU'] = [Rule::requiredIf($evento->consu), 'mimes:pdf'];
if($evento->tipo!="CONTINUO"){
$rules['anexoProjeto'] = ['required', 'mimes:pdf'];
}
return $rules;
}
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAnexoSipacToTrabalhosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('trabalhos', function (Blueprint $table) {
$table->string('anexo_SIPAC')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('trabalhos', function (Blueprint $table) {
$table->dropColumn('anexo_SIPAC');
});
}
}
......@@ -13,9 +13,9 @@
@if($edital->tipo == "CONTINUO")
<div class="form-group col-md-6" style="margin-top: 10px">
<label for="anexoSIPAC" class="col-form-label font-tam" style="font-weight: bold">{{ __('Processo SIPAC: ') }}<span style="color: red; font-weight:bold">*</span></label>
<input type="file" class="input-group-text" name="SIPAC" placeholder="PDF do processo SIPAC" accept=".pdf" />
@error('anexoSIPAC')
<label for="anexo_SIPAC" class="col-form-label font-tam" style="font-weight: bold">{{ __('Processo SIPAC: ') }}<span style="color: red; font-weight:bold">*</span></label>
<input type="file" class="input-group-text" name="anexo_SIPAC" placeholder="PDF do processo SIPAC" accept=".pdf" />
@error('anexo_SIPAC')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
......
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