Unverified Commit f8122be5 authored by Gabriel Antônio da Silva's avatar Gabriel Antônio da Silva Committed by GitHub
Browse files

Merge pull request #136 from Gabriel-31415/master

add consu opcional no edital, ajuste no complemento
parents 035e8bd3 903599cb
web: vendor/bin/heroku-php-apache2 public/
......@@ -166,6 +166,7 @@ class EventoController extends Controller
$evento['coordenadorId'] = $request->coordenador_id;
$evento['criador_id'] = $user_id;
$evento['numParticipantes'] = $request->numParticipantes;
$evento['consu'] = $request->has('consu');
$evento['anexosStatus'] = 'final';
//dd($evento);
......@@ -395,7 +396,7 @@ class EventoController extends Controller
$evento->resultado_preliminar = $request->resultado_preliminar;
$evento->resultado_final = $request->resultado_final;
$evento->coordenadorId = $request->coordenador_id;
$evento->consu = $request->has('consu');
if($request->pdfEdital != null){
$pdfEdital = $request->pdfEdital;
$path = 'pdfEdital/' . $evento->id . '/';
......
......@@ -2,9 +2,10 @@
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use App\Evento;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Auth;
use Illuminate\Foundation\Http\FormRequest;
class StoreTrabalho extends FormRequest
{
......@@ -26,7 +27,7 @@ class StoreTrabalho extends FormRequest
public function rules()
{
$evento = Evento::find($this->editalId);
$rules = [
'editalId' => ['required', 'string'],
'marcado.*' => ['required'],
......@@ -37,7 +38,7 @@ class StoreTrabalho extends FormRequest
'pontuacaoPlanilha' => ['required', 'string'],
'linkGrupoPesquisa' => ['required', 'string'],
'anexoProjeto' => ['required', 'mimes:pdf'],
'anexoDecisaoCONSU' => ['required', 'mimes:pdf'],
'anexoDecisaoCONSU' => [Rule::requiredIf($evento->consu), 'mimes:pdf'],
'anexoPlanilhaPontuacao' => ['required'],
'anexoLattesCoordenador' => ['required', 'mimes:pdf'],
'anexoGrupoPesquisa' => ['required', 'mimes:pdf'],
......
......@@ -2,10 +2,11 @@
namespace App\Http\Requests;
use App\Evento;
use App\Trabalho;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Auth;
use Illuminate\Foundation\Http\FormRequest;
class UpdateTrabalho extends FormRequest
{
......@@ -27,7 +28,7 @@ class UpdateTrabalho extends FormRequest
public function rules()
{
$projeto = Trabalho::find($this->id);
$evento = Evento::find($this->editalId);
$rules = [
'editalId' => ['required', 'string'],
'marcado.*' => ['required'],
......@@ -38,15 +39,15 @@ class UpdateTrabalho extends FormRequest
'pontuacaoPlanilha' => ['required', 'string'],
'linkGrupoPesquisa' => ['required', 'string'],
'anexoProjeto' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoProjeto == null)], 'mimes:pdf'],
'anexoDecisaoCONSU' => ['mimes:pdf'],
'anexoDecisaoCONSU' => [Rule::requiredIf($evento->consu), 'mimes:pdf'],
'anexoPlanilhaPontuacao' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoPlanilhaPontuacao == null)]],
'anexoLattesCoordenador' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoLattesCoordenador == null)], 'mimes:pdf'],
'anexoGrupoPesquisa' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoGrupoPesquisa == null)], 'mimes:pdf'],
'anexoAutorizacaoComiteEtica' => [
Rule::requiredIf((!$this->has('rascunho') && $projeto->anexoAutorizacaoComiteEtica == null) )
Rule::requiredIf((!$this->has('rascunho') && $projeto->justificativaAutorizacaoEtica == null && $projeto->anexoAutorizacaoComiteEtica == null) )
],
'justificativaAutorizacaoEtica' => [
Rule::requiredIf((!$this->has('rascunho') && $projeto->anexoAutorizacaoComiteEtica == null))
Rule::requiredIf((!$this->has('rascunho') && $projeto->anexoAutorizacaoComiteEtica == null && $projeto->justificativaAutorizacaoEtica == null))
],
];
......@@ -91,4 +92,14 @@ class UpdateTrabalho extends FormRequest
return $rules;
}
}
public function messages()
{
return [
'titulo.required' => 'O :attribute é obrigatório',
'justificativaAutorizacaoEtica.required' => 'O campo justificativa Autorizacao Etica é obrigatório',
'anexoAutorizacaoComiteEtica.required' => 'O campo anexoAutorizacao Comite Etica é obrigatório',
];
}
}
<?php
use Illuminate\Support\Str;
// $DATABASE_URL=parse_url('postgres://shldedzeknxkxv:2b9d0bcbdc7bd07dcbc4db2716e1af333788b38234d527435607a3fd1353f52b@ec2-54-227-246-76.compute-1.amazonaws.com:5432/d87d2lg0us76su');
return [
/*
......@@ -15,7 +15,7 @@ return [
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
'default' => env('DB_CONNECTION', 'pgsql'),
/*
|--------------------------------------------------------------------------
......@@ -78,6 +78,20 @@ return [
'sslmode' => 'prefer',
],
// 'pgsql' => array(
// 'driver' => 'pgsql',
// 'host' => $DATABASE_URL['host'],
// 'port' => $DATABASE_URL['port'],
// 'database' => ltrim($DATABASE_URL['path'], "/"),
// 'username' => $DATABASE_URL['user'],
// 'password' => $DATABASE_URL['pass'],
// 'charset' => 'utf8',
// 'prefix' => '',
// 'prefix_indexes' => true,
// 'schema' => 'public',
// 'sslmode' => 'prefer',
// ),
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterTableEventos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('eventos', function (Blueprint $table) {
$table->boolean('consu')->default(false);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('eventos', function (Blueprint $table) {
$table->dropColumn('consu');
});
}
}
......@@ -15,7 +15,7 @@
</div>
{{-- nome | Participantes | Tipo--}}
<div class="row justify-content-center">
<div class="col-sm-6">
<div class="col-sm-12">
<label for="nome" class="col-form-label">{{ __('Nome*:') }}</label>
<input id="nome" type="text" class="form-control @error('nome') is-invalid @enderror" name="nome" value="{{ old('nome') }}" required autocomplete="nome" autofocus>
......@@ -26,7 +26,7 @@
@enderror
</div>
<div class="col-sm-2">
<div class="col-sm-5">
<label for="tipo" class="col-form-label">{{ __('Tipo*:') }}</label>
<select id="tipo" type="text" class="form-control @error('tipo') is-invalid @enderror" name="tipo" value="{{ old('tipo') }}" required>
<option @if(old('tipo')=='PIBIC' ) selected @endif value="PIBIC">PIBIC</option>
......@@ -56,7 +56,8 @@
@enderror
</div>
<div class="col-sm-2">
<label for="numParticipantes" class="col-form-label">{{ __('numParticipantes*:') }}</label>
<label for="numParticipantes" class="col-form-label">{{ __('Nº de Participantes*:') }}</label>
<input id="numParticipantes" type="number" min="1" max="20" class="form-control @error('numParticipantes') is-invalid @enderror" name="numParticipantes" value="{{ old('numParticipantes') }}" required autocomplete="numParticipantes" autofocus>
@error('numParticipantes')
......@@ -65,6 +66,18 @@
</span>
@enderror
</div>
<div class="col-sm-3">
<label for="consu" class="col-form-label">{{ __('Consu obrigatório?*') }}</label>
<br>
<input type="checkbox" name="consu" id="consu">
{{-- <input id="consu" type="checkbox" class="form-control @error('consu') is-invalid @enderror" name="consu" @if(old('consu')) checked @endif required autocomplete="consu" autofocus> --}}
@error('consu')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>{{-- end nome | Participantes | Tipo--}}
{{-- Descricao Edital --}}
......
......@@ -15,7 +15,7 @@
</div>
{{-- nome | Tipo--}}
<div class="row justify-content-center">
<div class="col-sm-6">{{--Nome do evento--}}
<div class="col-sm-12">{{--Nome do evento--}}
<label for="nome" class="col-form-label">{{ __('Nome*:') }}</label>
<input value="{{$evento->nome}}" id="nome" type="text" class="form-control @error('nome') is-invalid @enderror" name="nome" value="{{ old('nome') }}" required autocomplete="nome" autofocus>
......@@ -27,7 +27,7 @@
</div>{{--End Nome do evento--}}
{{-- Tipo do evento --}}
<div class="col-sm-2">
<div class="col-sm-5">
<label for="tipo" class="col-form-label">{{ __('Tipo*:') }}</label>
<!-- <input value="{{$evento->tipo}}" id="tipo" type="text" class="form-control @error('tipo') is-invalid @enderror" name="tipo" value="{{ old('tipo') }}" required autocomplete="tipo" autofocus> -->
<select id="tipo" type="text" class="form-control @error('tipo') is-invalid @enderror" name="tipo" required>
......@@ -70,6 +70,18 @@
</span>
@enderror
</div>
<div class="col-sm-3">
<label for="consu" class="col-form-label">{{ __('Consu obrigatório?*') }}</label>
<br>
<input type="checkbox" @if($evento->consu) checked @endif name="consu" id="consu">
{{-- <input id="consu" type="checkbox" class="form-control @error('consu') is-invalid @enderror" name="consu" @if(old('consu')) checked @endif required autocomplete="consu" autofocus> --}}
@error('consu')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>{{-- end nome | Participantes | Tipo--}}
{{-- Descricao Evento --}}
......
......@@ -41,6 +41,17 @@
@enderror
@endcomponent
</div>
@if($edital->consu)
<div class="form-group col-md-6">
<label class=" control-label" for="firstname">Decisão do CONSU (.pdf)<span style="color: red; font-weight:bold">*</span></label>
<input type="file" class="input-group-text" name="anexoDecisaoCONSU" accept=".pdf" />
@error('anexoDecisaoCONSU')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
@else
<div class="form-group col-md-6">
<label class=" control-label" for="firstname">Decisão do CONSU (.pdf)</label>
<input type="file" class="input-group-text" name="anexoDecisaoCONSU" accept=".pdf" />
......@@ -51,6 +62,8 @@
@enderror
</div>
@endif
<div class="form-group col-md-6" style="margin-top: 10px">
@component('componentes.input', ['label' => 'Grupo de Pesquisa (.pdf)'])
<input type="file" class="input-group-text" name="anexoGrupoPesquisa" placeholder="Anexo do Grupo de Pesquisa" accept="application/pdf" />
......
......@@ -102,7 +102,7 @@
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="text" class="form-control" value="{{old('cep')[$i] ?? "" }}" name="cep[{{$i}}]" placeholder="CEP" />
<input type="text" class="form-control cep" value="{{old('cep')[$i] ?? "" }}" name="cep[{{$i}}]" placeholder="CEP" />
@error('cep.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
......@@ -167,14 +167,15 @@
@endcomponent
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Complemento',])
<div class="form-group">
<label class=" control-label" for="firstname">Complemento</label>
<input type="text" class="form-control" value="{{old('complemento')[$i] ?? "" }}" name="complemento[{{$i}}]" placeholder="Complemento" />
@error('complemento.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="col-6">
......
......@@ -29,20 +29,20 @@
<div class="row justify-content-center">
@component('evento.formulario.projeto', ['grandeAreas' => $grandeAreas])
@endcomponent
@include('evento.formulario.projeto')
@component('evento.formulario.proponente')
@endcomponent
@component('evento.formulario.anexos')
@endcomponent
@include('evento.formulario.proponente')
@component('evento.formulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno, 'edital'=>$edital])
@endcomponent
@component('evento.formulario.finalizar')
@endcomponent
@include('evento.formulario.anexos')
@include('evento.formulario.participantes')
@include('evento.formulario.finalizar')
</div>
</div>
......
......@@ -83,6 +83,35 @@
</div>
{{-- Anexo da Decisão do CONSU --}}
@if($edital->consu)
<div class="form-group col-md-6" style="margin-top: 10px">
<div class="row justify-content-center">
<div class="col-12">
<div class="form-group">
<label class=" control-label" for="firstname">Decisão do CONSU (.pdf<span style="color: red; font-weight:bold">*</span>)</label>
<input type="file" class="input-group-text" name="anexoDecisaoCONSU" accept=".pdf" />
@error('anexoDecisaoCONSU')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
@if($projeto->anexoDecisaoCONSU)
<div class="col-3 ">
<a href="{{ route('baixar.anexo.consu', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div>
@else
<div class="col-3 text-danger">
<p><i class="fas fa-times-circle fa-2x"></i></p>
</div>
@endif
</div>
</div>
@else
<div class="form-group col-md-6" style="margin-top: 10px">
<div class="row justify-content-center">
<div class="col-12">
......@@ -111,6 +140,9 @@
</div>
</div>
@endif
{{-- Anexo do Grupo de Pesquisa --}}
<div class="form-group col-md-6" style="margin-top: 10px">
<div class="row justify-content-center">
......@@ -140,15 +172,15 @@
<div class="form-group col-md-6">
<label for="botao" class="col-form-label @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf." style="margin-right: 15px;">{{ __('Possui autorizações especiais?') }} <span style="color: red; font-weight:bold">*</span></label>
<input type="radio" checked id="radioSim" name="sim" onchange="displayAutorizacoesEspeciais('sim')">
<input type="radio" id="radioSim" @if($projeto->anexoAutorizacaoComiteEtica) checked @endif name="sim" onchange="displayAutorizacoesEspeciais('sim')">
<label for="radioSim" style="margin-right: 5px">Sim</label>
<input type="radio" id="radioNao" name="nao" onchange="displayAutorizacoesEspeciais('nao')">
<input type="radio" id="radioNao" @if($projeto->justificativaAutorizacaoEtica) checked @endif name="nao" onchange="displayAutorizacoesEspeciais('nao')">
<label for="radioNao" style="margin-right: 5px">Não</label><br>
<span id="idAvisoAutorizacaoEspecial" class="invalid-feedback" role="alert" style="overflow: visible; display:none">
<strong>Selecione a autorização e envie o arquivo!</strong>
</span>
<div class="form-group" id="displaySim" style="display: block; margin-top:-1rem">
<div class="form-group" id="displaySim" @if($projeto->anexoAutorizacaoComiteEtica) style="display: block; margin-top:-1rem" @else style="display: none; margin-top:-1rem" @endif >
@component('componentes.input', ['label' => 'Sim, declaro que necessito de autorizações especiais (.pdf)'])
<input type="file" class="input-group-text" name="anexoAutorizacaoComiteEtica" accept=".pdf" />
<div class="row justify-content-center">
......@@ -173,7 +205,7 @@
@endcomponent
</div>
<div class="form-group" id="displayNao" style="display: none; margin-top:-1rem">
<div class="form-group" id="displayNao" @if($projeto->justificativaAutorizacaoEtica) style="display: block; margin-top:-1rem" @else style="display: none; margin-top:-1rem" @endif >
@component('componentes.input', ['label' => 'Declaração de que não necessito de autorização especiais (.pdf)'])
<input type="file" class="input-group-text" name="justificativaAutorizacaoEtica" accept=".pdf" />
@if($projeto->justificativaAutorizacaoEtica || $projeto->anexoAutorizacaoComiteEtica )
......
......@@ -403,7 +403,7 @@
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="text" class="form-control" value="{{old('cep')[$i] ?? "" }}" name="cep[{{$i}}]" placeholder="CEP" />
<input type="text" class="form-control cep" value="{{old('cep')[$i] ?? "" }}" name="cep[{{$i}}]" placeholder="CEP" />
@error('cep.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
......@@ -468,14 +468,15 @@
@endcomponent
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Complemento',])
<div class="form-group">
<label class=" control-label" for="firstname">Complemento</label>
<input type="text" class="form-control" value="{{old('complemento')[$i] ?? "" }}" name="complemento[{{$i}}]" placeholder="Complemento" />
@error('complemento.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="col-6">
......
......@@ -106,6 +106,19 @@
<script>
if(document.getElementById("radioSim").checked){
document.getElementById("radioSim").checked = true;
document.getElementById("radioNao").checked = false;
document.getElementById("displaySim").style.display = "block";
document.getElementById("displayNao").style.display = "none";
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
}else{
document.getElementById("radioSim").checked = false;
document.getElementById("radioNao").checked = true;
document.getElementById("displaySim").style.display = "none";
document.getElementById("displayNao").style.display = "block";
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
}
let buttonSubmit = document.getElementById('idButtonSubmitProjeto');
let buttonRascunho = document.getElementById('idButtonSubmitRascunho');
......@@ -148,6 +161,18 @@
}
}
var SPMaskBehavior = function (val) {
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
},
spOptions = {
onKeyPress: function(val, e, field, options) {
field.mask(SPMaskBehavior.apply({}, arguments), options);
}
};
$("input.cpf:text").mask("000.000.000-00");
$("input.celular:text").mask(SPMaskBehavior, spOptions);
$("input.cep:text").mask("00000-000");
buttonMais.addEventListener("click", (e) => {
......
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