Commit e2fb03cf authored by Gabriel-31415's avatar Gabriel-31415
Browse files

ajuste no formulario, anexos do comite e justificativa

parent 9eeb2fac
......@@ -43,10 +43,10 @@ class UpdateTrabalho extends FormRequest
'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 +91,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');
// $DATABASE_URL=parse_url('postgres://shldedzeknxkxv:2b9d0bcbdc7bd07dcbc4db2716e1af333788b38234d527435607a3fd1353f52b@ec2-54-227-246-76.compute-1.amazonaws.com:5432/d87d2lg0us76su');
return [
/*
......@@ -63,34 +63,34 @@ return [
]) : [],
],
// 'pgsql' => [
// 'driver' => 'pgsql',
// 'url' => env('DATABASE_URL'),
// 'host' => env('DB_HOST', '127.0.0.1'),
// 'port' => env('DB_PORT', '5432'),
// 'database' => env('DB_DATABASE', 'forge'),
// 'username' => env('DB_USERNAME', 'forge'),
// 'password' => env('DB_PASSWORD', ''),
// 'charset' => 'utf8',
// 'prefix' => '',
// 'prefix_indexes' => true,
// 'schema' => 'public',
// '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' => '',
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
),
'schema' => 'public',
'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',
......
<?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');
});
}
}
......@@ -140,15 +140,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 +173,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 )
......
......@@ -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');
......
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